Merge remote-tracking branch 'upstream/master' into modern-osd

This commit is contained in:
MrTimscampi 2020-08-30 13:41:17 +02:00
commit 4fcf7f1805
18 changed files with 81 additions and 57 deletions

View File

@ -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"
},
"dependencies": {
"alameda": "^1.4.0",
@ -79,7 +79,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"
},

View File

@ -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;
});

View File

@ -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() {

View File

@ -1618,11 +1618,7 @@ class PlaybackManager {
player = player || self._currentPlayer;
if (player && !enableLocalPlaylistManagement(player)) {
if (player.isLocalPlayer) {
return player.seek((ticks || 0) / 10000);
} else {
return player.seek(ticks);
}
return player.seek(ticks);
}
changeStream(player, ticks);
@ -1631,11 +1627,7 @@ 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);
}
return player.seekRelative(ticks);
}
const ticks = getCurrentTicks(player) + offsetTicks;
@ -3219,7 +3211,7 @@ class PlaybackManager {
return player.currentTime();
}
return this.getCurrentTicks(player);
return this.getCurrentTicks(player) / 10000;
}
nextItem(player = this._currentPlayer) {

View File

@ -619,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);
}
}

View File

@ -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();

View File

@ -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) {

View File

@ -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

View File

@ -178,7 +178,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);
}

View File

@ -586,7 +586,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);

View 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');
}
})();

View File

@ -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() {

View File

@ -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);

View File

@ -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);

View File

@ -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() {

View File

@ -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) {

View File

@ -222,6 +222,7 @@ function initClient() {
});
require(['mouseManager']);
require(['focusPreventScroll']);
require(['vendorStyles']);
require(['autoFocuser'], function(autoFocuser) {
autoFocuser.enable();
});
@ -655,6 +656,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);

View File

@ -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"
@ -10395,10 +10395,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"
@ -10918,7 +10918,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==
@ -10971,13 +10971,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"
@ -11939,17 +11939,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"