1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix OSD event after player reset

This commit is contained in:
viown 2024-10-15 12:52:05 +03:00
parent dfff2efefc
commit 0008f89267

View file

@ -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();