Closed zhou-hai closed 5 years ago
机型:红米note5 系统版本:安卓7.1.2(MIUI版本为10.3.2) 浏览器:微信公众 问题描述:在ios中打开自动播放,安卓系统中,需要点击中间的播放按钮以后才能播放。要实现的功能是视频自动播放,以及动态切换视频 ` $(document).ready(function(){ alert( "执行前"); rebuildPlayer(src,type,box,poster); });
// 配置变化则销毁现有播放器,并重建新的播放器
function rebuildPlayer (src, type, box, poster) {
player && !player.destroyed && player.destroy();
player = new ChimeeMobilePlayer({
// 播放地址
src: src,
// 直播:live 点播:vod
isLive: type == 'live',
// 编解码容器
poster: poster,
// dom容器
wrapper: '#wrapper',
// video
autoplay: true,
controls: true,
playsInline: true,
preload: 'none',
/ x5VideoPlayerType: 'h5', x5VideoPlayerFullscreen: true, x5VideoOrientation: true, xWebkitAirplay: true,/ muted: true, autoload:true, box: box, disableUA: [ 'Mozilla/5.0 (Linux; Android 4.4.2; HM NOTE 1TD Build/KOT49H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/62.0.3202.97 Mobile Safari/537.36', ] // kernels: { // hls: ChimeeKernelHls // } // removeInnerPlugins: ['chimeeMobiControlbar', 'chimeeState'] });
try{
WeixinJSBridge && WeixinJsBridge.invoke('getNetworkType', {}, function () {
player.load();
})
}catch(e) {
console.warn('不支持WeixinJSBridge')
}
}
// 快捷按键操作
$('#btnDemo').on('click', function(e){
rebuildPlayer(src,type,box,poster);
});
`
安卓移动端不能自动播放