Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android video WebView FullScreen not working - onShowCustomView() not called

I'm trying to load a video URL in a WebView in android using the example in this project: https://github.com/hanksudo/android-webview-youtube-fullscreen

Thing is the onShowCustomView method is never called. Whenever I click on the full screen button of the video I get this error:

I/chromium: [INFO:CONSOLE(0)] "Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.", source: https://m.youtube.com/watch?v=dRekGX6dQRY (0)

Anyone knows how to fix it? Why is the browser interpreting it as a JS request and not a user gesture to make the video fullscreen? Are there any special flags I can set to enable full screen?

Thanks!

like image 508
Andrei Verdes Avatar asked Mar 21 '19 08:03

Andrei Verdes


2 Answers

It is this high-priority bug in Google Chrome when used as WebView, fixed in Google Chrome 74.

https://bugs.chromium.org/p/chromium/issues/detail?id=945287

like image 90
TalkLittle Avatar answered Sep 24 '22 01:09

TalkLittle


My problem solved when I updated my android chrome application to v74.0.3729.112.

related announcement: https://i.stack.imgur.com/ASsiW.png

like image 36
Ismail KILIC Avatar answered Sep 25 '22 01:09

Ismail KILIC