Abu Adnan
Abu Adnan

Reputation: 11

Problem watching youtube or other videos fullscreen in TWebbrowser under Android using delphi

I'm doing an App for android using delphi FMX and TWebbrowser, the user would select a video from the listview which will then playback the video in a TWebbrowser control, the problem I'm facing is, even if the video is a youtube video as an example, I press on the maximize symbol, the video wont go fullscreen, nothing changes. is the a work around or am I doing something wrong. thanks. I'm using delphi 10.3.3

Upvotes: 0

Views: 373

Answers (1)

Dave Nottage
Dave Nottage

Reputation: 3602

You're not doing anything wrong - TWebBrowser needs to use a descendant of WebChromeClient (something that must be done in Java) that implements certain methods, as per this article:

https://medium.com/@oliverdamjan2013/fullscreen-youtube-video-in-webview-android-21f1c778cf56

I do something similar in this demo:

https://github.com/DelphiWorlds/Kastri/tree/master/Demos/WebBrowserFileChooser

Which makes use of a descendant of WebChromeClient that implements onShowFileChooser. The folder that has the Java code is here:

https://github.com/DelphiWorlds/Kastri/tree/master/Java/WebChromeClient

The code could be extended to implement the necessary methods (onShowCustomView etc) as per the other article linked to.

EDIT 10-NOV-2020

I've now updated the underlying Java code and updated the demo here:

https://github.com/DelphiWorlds/Kastri/tree/master/Demos/WebBrowserFileChooser

(rather than create a whole new demo)

To support viewing YouTube videos full screen. Please note that the demo relies on files in the Kastri library

Upvotes: 1

Related Questions