mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-16 10:28:18 -07:00
Merge pull request #3643 from dmitrylyzo/fix-tizen5
This commit is contained in:
commit
0895163344
@ -31,6 +31,26 @@ import ServerConnections from '../../components/ServerConnections';
|
|||||||
import profileBuilder from '../../scripts/browserDeviceProfile';
|
import profileBuilder from '../../scripts/browserDeviceProfile';
|
||||||
import { getIncludeCorsCredentials } from '../../scripts/settings/webSettings';
|
import { getIncludeCorsCredentials } from '../../scripts/settings/webSettings';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns resolved URL.
|
||||||
|
* @param {string} url - URL.
|
||||||
|
* @returns {string} Resolved URL or `url` if resolving failed.
|
||||||
|
*/
|
||||||
|
function resolveUrl(url) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open('HEAD', url, true);
|
||||||
|
xhr.onload = function () {
|
||||||
|
resolve(xhr.responseURL || url);
|
||||||
|
};
|
||||||
|
xhr.onerror = function (e) {
|
||||||
|
console.error(e);
|
||||||
|
resolve(url);
|
||||||
|
};
|
||||||
|
xhr.send(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
function tryRemoveElement(elem) {
|
function tryRemoveElement(elem) {
|
||||||
@ -1093,7 +1113,15 @@ function tryRemoveElement(elem) {
|
|||||||
renderAhead: 90
|
renderAhead: 90
|
||||||
};
|
};
|
||||||
import('libass-wasm').then(({default: SubtitlesOctopus}) => {
|
import('libass-wasm').then(({default: SubtitlesOctopus}) => {
|
||||||
apiClient.getNamedConfiguration('encoding').then(config => {
|
Promise.all([
|
||||||
|
apiClient.getNamedConfiguration('encoding'),
|
||||||
|
// Worker in Tizen 5 doesn't resolve relative path with async request
|
||||||
|
resolveUrl(options.workerUrl),
|
||||||
|
resolveUrl(options.legacyWorkerUrl)
|
||||||
|
]).then(([config, workerUrl, legacyWorkerUrl]) => {
|
||||||
|
options.workerUrl = workerUrl;
|
||||||
|
options.legacyWorkerUrl = legacyWorkerUrl;
|
||||||
|
|
||||||
if (config.EnableFallbackFont) {
|
if (config.EnableFallbackFont) {
|
||||||
apiClient.getJSON(fallbackFontList).then((fontFiles = []) => {
|
apiClient.getJSON(fallbackFontList).then((fontFiles = []) => {
|
||||||
fontFiles.forEach(font => {
|
fontFiles.forEach(font => {
|
||||||
|
Loading…
Reference in New Issue
Block a user