javascripthtml5-videotelevisionweboslg

LG TV WebOS Video Exit Fullscreen on JavaScript


I have made an app that can load, play and stop videos. It can request fullscreen with following code:

        if (this.video.requestFullScreen) {
            this.video.requestFullScreen();
        } else if (this.video.webkitRequestFullScreen) {
            this.video.webkitRequestFullScreen();
        } else if (this.video.mozRequestFullScreen) {
            this.video.mozRequestFullScreen();
        }

It could exit fullscreen mode with the back button before the big software update that happened recently. Now it is not possible because "back" button on the remote opens the Smart-TV menu bar.

Does somebody can help with software "exit fullscreen" because the standard JS code does not work. The sample is here:

    if (document.fullscreenElement) {
        document.exitFullscreen();
    }

Obviously the Document object in webOS is limited, but I'm sure there has to be the way to exit full screen mode in video.


Solution

  • I discovered that LG browser is made on WebKit and used the method to toggle fullscreen described here:

    Toggle Fullscreen exit