const player = polyvLivePlayer({
wrap: '#player',
width: 800,
height: 533,
uid: 'uid',
vid: 'vid',
isAutoChange: true
});
const player = polyvLivePlayer({
wrap: '#player',
width: 800,
height: 533,
uid: 'uid',
vid: 'vid',
param1: 'user_polyv',
param2: '昵称POLYV'
});
直播播放器默认点击全屏按钮,是调用浏览器API requestFullscreen实现的系统全屏,全屏后一定会使用浏览器的默认控制栏皮肤。若在手机端H5播放,想实现类似APP的全屏+横屏效果。可以添加如下参数实现,实现方案是控制样式css处理页面旋转达到与APP类似效果。
const player = polyvLivePlayer({
wrap: '#player',
width: 800,
height: 533,
uid: 'uid',
vid: 'vid',
webPageFullScreen: true,
fullScreenOrientation: 'landscape'
})
若fullScreenOrientation参数不为landscape,仅设置webPageFullScreen:true参数,则点击全屏按钮不进入系统全屏,需要搭配全屏进入/退出事件处理相关样式。
const player = polyvLivePlayer({
wrap: '#player',
width: 800,
height: 533,
uid: 'uid',
vid: 'vid',
webPageFullScreen: true,
fullScreenOrientation: 'landscape'
})
player.on('s2j_onFullScreen', () => {
console.info('点击进入全屏按钮,将播放器铺满当前网页');
})
player.on('s2j_onFullScreen', () => {
console.info('点击退出全屏按钮,将播放器恢复原来大小');
})