liyubing

Merge remote-tracking branch 'origin/main'

@@ -68,7 +68,9 @@ export struct DetailPlayShortVideoPage { @@ -68,7 +68,9 @@ export struct DetailPlayShortVideoPage {
68 this.queryNewsInfoOfUser() 68 this.queryNewsInfoOfUser()
69 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) { 69 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) {
70 await this.playerController.play() 70 await this.playerController.play()
  71 + await this.playerController.startRenderFrame(() => {
71 this.imageVisible = false 72 this.imageVisible = false
  73 + })
72 } 74 }
73 } 75 }
74 } 76 }
@@ -81,7 +83,9 @@ export struct DetailPlayShortVideoPage { @@ -81,7 +83,9 @@ export struct DetailPlayShortVideoPage {
81 if (this.currentIndex === this.index) { 83 if (this.currentIndex === this.index) {
82 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) { 84 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) {
83 await this.playerController.play() 85 await this.playerController.play()
  86 + await this.playerController.startRenderFrame(() => {
84 this.imageVisible = false 87 this.imageVisible = false
  88 + })
85 } else { 89 } else {
86 this.playerController.pause() 90 this.playerController.pause()
87 } 91 }
@@ -106,14 +110,18 @@ export struct DetailPlayShortVideoPage { @@ -106,14 +110,18 @@ export struct DetailPlayShortVideoPage {
106 this.playerController.onCanplay = async () => { 110 this.playerController.onCanplay = async () => {
107 this.ratio = this.playerController.videoWidth / this.playerController.videoHeight 111 this.ratio = this.playerController.videoWidth / this.playerController.videoHeight
108 await this.playerController.play() 112 await this.playerController.play()
  113 + await this.playerController.startRenderFrame(() => {
109 this.imageVisible = false 114 this.imageVisible = false
  115 + })
110 } 116 }
111 } else { 117 } else {
112 if (!this.onlyWifiLoadVideo) { 118 if (!this.onlyWifiLoadVideo) {
113 await this.playerController.pause() 119 await this.playerController.pause()
114 } else { 120 } else {
115 await this.playerController.play() 121 await this.playerController.play()
  122 + await this.playerController.startRenderFrame(() => {
116 this.imageVisible = false 123 this.imageVisible = false
  124 + })
117 } 125 }
118 } 126 }
119 } 127 }
@@ -186,7 +194,9 @@ export struct DetailPlayShortVideoPage { @@ -186,7 +194,9 @@ export struct DetailPlayShortVideoPage {
186 await this.playerController.pause() 194 await this.playerController.pause()
187 } else { 195 } else {
188 await this.playerController.play() 196 await this.playerController.play()
  197 + await this.playerController.startRenderFrame(() => {
189 this.imageVisible = false 198 this.imageVisible = false
  199 + })
190 } 200 }
191 } 201 }
192 } 202 }
@@ -363,8 +373,10 @@ export struct DetailPlayShortVideoPage { @@ -363,8 +373,10 @@ export struct DetailPlayShortVideoPage {
363 this.onlyWifiLoadVideo = true 373 this.onlyWifiLoadVideo = true
364 this.toastTextVisible = false 374 this.toastTextVisible = false
365 this.playerController?.play() 375 this.playerController?.play()
  376 + this.playerController.startRenderFrame(() => {
366 this.imageVisible = false 377 this.imageVisible = false
367 }) 378 })
  379 + })
368 } 380 }
369 .width('100%') 381 .width('100%')
370 .height(64) 382 .height(64)
@@ -250,6 +250,13 @@ export class WDPlayerController { @@ -250,6 +250,13 @@ export class WDPlayerController {
250 this.avPlayer?.play(); 250 this.avPlayer?.play();
251 } 251 }
252 252
  253 + async startRenderFrame(cb: Function) {
  254 + this.avPlayer?.on('startRenderFrame', () => {
  255 + cb && cb();
  256 + console.info('startRenderFrame success')
  257 + })
  258 + }
  259 +
253 async stop() { 260 async stop() {
254 // if (this.avPlayer == null) { 261 // if (this.avPlayer == null) {
255 // await this.initPromise; 262 // await this.initPromise;