How to disable auto play in WebView React Native. because i try WebView to play video in my App still autoplay while i add "mediaPlaybackRequiresUserAction={false}". my code below:
<WebView style={{ justifyContent: 'center', alignItems: 'center'}} source={{uri: url}} mediaPlaybackRequiresUserAction={false} />
Please help me, thanks.
How do I disable WebView in react native? If we set javaScriptEnabled={true} then it will Enable the JavaScript on WebView. If we set javaScriptEnabled={false} then it will Disable the JavaScript on WebView.
To achieve playing Youtube videos in React Native, we will be making use of the npm dependency named react-native-youtube-iframe. We will work through using this library by fully integrating it into an app.
You need to change the property mediaPlaybackRequiresUserAction={true}
. Then it will stop the auto play.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With