Skip to content

设置旋转角度

注意

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

方法名

setRotation

用法

js
if (this.rotation == "DEGREE_0") {
  this.rotation = "DEGREE_90";
} else if (this.rotation == "DEGREE_90") {
  this.rotation = "DEGREE_180";
} else if (this.rotation == "DEGREE_180") {
  this.rotation = "DEGREE_270";
} else {
  this.rotation = "DEGREE_0";
}
this.$refs.refPlayer.setRotation({
  rotation: this.rotation
})
js
if (rotation.value == "DEGREE_0") {
  rotation.value = "DEGREE_90";
} else if (rotation.value == "DEGREE_90") {
  rotation.value = "DEGREE_180";
} else if (rotation.value == "DEGREE_180") {
  rotation.value = "DEGREE_270";
} else {
  rotation.value = "DEGREE_0";
}
let options = {
  rotation: rotation.value
}
let params = JSONObject.parse(JSON.stringify(options)) as JSONObject
refPlayer.value?.setRotation(params)

参数说明

参数名参数类型是否必填默认值参数描述
rotationString视图旋转角度,可选值:
DEGREE_0:0 度
DEGREE_90:90 度
DEGREE_180:180 度
DEGREE_270:270 度