mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add 'prompt to skip' to media segments
This commit is contained in:
parent
effa74356b
commit
0fb38c6894
7 changed files with 216 additions and 1 deletions
|
@ -26,6 +26,8 @@ import { MediaError } from 'types/mediaError';
|
|||
import { getMediaError } from 'utils/mediaError';
|
||||
import { toApi } from 'utils/jellyfin-apiclient/compat';
|
||||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind.js';
|
||||
import browser from 'scripts/browser.js';
|
||||
import { bindSkipSegment } from './skipsegment.ts';
|
||||
|
||||
const UNLIMITED_ITEMS = -1;
|
||||
|
||||
|
@ -933,6 +935,12 @@ export class PlaybackManager {
|
|||
return Promise.resolve(self._playQueueManager.getPlaylist());
|
||||
};
|
||||
|
||||
self.promptToSkip = function (mediaSegment) {
|
||||
if (mediaSegment && this._skipSegment) {
|
||||
this._skipSegment.onPromptSkip(mediaSegment);
|
||||
}
|
||||
};
|
||||
|
||||
function removeCurrentPlayer(player) {
|
||||
const previousPlayer = self._currentPlayer;
|
||||
|
||||
|
@ -3666,6 +3674,9 @@ export class PlaybackManager {
|
|||
}
|
||||
|
||||
bindMediaSegmentManager(self);
|
||||
if (!browser.tv && !browser.xboxOne && !browser.ps4) {
|
||||
this._skipSegment = bindSkipSegment(self);
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentPlayer() {
|
||||
|
@ -3680,6 +3691,10 @@ export class PlaybackManager {
|
|||
return this.getCurrentTicks(player) / 10000;
|
||||
}
|
||||
|
||||
getNextItem() {
|
||||
return this._playQueueManager.getNextItemInfo();
|
||||
}
|
||||
|
||||
nextItem(player = this._currentPlayer) {
|
||||
if (player && !enableLocalPlaylistManagement(player)) {
|
||||
return player.nextItem();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue