zhenghy

视频seek后播放

@@ -15,7 +15,9 @@ export struct PlayerProgressView { @@ -15,7 +15,9 @@ export struct PlayerProgressView {
15 if (this.playerController) { 15 if (this.playerController) {
16 this.playerController.onStatusChange = (status: number) => { 16 this.playerController.onStatusChange = (status: number) => {
17 this.status = status 17 this.status = status
18 - console.log('=============', this.status) 18 + }
  19 + this.playerController.onSeekDone = (status: number) => {
  20 + this.playerController?.play()
19 } 21 }
20 } 22 }
21 } 23 }
@@ -23,6 +23,7 @@ export class WDPlayerController { @@ -23,6 +23,7 @@ export class WDPlayerController {
23 public continue?: () => void; 23 public continue?: () => void;
24 public onCanplay?: () => void; 24 public onCanplay?: () => void;
25 public onStatusChange?: (status: number) => void; 25 public onStatusChange?: (status: number) => void;
  26 + public onSeekDone?: (time: number) => void;
26 27
27 constructor() { 28 constructor() {
28 Logger.error("初始化") 29 Logger.error("初始化")
@@ -122,6 +123,9 @@ export class WDPlayerController { @@ -122,6 +123,9 @@ export class WDPlayerController {
122 }) 123 })
123 this.avPlayer?.on('seekDone', (time: number) => { 124 this.avPlayer?.on('seekDone', (time: number) => {
124 this.initProgress(time); 125 this.initProgress(time);
  126 + if (this.onSeekDone) {
  127 + this.onSeekDone(time);
  128 + }
125 }) 129 })
126 this.avPlayer?.on(Events.VIDEO_SIZE_CHANGE, (width: number, height: number) => { 130 this.avPlayer?.on(Events.VIDEO_SIZE_CHANGE, (width: number, height: number) => {
127 if (this.onVideoSizeChange) { 131 if (this.onVideoSizeChange) {