From 720bdf7ce01d7979880ccce396fcb0377cf0fd03 Mon Sep 17 00:00:00 2001 From: hongqiongxing Date: Tue, 9 Jan 2024 15:23:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(xgplayer):=20=E4=BF=AE=E5=A4=8D=E9=BB=98?= =?UTF-8?q?=E8=AE=A4rotate=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/xgplayer/src/player.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/xgplayer/src/player.js b/packages/xgplayer/src/player.js index 8d68a78d8..a8dfc4650 100644 --- a/packages/xgplayer/src/player.js +++ b/packages/xgplayer/src/player.js @@ -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 @@ -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