mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #1462 from KGT1/seektoactionhandler
ActionHandler 'seekto' for Media Notification Seekbar
This commit is contained in:
commit
8748ffdc22
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(currentPlayer).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