3

我尝试通过单击/点击按钮来全屏播放 video.js 视频。它在任何 iOS 设备上都可以正常工作。但在 Android 上(在 Galaxy S4 上的 4.1.2 上测试)视频播放,但不会进入全屏。知道如何在 Android 上全屏显示吗?谢谢!

这是我用于全屏更改的代码:

$('.slider .icon-play').click(function () {
                videojs("mobileVideo").ready(function () {
                    var myPlayer = this;
                    myPlayer.currentTime(0);
                    myPlayer.play();
                    myPlayer.on("loadedmetadata", function () {
                        this.requestFullScreen();
                        myPlayer.on("play", function () {
                            this.requestFullScreen();
                        });
                    });
                    myPlayer.on("ended", function () {
                        this.cancelFullScreen();
                    });
                });
            });
4

1 回答 1

0

this.requestFullScreen();

needs to be called from a user driven event.

see

Video.js enter fullscreen on play

于 2013-12-04T19:48:27.537 回答