如果你是用的这个库链接描述官方文档找到全屏代码,你这报错可能api 更新了,没有这个方法或者你用错方式了。如果不是用的这个库那就不知道了。
Making the player fullscreen
To check if the player is currently fullscreen call the isFullscreen function on a player like so.
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.ready(function() {
// get, should be false
console.log(myPlayer.isFullscreen());
// set, tell the player it's in fullscreen
myPlayer.isFullscreen(true);
// get, should be true
console.log(myPlayer.isFullscreen());
});
To request that the player enter fullscreen call requestFullscreen.
var myPlayer = videojs('some-player-id');
myPlayer.src("http://www.example.com/path/to/video.mp4");
myPlayer.ready(function() {
myPlayer.requestFullscreen();
});