liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -68,7 +68,9 @@ export struct DetailPlayShortVideoPage {
this.queryNewsInfoOfUser()
if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) {
await this.playerController.play()
this.imageVisible = false
await this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
}
}
}
... ... @@ -81,7 +83,9 @@ export struct DetailPlayShortVideoPage {
if (this.currentIndex === this.index) {
if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) {
await this.playerController.play()
this.imageVisible = false
await this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
} else {
this.playerController.pause()
}
... ... @@ -106,14 +110,18 @@ export struct DetailPlayShortVideoPage {
this.playerController.onCanplay = async () => {
this.ratio = this.playerController.videoWidth / this.playerController.videoHeight
await this.playerController.play()
this.imageVisible = false
await this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
}
} else {
if (!this.onlyWifiLoadVideo) {
await this.playerController.pause()
} else {
await this.playerController.play()
this.imageVisible = false
await this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
}
}
}
... ... @@ -186,7 +194,9 @@ export struct DetailPlayShortVideoPage {
await this.playerController.pause()
} else {
await this.playerController.play()
this.imageVisible = false
await this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
}
}
}
... ... @@ -363,7 +373,9 @@ export struct DetailPlayShortVideoPage {
this.onlyWifiLoadVideo = true
this.toastTextVisible = false
this.playerController?.play()
this.imageVisible = false
this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
})
}
.width('100%')
... ...
... ... @@ -250,6 +250,13 @@ export class WDPlayerController {
this.avPlayer?.play();
}
async startRenderFrame(cb: Function) {
this.avPlayer?.on('startRenderFrame', () => {
cb && cb();
console.info('startRenderFrame success')
})
}
async stop() {
// if (this.avPlayer == null) {
// await this.initPromise;
... ...