Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Youtube iframe videos do not work in react-native webview

$
0
0

I have a problem with playing youtube or instagram videos wrapped inside iframe using react-native-webview. The problem is only in Android. IOS works fine.

So, when i put iframe into webview it looks ok. Until I click on play button. Video starts loading, all native buttons are available and sound works fine but the movie is black. Sound and stop/play buttons work.

Dependencies:

react-native-cli: 2.0.1react-native: 0.57.5"react-native-webview": "^2.12.1"

I prepared simple demo where the videos do not work:

  render() {    return (<WebView        originWhitelist={['*']}        useWebKit={false}        source={{          html: `          XX<div><iframe width="320" height="240" src="https://www.youtube.com/embed/li8yILhFFZM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> </div> `        }}      />    );  }}

and screenshot of the problem:

enter image description here

Thank you for help!


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>