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:
parent
dfff2efefc
commit
0008f89267
1 changed files with 20 additions and 15 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue