rotate
播放器旋转控件,可以自定义。源码
pluginName: rotate
该插件默认隐藏,如需开启如下配置playerConfig
const player = new Player({
...,
rotate: true //显示旋转按钮
})
// OR
const player = new Player({
...,
rotate: {
disable: false
} //显示旋转按钮
})
config
position
@type:Stringdefault:controlsRight, 具体枚举值请看plugin-positions
插件DOM挂载位置,默认为player.controls.right
index
@type:Numberdefault:6
插件DOM在挂载点内的排序,默认为6,越小越靠前(若index相同,后实例化的插件会被放置在前面)
disable
@type:Booleandefault:false
是否禁用
该配置项可通过playerConfig.rotate设置布尔值控制,默认值是false, 例如:
const playerConfig = {
rotate: true
...
}
innerRotate
@type:Booleandefault:false
true为只有画面旋转,false为整个播放器旋转
clockwise
@type:Booleandefault:false
是否按照顺时针方向旋转
rotateDeg
@type:Number0-1default:0
初始旋转角度,默认值0
events
Events.ROTATE
- 值:
rotate - 触发: 旋转画面成功
const player = new Player({
...
})
player.on(Events.ROTATE, (rotateDeg) => {
console.log('Degree of rotation is rotateDeg')
})