1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge remote-tracking branch 'upstream/master' into exit_on_back2

Conflicts:
	src/components/apphost.js
This commit is contained in:
Dmitry Lyzo 2020-01-27 17:47:19 +03:00
commit ddf7eae55b
136 changed files with 4985 additions and 2523 deletions

View file

@ -168,23 +168,25 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function (appSet
return false;
}
var savedResult = appSettings.get(htmlMediaAutoplayAppStorageKey);
return "true" === savedResult || "false" !== savedResult && null;
return true;
}
function cueSupported() {
function supportsCue() {
try {
var video = document.createElement("video");
var style = document.createElement("style");
style.textContent = "video::cue {background: inherit}";
document.body.appendChild(style);
document.body.appendChild(video);
var cue = window.getComputedStyle(video, "::cue").background;
document.body.removeChild(style);
document.body.removeChild(video);
return !!cue.length;
} catch (err) {
console.log("Error detecting cue support:" + err);
console.log("error detecting cue support: " + err);
return false;
}
}
@ -204,8 +206,6 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function (appSet
}
}
var htmlMediaAutoplayAppStorageKey = "supportshtmlmediaautoplay0";
var supportedFeatures = function () {
var features = [];
@ -280,7 +280,7 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function (appSet
//features.push("multiserver");
features.push("screensaver");
if (!browser.orsay && !browser.tizen && !browser.msie && (browser.firefox || browser.ps4 || browser.edge || cueSupported())) {
if (!browser.orsay && !browser.tizen && !browser.msie && (browser.firefox || browser.ps4 || browser.edge || supportsCue())) {
features.push("subtitleappearancesettings");
}
@ -299,18 +299,6 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function (appSet
return features;
}();
if (supportedFeatures.indexOf("htmlvideoautoplay") === -1 && supportsHtmlMediaAutoplay() !== false) {
require(["autoPlayDetect"], function (autoPlayDetect) {
autoPlayDetect.supportsHtmlMediaAutoplay().then(function () {
appSettings.set(htmlMediaAutoplayAppStorageKey, "true");
supportedFeatures.push("htmlvideoautoplay");
supportedFeatures.push("htmlaudioautoplay");
}, function () {
appSettings.set(htmlMediaAutoplayAppStorageKey, "false");
});
});
}
/**
* Do exit according to platform
*/
@ -435,7 +423,9 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function (appSet
}
}
};
var doc = self.document;
var isHidden = false;
if (doc) {
if (void 0 !== doc.visibilityState) {
@ -459,8 +449,6 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function (appSet
}
}
var isHidden = false;
if (doc) {
doc.addEventListener(visibilityChange, function () {
if (document[visibilityState]) {