mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge branch master into comic-reader
This commit is contained in:
commit
5c2ec66420
21 changed files with 1894 additions and 1878 deletions
|
@ -52,7 +52,7 @@
|
|||
"stylelint-order": "^4.1.0",
|
||||
"webpack": "^4.44.1",
|
||||
"webpack-merge": "^4.2.2",
|
||||
"webpack-stream": "^5.2.1",
|
||||
"webpack-stream": "^6.0.0",
|
||||
"worker-plugin": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -60,7 +60,7 @@
|
|||
"blurhash": "^1.1.3",
|
||||
"classlist.js": "https://github.com/eligrey/classList.js/archive/1.2.20180112.tar.gz",
|
||||
"core-js": "^3.6.5",
|
||||
"date-fns": "^2.15.0",
|
||||
"date-fns": "^2.16.0",
|
||||
"epubjs": "^0.3.85",
|
||||
"fast-text-encoding": "^1.0.3",
|
||||
"flv.js": "^1.5.0",
|
||||
|
@ -81,7 +81,7 @@
|
|||
"resize-observer-polyfill": "^1.5.1",
|
||||
"screenfull": "^5.0.2",
|
||||
"sortablejs": "^1.10.2",
|
||||
"swiper": "^5.4.5",
|
||||
"swiper": "^6.1.1",
|
||||
"webcomponents.js": "^0.7.24",
|
||||
"whatwg-fetch": "^3.4.0"
|
||||
},
|
||||
|
|
|
@ -248,8 +248,6 @@
|
|||
}
|
||||
|
||||
@media all and (max-width: 30em) {
|
||||
.btnFastForward,
|
||||
.btnRewind,
|
||||
.osdMediaInfo,
|
||||
.osdPoster {
|
||||
display: none !important;
|
||||
|
|
|
@ -60,8 +60,8 @@ _define('resize-observer-polyfill', function() {
|
|||
});
|
||||
|
||||
// swiper
|
||||
const swiper = require('swiper/js/swiper');
|
||||
require('swiper/css/swiper.min.css');
|
||||
const swiper = require('swiper/swiper-bundle');
|
||||
require('swiper/swiper-bundle.css');
|
||||
_define('swiper', function() {
|
||||
return swiper;
|
||||
});
|
||||
|
|
|
@ -701,7 +701,7 @@ import 'emby-ratingbutton';
|
|||
|
||||
const player = this;
|
||||
currentRuntimeTicks = playbackManager.duration(player);
|
||||
updateTimeDisplay(playbackManager.currentTime(player), currentRuntimeTicks, playbackManager.getBufferedRanges(player));
|
||||
updateTimeDisplay(playbackManager.currentTime(player) * 10000, currentRuntimeTicks, playbackManager.getBufferedRanges(player));
|
||||
}
|
||||
|
||||
function releaseCurrentPlayer() {
|
||||
|
|
|
@ -1618,12 +1618,8 @@ class PlaybackManager {
|
|||
|
||||
player = player || self._currentPlayer;
|
||||
if (player && !enableLocalPlaylistManagement(player)) {
|
||||
if (player.isLocalPlayer) {
|
||||
return player.seek((ticks || 0) / 10000);
|
||||
} else {
|
||||
return player.seek(ticks);
|
||||
}
|
||||
}
|
||||
|
||||
changeStream(player, ticks);
|
||||
};
|
||||
|
@ -1631,12 +1627,8 @@ class PlaybackManager {
|
|||
self.seekRelative = function (offsetTicks, player) {
|
||||
player = player || self._currentPlayer;
|
||||
if (player && !enableLocalPlaylistManagement(player) && player.seekRelative) {
|
||||
if (player.isLocalPlayer) {
|
||||
return player.seekRelative((ticks || 0) / 10000);
|
||||
} else {
|
||||
return player.seekRelative(ticks);
|
||||
}
|
||||
}
|
||||
|
||||
const ticks = getCurrentTicks(player) + offsetTicks;
|
||||
return this.seek(ticks, player);
|
||||
|
@ -3219,7 +3211,7 @@ class PlaybackManager {
|
|||
return player.currentTime();
|
||||
}
|
||||
|
||||
return this.getCurrentTicks(player);
|
||||
return this.getCurrentTicks(player) / 10000;
|
||||
}
|
||||
|
||||
nextItem(player = this._currentPlayer) {
|
||||
|
|
|
@ -222,18 +222,10 @@
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
.layout-mobile .nowPlayingSecondaryButtons .btnShuffleQueue {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layout-mobile .nowPlayingSecondaryButtons .volumecontrol {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layout-mobile .nowPlayingSecondaryButtons .btnRepeat {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layout-desktop .nowPlayingInfoButtons .btnRepeat,
|
||||
.layout-tv .nowPlayingInfoButtons .btnRepeat {
|
||||
display: none;
|
||||
|
@ -362,7 +354,8 @@
|
|||
border-radius: 0;
|
||||
}
|
||||
|
||||
.nowPlayingInfoButtons .btnRepeat {
|
||||
.nowPlayingInfoButtons .btnRepeat,
|
||||
.nowPlayingInfoButtons .btnRewind {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
margin-left: 0;
|
||||
|
@ -370,7 +363,8 @@
|
|||
font-size: smaller;
|
||||
}
|
||||
|
||||
.nowPlayingInfoButtons .btnShuffleQueue {
|
||||
.nowPlayingInfoButtons .btnShuffleQueue,
|
||||
.nowPlayingInfoButtons .btnFastForward {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin-right: 0;
|
||||
|
@ -468,7 +462,6 @@
|
|||
}
|
||||
|
||||
@media all and (max-width: 63em) {
|
||||
.nowPlayingSecondaryButtons .repeatToggleButton,
|
||||
.nowPlayingInfoButtons .playlist .listItemMediaInfo,
|
||||
.nowPlayingInfoButtons .btnStop {
|
||||
display: none !important;
|
||||
|
|
|
@ -134,7 +134,7 @@ function imageUrl(item, options) {
|
|||
function updateNowPlayingInfo(context, state, serverId) {
|
||||
const item = state.NowPlayingItem;
|
||||
const displayName = item ? getNowPlayingNameHtml(item).replace('<br/>', ' - ') : '';
|
||||
if (typeof item !== 'undefined') {
|
||||
if (item) {
|
||||
const nowPlayingServerId = (item.ServerId || serverId);
|
||||
if (item.Type == 'Audio' || item.MediaStreams[0].Type == 'Audio') {
|
||||
const songName = item.Name;
|
||||
|
@ -192,11 +192,11 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
context.querySelector('.nowPlayingPageTitle').classList.add('hide');
|
||||
}
|
||||
|
||||
const url = item ? seriesImageUrl(item, {
|
||||
const url = seriesImageUrl(item, {
|
||||
maxHeight: 300
|
||||
}) || imageUrl(item, {
|
||||
maxHeight: 300
|
||||
}) : null;
|
||||
});
|
||||
|
||||
let contextButton = context.querySelector('.btnToggleContextMenu');
|
||||
// We remove the previous event listener by replacing the item in each update event
|
||||
|
@ -228,7 +228,6 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
});
|
||||
});
|
||||
setImageUrl(context, state, url);
|
||||
if (item) {
|
||||
backdrop.setBackdrops([item]);
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), item.Id).then(function (fullItem) {
|
||||
const userData = fullItem.UserData || {};
|
||||
|
@ -240,7 +239,6 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
backdrop.clearBackdrop();
|
||||
context.querySelector('.nowPlayingPageUserDataButtons').innerHTML = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setImageUrl(context, state, url) {
|
||||
|
@ -332,8 +330,14 @@ export default function () {
|
|||
buttonVisible(context.querySelector('.btnNextTrack'), item != null);
|
||||
buttonVisible(context.querySelector('.btnPreviousTrack'), item != null);
|
||||
if (layoutManager.mobile) {
|
||||
buttonVisible(context.querySelector('.btnRewind'), false);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), false);
|
||||
const playingVideo = playbackManager.isPlayingVideo() && item !== null;
|
||||
const playingAudio = !playbackManager.isPlayingVideo() && item !== null;
|
||||
buttonVisible(context.querySelector('.btnRepeat'), playingAudio);
|
||||
buttonVisible(context.querySelector('.btnShuffleQueue'), playingAudio);
|
||||
buttonVisible(context.querySelector('.btnRewind'), playingVideo);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), playingVideo);
|
||||
buttonVisible(context.querySelector('.nowPlayingSecondaryButtons .btnShuffleQueue'), playingVideo);
|
||||
buttonVisible(context.querySelector('.nowPlayingSecondaryButtons .btnRepeat'), playingVideo);
|
||||
} else {
|
||||
buttonVisible(context.querySelector('.btnRewind'), item != null);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), item != null);
|
||||
|
@ -615,7 +619,7 @@ export default function () {
|
|||
lastUpdateTime = now;
|
||||
const player = this;
|
||||
currentRuntimeTicks = playbackManager.duration(player);
|
||||
updateTimeDisplay(playbackManager.currentTime(player), currentRuntimeTicks);
|
||||
updateTimeDisplay(playbackManager.currentTime(player) * 10000, currentRuntimeTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
});
|
||||
}
|
||||
|
||||
window.addEventListener('notificationclick', function (event) {
|
||||
/* eslint-disable-next-line no-restricted-globals -- self is valid in a serviceworker environment */
|
||||
self.addEventListener('notificationclick', function (event) {
|
||||
var notification = event.notification;
|
||||
notification.close();
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ export default function (options) {
|
|||
/**
|
||||
* Handles zoom changes.
|
||||
*/
|
||||
function onZoomChange(scale, imageEl, slideEl) {
|
||||
function onZoomChange(swiper, scale, imageEl, slideEl) {
|
||||
const zoomImage = slideEl.querySelector('.swiper-zoom-fakeimg');
|
||||
|
||||
if (zoomImage) {
|
||||
|
|
|
@ -741,7 +741,7 @@ class SyncPlayManager {
|
|||
|
||||
const playAtTime = this.lastCommand.When;
|
||||
|
||||
const currentPositionTicks = playbackManager.currentTime();
|
||||
const currentPositionTicks = playbackManager.currentTime() * 10000;
|
||||
// Estimate PositionTicks on server
|
||||
const serverPositionTicks = this.lastCommand.PositionTicks + ((currentTime - playAtTime) + this.timeOffsetWithServer) * 10000;
|
||||
// Measure delay that needs to be recovered
|
||||
|
|
|
@ -256,7 +256,7 @@ import 'flexStyles';
|
|||
const runtimeTicks = playbackManager.duration(options.player);
|
||||
|
||||
if (runtimeTicks) {
|
||||
const timeRemainingTicks = runtimeTicks - playbackManager.currentTime(options.player);
|
||||
const timeRemainingTicks = runtimeTicks - playbackManager.currentTime(options.player) * 10000;
|
||||
|
||||
return Math.round(timeRemainingTicks / 10000);
|
||||
}
|
||||
|
|
|
@ -29,9 +29,7 @@ import 'emby-ratingbutton';
|
|||
import 'emby-scroller';
|
||||
import 'emby-select';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function getPromise(apiClient, params) {
|
||||
function getPromise(apiClient, params) {
|
||||
const id = params.id;
|
||||
|
||||
if (id) {
|
||||
|
@ -55,9 +53,9 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
throw new Error('Invalid request');
|
||||
}
|
||||
}
|
||||
|
||||
function hideAll(page, className, show) {
|
||||
function hideAll(page, className, show) {
|
||||
for (const elem of page.querySelectorAll('.' + className)) {
|
||||
if (show) {
|
||||
elem.classList.remove('hide');
|
||||
|
@ -65,9 +63,9 @@ import 'emby-select';
|
|||
elem.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getContextMenuOptions(item, user, button) {
|
||||
function getContextMenuOptions(item, user, button) {
|
||||
return {
|
||||
item: item,
|
||||
open: false,
|
||||
|
@ -83,9 +81,9 @@ import 'emby-select';
|
|||
user: user,
|
||||
share: true
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function getProgramScheduleHtml(items) {
|
||||
function getProgramScheduleHtml(items) {
|
||||
let html = '';
|
||||
|
||||
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-list" data-contextmenu="false">';
|
||||
|
@ -105,9 +103,9 @@ import 'emby-select';
|
|||
html += '</div>';
|
||||
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
||||
function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
|
||||
function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
|
||||
apiClient.getLiveTvTimers({
|
||||
UserId: apiClient.getCurrentUserId(),
|
||||
ImageTypeLimit: 1,
|
||||
|
@ -127,23 +125,23 @@ import 'emby-select';
|
|||
scheduleTab.innerHTML = html;
|
||||
imageLoader.lazyChildren(scheduleTab);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderTimerEditor(page, item, apiClient, user) {
|
||||
function renderTimerEditor(page, item, apiClient, user) {
|
||||
if (item.Type !== 'Recording' || !user.Policy.EnableLiveTvManagement || !item.TimerId || item.Status !== 'InProgress') {
|
||||
return void hideAll(page, 'btnCancelTimer');
|
||||
}
|
||||
|
||||
hideAll(page, 'btnCancelTimer', true);
|
||||
}
|
||||
}
|
||||
|
||||
function renderSeriesTimerEditor(page, item, apiClient, user) {
|
||||
function renderSeriesTimerEditor(page, item, apiClient, user) {
|
||||
if (item.Type !== 'SeriesTimer') {
|
||||
return void hideAll(page, 'btnCancelSeriesTimer');
|
||||
}
|
||||
|
||||
if (user.Policy.EnableLiveTvManagement) {
|
||||
import('seriesRecordingEditor').then(({default: seriesRecordingEditor}) => {
|
||||
import('seriesRecordingEditor').then(({ default: seriesRecordingEditor }) => {
|
||||
seriesRecordingEditor.embed(item, apiClient.serverId(), {
|
||||
context: page.querySelector('.seriesRecordingEditor')
|
||||
});
|
||||
|
@ -156,9 +154,9 @@ import 'emby-select';
|
|||
|
||||
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
|
||||
return void hideAll(page, 'btnCancelSeriesTimer');
|
||||
}
|
||||
}
|
||||
|
||||
function renderTrackSelections(page, instance, item, forceReload) {
|
||||
function renderTrackSelections(page, instance, item, forceReload) {
|
||||
const select = page.querySelector('.selectSource');
|
||||
|
||||
if (!item.MediaSources || !itemHelper.supportsMediaSourceSelection(item) || playbackManager.getSupportedCommands().indexOf('PlayMediaSource') === -1 || !playbackManager.canPlay(item)) {
|
||||
|
@ -195,9 +193,9 @@ import 'emby-select';
|
|||
renderAudioSelections(page, mediaSources);
|
||||
renderSubtitleSelections(page, mediaSources);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderVideoSelections(page, mediaSources) {
|
||||
function renderVideoSelections(page, mediaSources) {
|
||||
const mediaSourceId = page.querySelector('.selectSource').value;
|
||||
const mediaSource = mediaSources.filter(function (m) {
|
||||
return m.Id === mediaSourceId;
|
||||
|
@ -232,9 +230,9 @@ import 'emby-select';
|
|||
} else {
|
||||
page.querySelector('.selectVideoContainer').classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderAudioSelections(page, mediaSources) {
|
||||
function renderAudioSelections(page, mediaSources) {
|
||||
const mediaSourceId = page.querySelector('.selectSource').value;
|
||||
const mediaSource = mediaSources.filter(function (m) {
|
||||
return m.Id === mediaSourceId;
|
||||
|
@ -261,9 +259,9 @@ import 'emby-select';
|
|||
} else {
|
||||
page.querySelector('.selectAudioContainer').classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderSubtitleSelections(page, mediaSources) {
|
||||
function renderSubtitleSelections(page, mediaSources) {
|
||||
const mediaSourceId = page.querySelector('.selectSource').value;
|
||||
const mediaSource = mediaSources.filter(function (m) {
|
||||
return m.Id === mediaSourceId;
|
||||
|
@ -298,9 +296,9 @@ import 'emby-select';
|
|||
select.innerHTML = '';
|
||||
page.querySelector('.selectSubtitlesContainer').classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reloadPlayButtons(page, item) {
|
||||
function reloadPlayButtons(page, item) {
|
||||
let canPlay = false;
|
||||
|
||||
if (item.Type == 'Program') {
|
||||
|
@ -340,9 +338,9 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
return canPlay;
|
||||
}
|
||||
}
|
||||
|
||||
function reloadUserDataButtons(page, item) {
|
||||
function reloadUserDataButtons(page, item) {
|
||||
let i;
|
||||
let length;
|
||||
const btnPlaystates = page.querySelectorAll('.btnPlaystate');
|
||||
|
@ -372,9 +370,9 @@ import 'emby-select';
|
|||
btnUserRating.setItem(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getArtistLinksHtml(artists, serverId, context) {
|
||||
function getArtistLinksHtml(artists, serverId, context) {
|
||||
const html = [];
|
||||
|
||||
for (const artist of artists) {
|
||||
|
@ -387,15 +385,15 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
return html.join(' / ');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Renders the item's name block
|
||||
* @param {Object} item - Item used to render the name.
|
||||
* @param {HTMLDivElement} container - Container to render the information into.
|
||||
* @param {Object} context - Application context.
|
||||
*/
|
||||
function renderName(item, container, context) {
|
||||
function renderName(item, container, context) {
|
||||
let parentRoute;
|
||||
const parentNameHtml = [];
|
||||
let parentNameLast = false;
|
||||
|
@ -505,25 +503,25 @@ import 'emby-select';
|
|||
} else {
|
||||
container.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setTrailerButtonVisibility(page, item) {
|
||||
function setTrailerButtonVisibility(page, item) {
|
||||
if ((item.LocalTrailerCount || item.RemoteTrailers && item.RemoteTrailers.length) && playbackManager.getSupportedCommands().indexOf('PlayTrailers') !== -1) {
|
||||
hideAll(page, 'btnPlayTrailer', true);
|
||||
} else {
|
||||
hideAll(page, 'btnPlayTrailer');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderBackdrop(item) {
|
||||
function renderBackdrop(item) {
|
||||
if (dom.getWindowSize().innerWidth >= 1000) {
|
||||
backdrop.setBackdrops([item]);
|
||||
} else {
|
||||
backdrop.clearBackdrop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderDetailPageBackdrop(page, item, apiClient) {
|
||||
function renderDetailPageBackdrop(page, item, apiClient) {
|
||||
let imgUrl;
|
||||
let hasbackdrop = false;
|
||||
const itemBackdropElement = page.querySelector('#itemBackdrop');
|
||||
|
@ -563,9 +561,9 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
return hasbackdrop;
|
||||
}
|
||||
}
|
||||
|
||||
function reloadFromItem(instance, page, params, item, user) {
|
||||
function reloadFromItem(instance, page, params, item, user) {
|
||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
|
||||
Emby.Page.setTitle('');
|
||||
|
@ -663,12 +661,12 @@ import 'emby-select';
|
|||
hideAll(page, 'btnDownload', true);
|
||||
}
|
||||
|
||||
import('autoFocuser').then(({default: autoFocuser}) => {
|
||||
import('autoFocuser').then(({ default: autoFocuser }) => {
|
||||
autoFocuser.autoFocus(page);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function logoImageUrl(item, apiClient, options) {
|
||||
function logoImageUrl(item, apiClient, options) {
|
||||
options = options || {};
|
||||
options.type = 'Logo';
|
||||
|
||||
|
@ -683,9 +681,9 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function renderLogo(page, item, apiClient) {
|
||||
function renderLogo(page, item, apiClient) {
|
||||
const detailLogo = page.querySelector('.detailLogo');
|
||||
|
||||
const url = logoImageUrl(item, apiClient, {});
|
||||
|
@ -698,14 +696,14 @@ import 'emby-select';
|
|||
} else {
|
||||
detailLogo.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showRecordingFields(instance, page, item, user) {
|
||||
function showRecordingFields(instance, page, item, user) {
|
||||
if (!instance.currentRecordingFields) {
|
||||
const recordingFieldsElement = page.querySelector('.recordingFields');
|
||||
|
||||
if (item.Type == 'Program' && user.Policy.EnableLiveTvManagement) {
|
||||
import('recordingFields').then(({default: recordingFields}) => {
|
||||
import('recordingFields').then(({ default: recordingFields }) => {
|
||||
instance.currentRecordingFields = new recordingFields({
|
||||
parent: recordingFieldsElement,
|
||||
programId: item.Id,
|
||||
|
@ -718,9 +716,9 @@ import 'emby-select';
|
|||
recordingFieldsElement.innerHTML = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderLinks(page, item) {
|
||||
function renderLinks(page, item) {
|
||||
const externalLinksElem = page.querySelector('.itemExternalLinks');
|
||||
|
||||
const links = [];
|
||||
|
@ -747,9 +745,9 @@ import 'emby-select';
|
|||
} else {
|
||||
externalLinksElem.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderDetailImage(elem, item, imageLoader) {
|
||||
function renderDetailImage(elem, item, imageLoader) {
|
||||
const itemArray = [];
|
||||
itemArray.push(item);
|
||||
const cardHtml = cardBuilder.getCardsHtml(itemArray, {
|
||||
|
@ -766,33 +764,33 @@ import 'emby-select';
|
|||
|
||||
elem.innerHTML = cardHtml;
|
||||
imageLoader.lazyChildren(elem);
|
||||
}
|
||||
}
|
||||
|
||||
function renderImage(page, item) {
|
||||
function renderImage(page, item) {
|
||||
renderDetailImage(
|
||||
page.querySelector('.detailImageContainer'),
|
||||
item,
|
||||
imageLoader
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function refreshDetailImageUserData(elem, item) {
|
||||
function refreshDetailImageUserData(elem, item) {
|
||||
elem.querySelector('.detailImageProgressContainer').innerHTML = indicators.getProgressBarHtml(item);
|
||||
}
|
||||
}
|
||||
|
||||
function refreshImage(page, item) {
|
||||
function refreshImage(page, item) {
|
||||
refreshDetailImageUserData(page.querySelector('.detailImageContainer'), item);
|
||||
}
|
||||
}
|
||||
|
||||
function setPeopleHeader(page, item) {
|
||||
function setPeopleHeader(page, item) {
|
||||
if (item.MediaType == 'Audio' || item.Type == 'MusicAlbum' || item.MediaType == 'Book' || item.MediaType == 'Photo') {
|
||||
page.querySelector('#peopleHeader').innerHTML = globalize.translate('People');
|
||||
} else {
|
||||
page.querySelector('#peopleHeader').innerHTML = globalize.translate('HeaderCastAndCrew');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderNextUp(page, item, user) {
|
||||
function renderNextUp(page, item, user) {
|
||||
const section = page.querySelector('.nextUpSection');
|
||||
|
||||
if (item.Type != 'Series') {
|
||||
|
@ -822,9 +820,9 @@ import 'emby-select';
|
|||
itemsContainer.innerHTML = html;
|
||||
imageLoader.lazyChildren(itemsContainer);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function setInitialCollapsibleState(page, item, apiClient, context, user) {
|
||||
function setInitialCollapsibleState(page, item, apiClient, context, user) {
|
||||
page.querySelector('.collectionItems').innerHTML = '';
|
||||
|
||||
if (item.Type == 'Playlist') {
|
||||
|
@ -873,9 +871,9 @@ import 'emby-select';
|
|||
} else {
|
||||
page.querySelector('#musicVideosCollapsible').classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function toggleLineClamp(clampTarget, e) {
|
||||
function toggleLineClamp(clampTarget, e) {
|
||||
const expandButton = e.target;
|
||||
const clampClassName = 'detail-clamp-text';
|
||||
|
||||
|
@ -886,9 +884,9 @@ import 'emby-select';
|
|||
clampTarget.classList.add(clampClassName);
|
||||
expandButton.innerHTML = globalize.translate('ShowMore');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderOverview(page, item) {
|
||||
function renderOverview(page, item) {
|
||||
for (const overviewElemnt of page.querySelectorAll('.overview')) {
|
||||
const overview = item.Overview || '';
|
||||
|
||||
|
@ -918,9 +916,9 @@ import 'emby-select';
|
|||
overviewElemnt.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderGenres(page, item, context = inferContext(item)) {
|
||||
function renderGenres(page, item, context = inferContext(item)) {
|
||||
const genres = item.GenreItems || [];
|
||||
const type = context === 'music' ? 'MusicGenre' : 'Genre';
|
||||
|
||||
|
@ -946,9 +944,9 @@ import 'emby-select';
|
|||
} else {
|
||||
genresGroup.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderWriter(page, item, context) {
|
||||
function renderWriter(page, item, context) {
|
||||
const writers = (item.People || []).filter(function (person) {
|
||||
return person.Type === 'Writer';
|
||||
});
|
||||
|
@ -975,9 +973,9 @@ import 'emby-select';
|
|||
} else {
|
||||
writersGroup.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderDirector(page, item, context) {
|
||||
function renderDirector(page, item, context) {
|
||||
const directors = (item.People || []).filter(function (person) {
|
||||
return person.Type === 'Director';
|
||||
});
|
||||
|
@ -1004,9 +1002,9 @@ import 'emby-select';
|
|||
} else {
|
||||
directorsGroup.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderMiscInfo(page, item) {
|
||||
function renderMiscInfo(page, item) {
|
||||
const primaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-primary');
|
||||
|
||||
for (const miscInfo of primaryItemMiscInfo) {
|
||||
|
@ -1036,9 +1034,9 @@ import 'emby-select';
|
|||
miscInfo.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderTagline(page, item) {
|
||||
function renderTagline(page, item) {
|
||||
const taglineElement = page.querySelector('.tagline');
|
||||
|
||||
if (item.Taglines && item.Taglines.length) {
|
||||
|
@ -1047,9 +1045,9 @@ import 'emby-select';
|
|||
} else {
|
||||
taglineElement.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderDetails(page, item, apiClient, context, isStatic) {
|
||||
function renderDetails(page, item, apiClient, context, isStatic) {
|
||||
renderSimilarItems(page, item, context);
|
||||
renderMoreFromSeason(page, item, apiClient);
|
||||
renderMoreFromArtist(page, item, apiClient);
|
||||
|
@ -1064,29 +1062,29 @@ import 'emby-select';
|
|||
renderLinks(page, item);
|
||||
renderTags(page, item);
|
||||
renderSeriesAirTime(page, item, isStatic);
|
||||
}
|
||||
}
|
||||
|
||||
function enableScrollX() {
|
||||
function enableScrollX() {
|
||||
return browser.mobile && window.screen.availWidth <= 1000;
|
||||
}
|
||||
}
|
||||
|
||||
function getPortraitShape(scrollX) {
|
||||
function getPortraitShape(scrollX) {
|
||||
if (scrollX == null) {
|
||||
scrollX = enableScrollX();
|
||||
}
|
||||
|
||||
return scrollX ? 'overflowPortrait' : 'portrait';
|
||||
}
|
||||
}
|
||||
|
||||
function getSquareShape(scrollX) {
|
||||
function getSquareShape(scrollX) {
|
||||
if (scrollX == null) {
|
||||
scrollX = enableScrollX();
|
||||
}
|
||||
|
||||
return scrollX ? 'overflowSquare' : 'square';
|
||||
}
|
||||
}
|
||||
|
||||
function renderMoreFromSeason(view, item, apiClient) {
|
||||
function renderMoreFromSeason(view, item, apiClient) {
|
||||
const section = view.querySelector('.moreFromSeasonSection');
|
||||
|
||||
if (section) {
|
||||
|
@ -1128,9 +1126,9 @@ import 'emby-select';
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderMoreFromArtist(view, item, apiClient) {
|
||||
function renderMoreFromArtist(view, item, apiClient) {
|
||||
const section = view.querySelector('.moreFromArtistSection');
|
||||
|
||||
if (section) {
|
||||
|
@ -1187,9 +1185,9 @@ import 'emby-select';
|
|||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderSimilarItems(page, item, context) {
|
||||
function renderSimilarItems(page, item, context) {
|
||||
const similarCollapsible = page.querySelector('#similarCollapsible');
|
||||
|
||||
if (similarCollapsible) {
|
||||
|
@ -1235,9 +1233,9 @@ import 'emby-select';
|
|||
imageLoader.lazyChildren(similarContent);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderSeriesAirTime(page, item, isStatic) {
|
||||
function renderSeriesAirTime(page, item, isStatic) {
|
||||
const seriesAirTime = page.querySelector('#seriesAirTime');
|
||||
if (item.Type != 'Series') {
|
||||
seriesAirTime.classList.add('hide');
|
||||
|
@ -1276,9 +1274,9 @@ import 'emby-select';
|
|||
} else {
|
||||
seriesAirTime.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderTags(page, item) {
|
||||
function renderTags(page, item) {
|
||||
const itemTags = page.querySelector('.itemTags');
|
||||
const tagElements = [];
|
||||
let tags = item.Tags || [];
|
||||
|
@ -1298,9 +1296,9 @@ import 'emby-select';
|
|||
itemTags.innerHTML = '';
|
||||
itemTags.classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderChildren(page, item) {
|
||||
function renderChildren(page, item) {
|
||||
let fields = 'ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount';
|
||||
const query = {
|
||||
ParentId: item.Id,
|
||||
|
@ -1462,21 +1460,21 @@ import 'emby-select';
|
|||
} else {
|
||||
page.querySelector('.childrenSectionHeader').classList.remove('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderItemsByName(page, item) {
|
||||
function renderItemsByName(page, item) {
|
||||
import('scripts/itembynamedetailpage').then(() => {
|
||||
window.ItemsByName.renderItems(page, item);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderPlaylistItems(page, item) {
|
||||
function renderPlaylistItems(page, item) {
|
||||
import('scripts/playlistedit').then(() => {
|
||||
PlaylistViewer.render(page, item);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderProgramsForChannel(page, result) {
|
||||
function renderProgramsForChannel(page, result) {
|
||||
let html = '';
|
||||
let currentItems = [];
|
||||
let currentStartDate = null;
|
||||
|
@ -1530,9 +1528,9 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
page.querySelector('.programGuide').innerHTML = html;
|
||||
}
|
||||
}
|
||||
|
||||
function renderChannelGuide(page, apiClient, item) {
|
||||
function renderChannelGuide(page, apiClient, item) {
|
||||
if (item.Type === 'TvChannel') {
|
||||
page.querySelector('.programGuideSection').classList.remove('hide');
|
||||
apiClient.getLiveTvPrograms({
|
||||
|
@ -1548,9 +1546,9 @@ import 'emby-select';
|
|||
renderProgramsForChannel(page, result);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderSeriesSchedule(page, item) {
|
||||
function renderSeriesSchedule(page, item) {
|
||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
apiClient.getLiveTvPrograms({
|
||||
UserId: apiClient.getCurrentUserId(),
|
||||
|
@ -1582,9 +1580,9 @@ import 'emby-select';
|
|||
});
|
||||
loading.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function inferContext(item) {
|
||||
function inferContext(item) {
|
||||
if (item.Type === 'Movie' || item.Type === 'BoxSet') {
|
||||
return 'movies';
|
||||
}
|
||||
|
@ -1602,9 +1600,9 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function filterItemsByCollectionItemType(items, typeInfo) {
|
||||
function filterItemsByCollectionItemType(items, typeInfo) {
|
||||
return items.filter(function (item) {
|
||||
if (typeInfo.mediaType) {
|
||||
return item.MediaType == typeInfo.mediaType;
|
||||
|
@ -1612,9 +1610,9 @@ import 'emby-select';
|
|||
|
||||
return item.Type == typeInfo.type;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function canPlaySomeItemInCollection(items) {
|
||||
function canPlaySomeItemInCollection(items) {
|
||||
let i = 0;
|
||||
|
||||
for (let length = items.length; i < length; i++) {
|
||||
|
@ -1624,9 +1622,9 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function renderCollectionItems(page, parentItem, types, items) {
|
||||
function renderCollectionItems(page, parentItem, types, items) {
|
||||
page.querySelector('.collectionItems').classList.remove('hide');
|
||||
page.querySelector('.collectionItems').innerHTML = '';
|
||||
|
||||
|
@ -1675,12 +1673,12 @@ import 'emby-select';
|
|||
|
||||
// HACK: Call autoFocuser again because btnPlay may be hidden, but focused by reloadFromItem
|
||||
// FIXME: Sometimes focus does not move until all (?) sections are loaded
|
||||
import('autoFocuser').then(({default: autoFocuser}) => {
|
||||
import('autoFocuser').then(({ default: autoFocuser }) => {
|
||||
autoFocuser.autoFocus(page);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderCollectionItemType(page, parentItem, type, items) {
|
||||
function renderCollectionItemType(page, parentItem, type, items) {
|
||||
let html = '';
|
||||
html += '<div class="verticalSection">';
|
||||
html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">';
|
||||
|
@ -1708,9 +1706,9 @@ import 'emby-select';
|
|||
const collectionItems = page.querySelector('.collectionItems');
|
||||
collectionItems.insertAdjacentHTML('beforeend', html);
|
||||
imageLoader.lazyChildren(collectionItems);
|
||||
}
|
||||
}
|
||||
|
||||
function renderMusicVideos(page, item, user) {
|
||||
function renderMusicVideos(page, item, user) {
|
||||
connectionManager.getApiClient(item.ServerId).getItems(user.Id, {
|
||||
SortBy: 'SortName',
|
||||
SortOrder: 'Ascending',
|
||||
|
@ -1728,9 +1726,9 @@ import 'emby-select';
|
|||
page.querySelector('#musicVideosCollapsible').classList.add('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderAdditionalParts(page, item, user) {
|
||||
function renderAdditionalParts(page, item, user) {
|
||||
connectionManager.getApiClient(item.ServerId).getAdditionalVideoParts(user.Id, item.Id).then(function (result) {
|
||||
if (result.Items.length) {
|
||||
page.querySelector('#additionalPartsCollapsible').classList.remove('hide');
|
||||
|
@ -1741,16 +1739,16 @@ import 'emby-select';
|
|||
page.querySelector('#additionalPartsCollapsible').classList.add('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderScenes(page, item) {
|
||||
function renderScenes(page, item) {
|
||||
let chapters = item.Chapters || [];
|
||||
|
||||
if (chapters.length && !chapters[0].ImageTag && (chapters = []), chapters.length) {
|
||||
page.querySelector('#scenesCollapsible').classList.remove('hide');
|
||||
const scenesContent = page.querySelector('#scenesContent');
|
||||
|
||||
import('chaptercardbuilder').then(({default: chaptercardbuilder}) => {
|
||||
import('chaptercardbuilder').then(({ default: chaptercardbuilder }) => {
|
||||
chaptercardbuilder.buildChapterCards(item, chapters, {
|
||||
itemsContainer: scenesContent,
|
||||
backdropShape: 'overflowBackdrop',
|
||||
|
@ -1761,9 +1759,9 @@ import 'emby-select';
|
|||
} else {
|
||||
page.querySelector('#scenesCollapsible').classList.add('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getVideosHtml(items) {
|
||||
function getVideosHtml(items) {
|
||||
return cardBuilder.getCardsHtml({
|
||||
items: items,
|
||||
shape: 'autooverflow',
|
||||
|
@ -1773,17 +1771,17 @@ import 'emby-select';
|
|||
centerText: true,
|
||||
showRuntime: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderSpecials(page, item, user) {
|
||||
function renderSpecials(page, item, user) {
|
||||
connectionManager.getApiClient(item.ServerId).getSpecialFeatures(user.Id, item.Id).then(function (specials) {
|
||||
const specialsContent = page.querySelector('#specialsContent');
|
||||
specialsContent.innerHTML = getVideosHtml(specials);
|
||||
imageLoader.lazyChildren(specialsContent);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function renderCast(page, item) {
|
||||
function renderCast(page, item) {
|
||||
const people = (item.People || []).filter(function (p) {
|
||||
return p.Type === 'Actor';
|
||||
});
|
||||
|
@ -1795,7 +1793,7 @@ import 'emby-select';
|
|||
page.querySelector('#castCollapsible').classList.remove('hide');
|
||||
const castContent = page.querySelector('#castContent');
|
||||
|
||||
import('peoplecardbuilder').then(({default: peoplecardbuilder}) => {
|
||||
import('peoplecardbuilder').then(({ default: peoplecardbuilder }) => {
|
||||
peoplecardbuilder.buildPeopleCards(people, {
|
||||
itemsContainer: castContent,
|
||||
coverImage: true,
|
||||
|
@ -1804,31 +1802,31 @@ import 'emby-select';
|
|||
imageBlurhashes: item.ImageBlurHashes
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function itemDetailPage() {
|
||||
function itemDetailPage() {
|
||||
const self = this;
|
||||
self.setInitialCollapsibleState = setInitialCollapsibleState;
|
||||
self.renderDetails = renderDetails;
|
||||
self.renderCast = renderCast;
|
||||
}
|
||||
}
|
||||
|
||||
function bindAll(view, selector, eventName, fn) {
|
||||
function bindAll(view, selector, eventName, fn) {
|
||||
const elems = view.querySelectorAll(selector);
|
||||
|
||||
for (const elem of elems) {
|
||||
elem.addEventListener(eventName, fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onTrackSelectionsSubmit(e) {
|
||||
function onTrackSelectionsSubmit(e) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.ItemDetailPage = new itemDetailPage();
|
||||
window.ItemDetailPage = new itemDetailPage();
|
||||
|
||||
export default function (view, params) {
|
||||
export default function (view, params) {
|
||||
function reload(instance, page, params) {
|
||||
loading.show();
|
||||
|
||||
|
@ -1843,7 +1841,7 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
function splitVersions(instance, page, apiClient, params) {
|
||||
import('confirm').then(({default: confirm}) => {
|
||||
import('confirm').then(({ default: confirm }) => {
|
||||
confirm('Are you sure you wish to split the media sources into separate items?', 'Split Media Apart').then(function () {
|
||||
loading.show();
|
||||
apiClient.ajax({
|
||||
|
@ -1909,7 +1907,7 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
function onCancelSeriesTimerClick() {
|
||||
import('recordingHelper').then(({default: recordingHelper}) => {
|
||||
import('recordingHelper').then(({ default: recordingHelper }) => {
|
||||
recordingHelper.cancelSeriesTimerWithConfirmation(currentItem.Id, currentItem.ServerId).then(function () {
|
||||
Dashboard.navigate('livetv.html');
|
||||
});
|
||||
|
@ -1917,7 +1915,7 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
function onCancelTimerClick() {
|
||||
import('recordingHelper').then(({default: recordingHelper}) => {
|
||||
import('recordingHelper').then(({ default: recordingHelper }) => {
|
||||
recordingHelper.cancelTimer(connectionManager.getApiClient(currentItem.ServerId), currentItem.TimerId).then(function () {
|
||||
reload(self, view, params);
|
||||
});
|
||||
|
@ -1929,7 +1927,7 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
function onDownloadClick() {
|
||||
import('fileDownloader').then(({default: fileDownloader}) => {
|
||||
import('fileDownloader').then(({ default: fileDownloader }) => {
|
||||
const downloadHref = apiClient.getItemDownloadUrl(currentItem.Id);
|
||||
fileDownloader.download([{
|
||||
url: downloadHref,
|
||||
|
@ -1940,9 +1938,10 @@ import 'emby-select';
|
|||
}
|
||||
|
||||
function onMoreCommandsClick() {
|
||||
var button = this;
|
||||
var selectedItem = currentItem;
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), view.querySelector('.selectSource').value).then(function (item) {
|
||||
const button = this;
|
||||
let selectedItem = view.querySelector('.selectSource').value || currentItem.Id;
|
||||
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), selectedItem).then(function (item) {
|
||||
selectedItem = item;
|
||||
|
||||
apiClient.getCurrentUser().then(function (user) {
|
||||
|
@ -2029,6 +2028,4 @@ import 'emby-select';
|
|||
self._currentPlaybackMediaSources = null;
|
||||
self.currentRecordingFields = null;
|
||||
});
|
||||
}
|
||||
|
||||
/* eslint-enable indent */
|
||||
}
|
||||
|
|
|
@ -693,7 +693,7 @@ import 'css!assets/css/videoosd';
|
|||
lastUpdateTime = now;
|
||||
const player = this;
|
||||
currentRuntimeTicks = playbackManager.duration(player);
|
||||
const currentTime = playbackManager.currentTime(player);
|
||||
const currentTime = playbackManager.currentTime(player) * 10000;
|
||||
updateTimeDisplay(currentTime, currentRuntimeTicks, playbackManager.playbackStartTime(player), playbackManager.getBufferedRanges(player));
|
||||
const item = currentItem;
|
||||
refreshProgramInfoIfNeeded(player, item);
|
||||
|
|
34
src/legacy/vendorStyles.js
Normal file
34
src/legacy/vendorStyles.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Polyfill for vendor prefixed style properties
|
||||
|
||||
(function () {
|
||||
const vendorProperties = {
|
||||
'transform': ['webkitTransform'],
|
||||
'transition': ['webkitTransition']
|
||||
};
|
||||
|
||||
const elem = document.createElement('div');
|
||||
|
||||
function polyfillProperty(name) {
|
||||
if (!(name in elem.style)) {
|
||||
(vendorProperties[name] || []).every((vendorName) => {
|
||||
if (vendorName in elem.style) {
|
||||
console.debug(`polyfill '${name}' with '${vendorName}'`);
|
||||
|
||||
Object.defineProperty(CSSStyleDeclaration.prototype, name, {
|
||||
get: function () { return this[vendorName]; },
|
||||
set: function (val) { this[vendorName] = val; }
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (elem.style instanceof CSSStyleDeclaration) {
|
||||
polyfillProperty('transform');
|
||||
polyfillProperty('transition');
|
||||
}
|
||||
})();
|
|
@ -931,9 +931,9 @@ class ChromecastPlayer {
|
|||
return state.VolumeLevel == null ? 100 : state.VolumeLevel;
|
||||
}
|
||||
|
||||
isPlaying() {
|
||||
isPlaying(mediaType) {
|
||||
const state = this.lastPlayerData || {};
|
||||
return state.NowPlayingItem != null;
|
||||
return state.NowPlayingItem != null && (state.NowPlayingItem.MediaType === mediaType || !mediaType);
|
||||
}
|
||||
|
||||
isPlayingVideo() {
|
||||
|
@ -950,12 +950,12 @@ class ChromecastPlayer {
|
|||
|
||||
currentTime(val) {
|
||||
if (val != null) {
|
||||
return this.seek(val);
|
||||
return this.seek(val * 10000);
|
||||
}
|
||||
|
||||
let state = this.lastPlayerData || {};
|
||||
state = state.PlayState || {};
|
||||
return state.PositionTicks;
|
||||
return state.PositionTicks / 10000;
|
||||
}
|
||||
|
||||
duration() {
|
||||
|
|
|
@ -132,10 +132,7 @@ class HtmlAudioPlayer {
|
|||
return new Promise(function (resolve, reject) {
|
||||
requireHlsPlayer(function () {
|
||||
const hls = new Hls({
|
||||
manifestLoadingTimeOut: 20000,
|
||||
xhrSetup: function (xhr, url) {
|
||||
xhr.withCredentials = true;
|
||||
}
|
||||
manifestLoadingTimeOut: 20000
|
||||
});
|
||||
hls.loadSource(val);
|
||||
hls.attachMedia(elem);
|
||||
|
|
|
@ -393,10 +393,7 @@ function tryRemoveElement(elem) {
|
|||
return new Promise((resolve, reject) => {
|
||||
requireHlsPlayer(() => {
|
||||
const hls = new Hls({
|
||||
manifestLoadingTimeOut: 20000,
|
||||
xhrSetup(xhr) {
|
||||
xhr.withCredentials = true;
|
||||
}
|
||||
manifestLoadingTimeOut: 20000
|
||||
});
|
||||
hls.loadSource(url);
|
||||
hls.attachMedia(elem);
|
||||
|
|
|
@ -322,12 +322,12 @@ class SessionPlayer {
|
|||
|
||||
currentTime(val) {
|
||||
if (val != null) {
|
||||
return this.seek(val);
|
||||
return this.seek(val * 10000);
|
||||
}
|
||||
|
||||
let state = this.lastPlayerData || {};
|
||||
state = state.PlayState || {};
|
||||
return state.PositionTicks;
|
||||
return state.PositionTicks / 10000;
|
||||
}
|
||||
|
||||
duration() {
|
||||
|
@ -466,9 +466,9 @@ class SessionPlayer {
|
|||
sendCommandByName(this, 'DisplayContent', options);
|
||||
}
|
||||
|
||||
isPlaying() {
|
||||
isPlaying(mediaType) {
|
||||
const state = this.lastPlayerData || {};
|
||||
return state.NowPlayingItem != null;
|
||||
return state.NowPlayingItem != null && (state.NowPlayingItem.MediaType === mediaType || !mediaType);
|
||||
}
|
||||
|
||||
isPlayingVideo() {
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
// Promise() being missing on some legacy browser, and a funky one
|
||||
// is Promise() present but buggy on WebOS 2
|
||||
window.Promise = undefined;
|
||||
window.Promise = undefined;
|
||||
/* eslint-disable-next-line no-restricted-globals -- Explicit check on self needed */
|
||||
self.Promise = undefined;
|
||||
}
|
||||
|
||||
if (!window.Promise) {
|
||||
|
|
|
@ -222,6 +222,7 @@ function initClient() {
|
|||
});
|
||||
require(['mouseManager']);
|
||||
require(['focusPreventScroll']);
|
||||
require(['vendorStyles']);
|
||||
require(['autoFocuser'], function(autoFocuser) {
|
||||
autoFocuser.enable();
|
||||
});
|
||||
|
@ -656,6 +657,7 @@ function initClient() {
|
|||
});
|
||||
define('slideshow', [componentsPath + '/slideshow/slideshow'], returnFirstDependency);
|
||||
define('focusPreventScroll', ['legacy/focusPreventScroll'], returnFirstDependency);
|
||||
define('vendorStyles', ['legacy/vendorStyles'], returnFirstDependency);
|
||||
define('userdataButtons', [componentsPath + '/userdatabuttons/userdatabuttons'], returnFirstDependency);
|
||||
define('listView', [componentsPath + '/listview/listview'], returnFirstDependency);
|
||||
define('indicators', [componentsPath + '/indicators/indicators'], returnFirstDependency);
|
||||
|
|
52
yarn.lock
52
yarn.lock
|
@ -3218,10 +3218,10 @@ dashdash@^1.12.0:
|
|||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
date-fns@^2.15.0:
|
||||
version "2.15.0"
|
||||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.15.0.tgz#424de6b3778e4e69d3ff27046ec136af58ae5d5f"
|
||||
integrity sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ==
|
||||
date-fns@^2.16.0:
|
||||
version "2.16.0"
|
||||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.16.0.tgz#d34f0f5f2fd498c984513042e8f7247ea86c4cb7"
|
||||
integrity sha512-DWTRyfOA85sZ4IiXPHhiRIOs3fW5U6Msrp+gElXARa6EpoQTXPyHQmh7hr+ssw2nx9FtOQWnAMJKgL5vaJqILw==
|
||||
|
||||
dateformat@^2.0.0:
|
||||
version "2.2.0"
|
||||
|
@ -3499,12 +3499,12 @@ dom-serializer@0:
|
|||
domelementtype "^2.0.1"
|
||||
entities "^2.0.0"
|
||||
|
||||
dom7@^2.1.5:
|
||||
version "2.1.5"
|
||||
resolved "https://registry.yarnpkg.com/dom7/-/dom7-2.1.5.tgz#a79411017800b31d8400070cdaebbfc92c1f6377"
|
||||
integrity sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==
|
||||
dom7@^3.0.0-alpha.7:
|
||||
version "3.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/dom7/-/dom7-3.0.0-alpha.7.tgz#3b4ba156a83fa37fb3fa34b8ab40a1a41a56feb1"
|
||||
integrity sha512-3epkQPsKsbk2Dixqqgm2DT/KzhiAPByjDK7emu6owwFLbM5UoiqWKgdsH+6PpMEgoeR6Ex/bW1UbOe0FWZU0zg==
|
||||
dependencies:
|
||||
ssr-window "^2.0.0"
|
||||
ssr-window "^3.0.0-alpha.1"
|
||||
|
||||
domain-browser@^1.1.1:
|
||||
version "1.2.0"
|
||||
|
@ -10400,10 +10400,10 @@ sshpk@^1.7.0:
|
|||
safer-buffer "^2.0.2"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
ssr-window@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-2.0.0.tgz#98c301aef99523317f8d69618f0010791096efc4"
|
||||
integrity sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==
|
||||
ssr-window@^3.0.0-alpha.1, ssr-window@^3.0.0-alpha.4:
|
||||
version "3.0.0-alpha.4"
|
||||
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-3.0.0-alpha.4.tgz#0c69a18c4305ecccdd8e11596155ca07b635f345"
|
||||
integrity sha512-+dBRP/pZ+VyITxTzD0lMDzDwN/BmfUl8xi2e6t5Nz4+FqUphfcBLB1OOUSYCRNFB25rD3c8AJRYpY5rHTbL+kg==
|
||||
|
||||
ssri@^6.0.1:
|
||||
version "6.0.1"
|
||||
|
@ -10923,7 +10923,7 @@ supports-color@^3.2.3:
|
|||
dependencies:
|
||||
has-flag "^1.0.0"
|
||||
|
||||
supports-color@^5.3.0, supports-color@^5.5.0:
|
||||
supports-color@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
|
||||
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
|
||||
|
@ -10976,13 +10976,13 @@ svgo@^1.0.0, svgo@^1.3.2:
|
|||
unquote "~1.1.1"
|
||||
util.promisify "~1.0.0"
|
||||
|
||||
swiper@^5.4.5:
|
||||
version "5.4.5"
|
||||
resolved "https://registry.yarnpkg.com/swiper/-/swiper-5.4.5.tgz#a350f654bf68426dbb651793824925512d223c0f"
|
||||
integrity sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA==
|
||||
swiper@^6.1.1:
|
||||
version "6.1.1"
|
||||
resolved "https://registry.yarnpkg.com/swiper/-/swiper-6.1.1.tgz#1246f28557dd33968dc43e926bc6e9e9a7b3850d"
|
||||
integrity sha512-w6rmEUnpuSWvzuIDJ+nTi7YQ4+pvr++zUnBO2VxkzOZbzQzcMNKNw1yj0RFEok682IHDPCs3LXSl8zSQ+zDEdw==
|
||||
dependencies:
|
||||
dom7 "^2.1.5"
|
||||
ssr-window "^2.0.0"
|
||||
dom7 "^3.0.0-alpha.7"
|
||||
ssr-window "^3.0.0-alpha.4"
|
||||
|
||||
symbol-observable@1.0.1:
|
||||
version "1.0.1"
|
||||
|
@ -11944,17 +11944,17 @@ webpack-sources@^1.4.0, webpack-sources@^1.4.1:
|
|||
source-list-map "^2.0.0"
|
||||
source-map "~0.6.1"
|
||||
|
||||
webpack-stream@^5.2.1:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-5.2.1.tgz#35c992161399fe8cad9c10d4a5c258f022629b39"
|
||||
integrity sha512-WvyVU0K1/VB1NZ7JfsaemVdG0PXAQUqbjUNW4A58th4pULvKMQxG+y33HXTL02JvD56ko2Cub+E2NyPwrLBT/A==
|
||||
webpack-stream@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-6.0.0.tgz#0524b739a3c3a487362ee2e97522d0b8d366a510"
|
||||
integrity sha512-bYv7apmGB1j0JBpa5Fgyky/1mWyzHOnUPXv+RmkgpK4FXPWCMBspgnYFmhE7Ly68JSp77eonFzm6WArWy4afpQ==
|
||||
dependencies:
|
||||
fancy-log "^1.3.3"
|
||||
lodash.clone "^4.3.2"
|
||||
lodash.some "^4.2.2"
|
||||
memory-fs "^0.4.1"
|
||||
memory-fs "^0.5.0"
|
||||
plugin-error "^1.0.1"
|
||||
supports-color "^5.5.0"
|
||||
supports-color "^7.1.0"
|
||||
through "^2.3.8"
|
||||
vinyl "^2.1.0"
|
||||
webpack "^4.26.1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue