华为浏览器中Video.js无法自动播放 只能靠用户操作controls
以下是创建的代码
var iPlayHeight = (document.body.clientWidth) / 1.7777
var player = videojs('video-player', {
autoplay: true,
width:document.body.clientWidth,
height:iPlayHeight
}, function onPlayerReady() {
//视频加载完成后自动播放
setTimeout(function(){
player.play();
},1000)
});
在其他手机(小米,苹果)的浏览器中都可以,但就在华为Meta10 pro中不行
Androi版本 Android10 EMUI10
已经尝试过在touchstart时执行播放代码 但还是无法自动播放$(window).on('touchstart', function(){
setTimeout(function(){
player.play();
},1000)
});