mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added ActionHandler seekto for Notification-Bar
This commit is contained in:
parent
c7fcddb3a2
commit
1042121668
1 changed files with 9 additions and 0 deletions
|
@ -241,6 +241,15 @@ import connectionManager from 'connectionManager';
|
||||||
navigator.mediaSession.setActionHandler('seekforward', function () {
|
navigator.mediaSession.setActionHandler('seekforward', function () {
|
||||||
execute('fastForward');
|
execute('fastForward');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* eslint-disable-next-line compat/compat */
|
||||||
|
navigator.mediaSession.setActionHandler('seekto', function (object) {
|
||||||
|
let item = playbackManager.getPlayerState(playbackManager.getCurrentPlayer()).NowPlayingItem;
|
||||||
|
// Convert to ms
|
||||||
|
let duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0);
|
||||||
|
let wantedTime = object.seekTime*1000;
|
||||||
|
playbackManager.seekPercent(wantedTime/duration*100,currentPlayer);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
events.on(playbackManager, 'playerchange', function () {
|
events.on(playbackManager, 'playerchange', function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue