Skip to content

设置播放速度

注意

该方法回调为异步事件,请参考方法事件

方法名

setSpeed

用法

js
this.currentSpeed += 0.5
if (this.currentSpeed > 3) {
  this.currentSpeed = 1.0
}
this.$refs.refPlayer.setSpeed({
  speed: this.currentSpeed
})
js
currentSpeed.value += 0.5
if (currentSpeed.value > 3) {
  currentSpeed.value = 1.0
}
let options = {
  speed: currentSpeed.value
}
let params = JSONObject.parse(JSON.stringify(options)) as JSONObject
refPlayer.value?.setSpeed(params)

参数说明

参数名参数类型是否必填默认值参数描述
speedFloat播放速度,取值范围:0.3 ~ 3.0