mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'master' into fix_long_getItems_request_URL
This commit is contained in:
commit
09a6ef2cdb
85 changed files with 358 additions and 320 deletions
|
@ -114,8 +114,8 @@ import shell from '../../scripts/shell';
|
|||
const itemId = item.Id;
|
||||
|
||||
// Convert to ms
|
||||
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0);
|
||||
const currentTime = parseInt(playState.PositionTicks ? (playState.PositionTicks / 10000) : 0);
|
||||
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0, 10);
|
||||
const currentTime = parseInt(playState.PositionTicks ? (playState.PositionTicks / 10000) : 0, 10);
|
||||
|
||||
const isPaused = playState.IsPaused || false;
|
||||
const canSeek = playState.CanSeek || false;
|
||||
|
@ -247,7 +247,7 @@ import shell from '../../scripts/shell';
|
|||
navigator.mediaSession.setActionHandler('seekto', function (object) {
|
||||
const item = playbackManager.getPlayerState(currentPlayer).NowPlayingItem;
|
||||
// Convert to ms
|
||||
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0);
|
||||
const duration = parseInt(item.RunTimeTicks ? (item.RunTimeTicks / 10000) : 0, 10);
|
||||
const wantedTime = object.seekTime * 1000;
|
||||
playbackManager.seekPercent(wantedTime / duration * 100, currentPlayer);
|
||||
});
|
||||
|
|
|
@ -11,6 +11,7 @@ import { appHost } from '../apphost';
|
|||
import Screenfull from 'screenfull';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
import alert from '../alert';
|
||||
import { PluginType } from '../../types/plugin.ts';
|
||||
import { includesAny } from '../../utils/container.ts';
|
||||
import { getItems } from '../../utils/jellyfin-apiclient/getItems.ts';
|
||||
|
||||
|
@ -1693,7 +1694,7 @@ class PlaybackManager {
|
|||
|
||||
function changeStream(player, ticks, params) {
|
||||
if (canPlayerSeek(player) && params == null) {
|
||||
player.currentTime(parseInt(ticks / 10000));
|
||||
player.currentTime(parseInt(ticks / 10000, 10));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1717,7 +1718,7 @@ class PlaybackManager {
|
|||
const apiClient = ServerConnections.getApiClient(currentItem.ServerId);
|
||||
|
||||
if (ticks) {
|
||||
ticks = parseInt(ticks);
|
||||
ticks = parseInt(ticks, 10);
|
||||
}
|
||||
|
||||
const maxBitrate = params.MaxStreamingBitrate || self.getMaxStreamingBitrate(player);
|
||||
|
@ -2268,7 +2269,7 @@ class PlaybackManager {
|
|||
|
||||
function runInterceptors(item, playOptions) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const interceptors = pluginManager.ofType('preplayintercept');
|
||||
const interceptors = pluginManager.ofType(PluginType.PreplayIntercept);
|
||||
|
||||
interceptors.sort(function (a, b) {
|
||||
return (a.order || 0) - (b.order || 0);
|
||||
|
@ -3429,12 +3430,12 @@ class PlaybackManager {
|
|||
}
|
||||
|
||||
Events.on(pluginManager, 'registered', function (e, plugin) {
|
||||
if (plugin.type === 'mediaplayer') {
|
||||
if (plugin.type === PluginType.MediaPlayer) {
|
||||
initMediaPlayer(plugin);
|
||||
}
|
||||
});
|
||||
|
||||
pluginManager.ofType('mediaplayer').forEach(initMediaPlayer);
|
||||
pluginManager.ofType(PluginType.MediaPlayer).forEach(initMediaPlayer);
|
||||
|
||||
function sendProgressUpdate(player, progressEventName, reportPlaylist) {
|
||||
if (!player) {
|
||||
|
@ -3649,7 +3650,7 @@ class PlaybackManager {
|
|||
|
||||
percent /= 100;
|
||||
ticks *= percent;
|
||||
this.seek(parseInt(ticks), player);
|
||||
this.seek(parseInt(ticks, 10), player);
|
||||
}
|
||||
|
||||
seekMs(ms, player = this._currentPlayer) {
|
||||
|
@ -4036,13 +4037,13 @@ class PlaybackManager {
|
|||
this.setBrightness(cmd.Arguments.Brightness, player);
|
||||
break;
|
||||
case 'SetAudioStreamIndex':
|
||||
this.setAudioStreamIndex(parseInt(cmd.Arguments.Index), player);
|
||||
this.setAudioStreamIndex(parseInt(cmd.Arguments.Index, 10), player);
|
||||
break;
|
||||
case 'SetSubtitleStreamIndex':
|
||||
this.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index), player);
|
||||
this.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index, 10), player);
|
||||
break;
|
||||
case 'SetMaxStreamingBitrate':
|
||||
this.setMaxStreamingBitrate(parseInt(cmd.Arguments.Bitrate), player);
|
||||
this.setMaxStreamingBitrate(parseInt(cmd.Arguments.Bitrate, 10), player);
|
||||
break;
|
||||
case 'ToggleFullscreen':
|
||||
this.toggleFullscreen(player);
|
||||
|
|
|
@ -43,7 +43,7 @@ function showQualityMenu(player, btn) {
|
|||
items: menuItems,
|
||||
positionTo: btn
|
||||
}).then(function (id) {
|
||||
const bitrate = parseInt(id);
|
||||
const bitrate = parseInt(id, 10);
|
||||
if (bitrate !== selectedBitrate) {
|
||||
playbackManager.setMaxStreamingBitrate({
|
||||
enableAutomaticBitrateDetection: bitrate ? false : true,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*eslint prefer-const: "error"*/
|
||||
import { randomInt } from '../../utils/number.ts';
|
||||
|
||||
let currentId = 0;
|
||||
function addUniquePlaylistItemId(item) {
|
||||
|
@ -58,7 +58,7 @@ class PlayQueueManager {
|
|||
const currentPlaylistItem = this._playlist.splice(this.getCurrentPlaylistIndex(), 1)[0];
|
||||
|
||||
for (let i = this._playlist.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * i);
|
||||
const j = randomInt(0, i - 1);
|
||||
const temp = this._playlist[i];
|
||||
this._playlist[i] = this._playlist[j];
|
||||
this._playlist[j] = temp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue