zhenghy

视频seek后播放

... ... @@ -15,7 +15,9 @@ export struct PlayerProgressView {
if (this.playerController) {
this.playerController.onStatusChange = (status: number) => {
this.status = status
console.log('=============', this.status)
}
this.playerController.onSeekDone = (status: number) => {
this.playerController?.play()
}
}
}
... ...
... ... @@ -23,6 +23,7 @@ export class WDPlayerController {
public continue?: () => void;
public onCanplay?: () => void;
public onStatusChange?: (status: number) => void;
public onSeekDone?: (time: number) => void;
constructor() {
Logger.error("初始化")
... ... @@ -122,6 +123,9 @@ export class WDPlayerController {
})
this.avPlayer?.on('seekDone', (time: number) => {
this.initProgress(time);
if (this.onSeekDone) {
this.onSeekDone(time);
}
})
this.avPlayer?.on(Events.VIDEO_SIZE_CHANGE, (width: number, height: number) => {
if (this.onVideoSizeChange) {
... ...