Fix OSD event after player reset
This commit is contained in:
@@ -23,21 +23,6 @@ class SkipSegment extends PlaybackSubscriber {
|
||||
super(playbackManager);
|
||||
|
||||
this.onOsdChanged = this.onOsdChanged.bind(this);
|
||||
|
||||
Events.on(document, EventType.SHOW_VIDEO_OSD, this.onOsdChanged);
|
||||
}
|
||||
|
||||
onOsdChanged(_e: Event, isOpen: boolean) {
|
||||
if (this.currentSegment) {
|
||||
if (isOpen) {
|
||||
this.showSkipButton({
|
||||
animate: false,
|
||||
keep: true
|
||||
});
|
||||
} else if (!this.hideTimeout) {
|
||||
this.hideSkipButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onHideComplete() {
|
||||
@@ -129,6 +114,19 @@ class SkipSegment extends PlaybackSubscriber {
|
||||
}
|
||||
}
|
||||
|
||||
onOsdChanged(_e: Event, isOpen: boolean) {
|
||||
if (this.currentSegment) {
|
||||
if (isOpen) {
|
||||
this.showSkipButton({
|
||||
animate: false,
|
||||
keep: true
|
||||
});
|
||||
} else if (!this.hideTimeout) {
|
||||
this.hideSkipButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onPromptSkip(segment: MediaSegmentDto) {
|
||||
if (!this.currentSegment) {
|
||||
this.currentSegment = segment;
|
||||
@@ -152,6 +150,13 @@ class SkipSegment extends PlaybackSubscriber {
|
||||
}
|
||||
}
|
||||
|
||||
onPlayerChange(): void {
|
||||
if (this.playbackManager.getCurrentPlayer()) {
|
||||
Events.off(document, EventType.SHOW_VIDEO_OSD, this.onOsdChanged);
|
||||
Events.on(document, EventType.SHOW_VIDEO_OSD, this.onOsdChanged);
|
||||
}
|
||||
}
|
||||
|
||||
onPlaybackStop() {
|
||||
this.currentSegment = null;
|
||||
this.hideSkipButton();
|
||||
|
||||
Reference in New Issue
Block a user