Interactive YouTube user-view embedded video does not have full-screen options in Android

I am trying to embed a youtube video in my reaction based application, it works fine, but I cannot get the full screen button / functionality for these videos. Here is my code

 <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'}}
 />

I even tried using iframeas html with allowfullscren="true", but I did not get any success. I don’t know how to do this, so please help,

Edit

after some searching, I come across this document for full-screen support , and find out that I need to implement onShowCustomView and onHideCustomView in webView.setWebChromeClient , I dig a little in the node_modules folder and find ReactWebViewManager.java in location "../ node_modules / react-native / ReactAndroid / src / main / java / com / facebook / react / views / webview / ReactWebViewManager.java ", it might seem that you need to add some custom code webView.setWebChromeClient, but since I'm not so good at programming in my native language, therefore I do not get how to proceed further

+4

Source: https://habr.com/ru/post/1662135/


All Articles