I've been trying to use WebRTC on iOS platform in React, and I have trouble with 'playsInline' functions. I add both playsInline attributes on video tag, and set 'allowsInlineMediaPlayback' to be true on Webview settings. If camera button is toggled, full black screen popped up with 'live streaming' written on bottom, and then I closed the live streaming window, the camera stopped.
return (
<video
autoPlay = { true }
className = { className }
id = { id }
muted = { true }
playsInline = { true }
ref = { this._setVideoElement }
style = { style }
{ ...eventHandlers } />
);
<WebView
userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36"
source={{ uri: 'https://www.***' }}
ref = {webviewRef}
onMessage={handleOnMessage}
originWhitelist={['*']}
allowsInlineMediaPlayback = {true}
allowsFullscreenVideo = {true}
javaScriptEnabled = {true}
scalesPageToFit
mediaPlaybackRequiresUserAction={false}
startInLoadingState
javaScriptEnabledAndroid
useWebkit
/>
I added both 'playsInline' and 'allowsInlineMediaPlayback = { true }' and it doesn't work.