react-native webview嵌入youtube视频在android中没有全屏选项

Man*_*ngh 6 youtube-api webview react-native

我正在尝试将YouTube视频嵌入到我的react-native应用程序中,它可以正常工作,但是我无法获得这些视频的全屏按钮/功能。这是我的代码

 <WebView
  source={{uri: "https://www.youtube.com/embed/VaC9CivyV7I?version=3&enablejsapi=1&rel=0&autoplay=1&showinfo=0&controls=1&modestbranding=0"}}
style={{height:240, width:width, justifyContent:'center', alignItems:'center', backgroundColor:'black'}}
 />
Run Code Online (Sandbox Code Playgroud)

我什至尝试将iframe用作html allowfullscren="true",但没有成功。不知道该怎么做,所以请帮忙,

编辑

经过一番搜寻更有我碰到过这样的文件的全屏支持,并提出要知道,我需要实现onShowCustomViewonHideCustomViewwebView.setWebChromeClient,我掏一点在我的应用程序的文件夹node_modules,发现ReactWebViewManager.java的位置”。 ./node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java“ ,似乎可能需要添加一些自定义代码webView.setWebChromeClient,但由于我不是在本机编程中表现出色,因此无法继续进行下去

Chr*_*ton 2

WebView组件接受一个allowsFullscreenVideoprop。当此属性为 true 时,全屏图标将变为活动状态。

请参阅https://github.com/react-native-community/react-native-webview/blob/master/docs/Reference.md#allowsfullscreenvideo