Showing
1 changed file
with
11 additions
and
4 deletions
| @@ -93,12 +93,14 @@ export struct DetailPlayShortVideoPage { | @@ -93,12 +93,14 @@ export struct DetailPlayShortVideoPage { | ||
| 93 | async videoStatusChange() { | 93 | async videoStatusChange() { |
| 94 | if (this.currentIndex === this.index) { | 94 | if (this.currentIndex === this.index) { |
| 95 | if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) { | 95 | if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) { |
| 96 | - await this.playerController.play() | 96 | + // await this.playerController.play() |
| 97 | + this.playerController?.switchPlayOrPause(); | ||
| 97 | await this.playerController.startRenderFrame(() => { | 98 | await this.playerController.startRenderFrame(() => { |
| 98 | this.imageVisible = false | 99 | this.imageVisible = false |
| 99 | }) | 100 | }) |
| 100 | } else { | 101 | } else { |
| 101 | - this.playerController.stop() | 102 | + // this.playerController.stop() |
| 103 | + this.playerController.pause() | ||
| 102 | } | 104 | } |
| 103 | } | 105 | } |
| 104 | } | 106 | } |
| @@ -246,7 +248,8 @@ export struct DetailPlayShortVideoPage { | @@ -246,7 +248,8 @@ export struct DetailPlayShortVideoPage { | ||
| 246 | async aboutToDisappear(): Promise<void> { | 248 | async aboutToDisappear(): Promise<void> { |
| 247 | console.log(TAG, 'aboutToDisappear', this.index) | 249 | console.log(TAG, 'aboutToDisappear', this.index) |
| 248 | await this.playerController?.pause() | 250 | await this.playerController?.pause() |
| 249 | - await this.playerController?.release(); | 251 | + // await this.playerController?.stop() |
| 252 | + // await this.playerController?.release(); | ||
| 250 | } | 253 | } |
| 251 | 254 | ||
| 252 | /** | 255 | /** |
| @@ -266,6 +269,7 @@ export struct DetailPlayShortVideoPage { | @@ -266,6 +269,7 @@ export struct DetailPlayShortVideoPage { | ||
| 266 | // height = rect.width | 269 | // height = rect.width |
| 267 | // } | 270 | // } |
| 268 | // 视频宽高比屏幕大,则宽度撑满 | 271 | // 视频宽高比屏幕大,则宽度撑满 |
| 272 | + //console.log(`cj2024 ratio = ${this.ratio} width / height = ${width / height}`) | ||
| 269 | if (this.ratio > width / height) { | 273 | if (this.ratio > width / height) { |
| 270 | this.playerWidth = '100%' | 274 | this.playerWidth = '100%' |
| 271 | this.playerHeight = px2vp(width / this.ratio) | 275 | this.playerHeight = px2vp(width / this.ratio) |
| @@ -274,7 +278,7 @@ export struct DetailPlayShortVideoPage { | @@ -274,7 +278,7 @@ export struct DetailPlayShortVideoPage { | ||
| 274 | this.playerHeight = '100%' | 278 | this.playerHeight = '100%' |
| 275 | this.playerWidth = px2vp(height * this.ratio) | 279 | this.playerWidth = px2vp(height * this.ratio) |
| 276 | } | 280 | } |
| 277 | - console.log('calculatePlayerRect=====', width, height) | 281 | + //console.log('cj2024 calculatePlayerRect=====', width, height,px2vp(this.windowHeight),this.playerHeight) |
| 278 | 282 | ||
| 279 | } | 283 | } |
| 280 | 284 | ||
| @@ -321,6 +325,7 @@ export struct DetailPlayShortVideoPage { | @@ -321,6 +325,7 @@ export struct DetailPlayShortVideoPage { | ||
| 321 | } | 325 | } |
| 322 | 326 | ||
| 323 | } | 327 | } |
| 328 | + // .backgroundColor(Color.Green) | ||
| 324 | .width('100%') | 329 | .width('100%') |
| 325 | .layoutWeight(1) | 330 | .layoutWeight(1) |
| 326 | .onClick(() => { | 331 | .onClick(() => { |
| @@ -467,6 +472,8 @@ export struct DetailPlayShortVideoPage { | @@ -467,6 +472,8 @@ export struct DetailPlayShortVideoPage { | ||
| 467 | } | 472 | } |
| 468 | .width('100%') | 473 | .width('100%') |
| 469 | .height('100%') | 474 | .height('100%') |
| 475 | + // .backgroundColor(Color.Orange) | ||
| 476 | + // .opacity(0.2) | ||
| 470 | 477 | ||
| 471 | } | 478 | } |
| 472 | 479 |
-
Please register or login to post a comment