Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable auto play in WebView React Native?

Tags:

react-native

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.

like image 547
Rofiatul Adawiyah Avatar asked Dec 10 '18 14:12

Rofiatul Adawiyah


People also ask

How do I turn off WebView in react native?

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.

How do I embed a YouTube video in react native?

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.


1 Answers

You need to change the property mediaPlaybackRequiresUserAction={true}. Then it will stop the auto play.

like image 50
P.Lorand Avatar answered Oct 21 '22 05:10

P.Lorand