Skip to content

Commit

Permalink
fix(xgplayer): 修复默认rotate异常问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hongqx committed Jan 30, 2024
1 parent eb101b3 commit 720bdf7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/xgplayer/src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2056,8 +2056,9 @@ class Player extends MediaProxy {
}

resizePosition () {
const { rotate, vy, vx, h, w } = this.videoPos
if (rotate < 0 && !vy && !vx) {
const { vy, vx, h, w } = this.videoPos
let rotate = this.videoPos.rotate
if (rotate < 0 && h < 0 && w < 0) {
return
}
let _pi = this.videoPos._pi
Expand All @@ -2068,13 +2069,14 @@ class Player extends MediaProxy {
return
}
this.videoPos.pi = _pi
rotate = rotate < 0 ? 0 : rotate
const _pos = {
rotate: rotate
rotate
}
let offsetY = 0
let offsetX = 0
let scale = 1
const _t = rotate < 0 ? 0 : Math.abs(rotate / 90)
const _t = Math.abs(rotate / 90)
const { root, innerContainer } = this
const width = root.offsetWidth
const height = innerContainer ? innerContainer.offsetHeight : root.offsetHeight
Expand Down

0 comments on commit 720bdf7

Please sign in to comment.