mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add reel
This commit is contained in:
parent
80f38f2eae
commit
50a8de7608
18 changed files with 384 additions and 111 deletions
100
dashboard-ui/thirdparty/cast_sender.js
vendored
100
dashboard-ui/thirdparty/cast_sender.js
vendored
|
@ -1,49 +1,57 @@
|
|||
(function() {var chrome = window.chrome || {};
|
||||
chrome.cast = chrome.cast || {};
|
||||
chrome.cast.media = chrome.cast.media || {};
|
||||
chrome.cast.ApiBootstrap_ = function() {
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.EXTENSION_IDS = ["boadgeojelhgndaghljhdicfkmllpafd", "dliochdbjfkdbacpmhlcpmleaejidimm", "hfaagokkkhdbgiakmmlclaapfelnkoah", "fmfcbgogabcbclcofgocippekhfcmgfj", "enhhojjnijigcajfphajepfemndkmdlo"];
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtension_ = function(callback) {
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtensionHelper_(0, callback);
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtensionHelper_ = function(index, callback) {
|
||||
index == chrome.cast.ApiBootstrap_.EXTENSION_IDS.length ? callback(null) : chrome.cast.ApiBootstrap_.isExtensionInstalled_(chrome.cast.ApiBootstrap_.EXTENSION_IDS[index], function(installed) {
|
||||
installed ? callback(chrome.cast.ApiBootstrap_.EXTENSION_IDS[index]) : chrome.cast.ApiBootstrap_.findInstalledExtensionHelper_(index + 1, callback);
|
||||
});
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.getCastSenderUrl_ = function(extensionId) {
|
||||
return "chrome-extension://" + extensionId + "/cast_sender.js";
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.isExtensionInstalled_ = function(extensionId, callback) {
|
||||
var xmlhttp = new XMLHttpRequest;
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
4 == xmlhttp.readyState && 200 == xmlhttp.status && callback(!0);
|
||||
};
|
||||
xmlhttp.onerror = function() {
|
||||
callback(!1);
|
||||
};
|
||||
(function () {
|
||||
|
||||
try {
|
||||
// Throws an error in other browsers
|
||||
xmlhttp.open("GET", chrome.cast.ApiBootstrap_.getCastSenderUrl_(extensionId), !0);
|
||||
xmlhttp.send();
|
||||
} catch (ex) {
|
||||
|
||||
// This script produces errors in older versions of safari
|
||||
|
||||
if ((navigator.userAgent || '').toLowerCase().indexOf('chrome') == -1) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtension_(function(extensionId) {
|
||||
if (extensionId) {
|
||||
console.log("Found cast extension: " + extensionId);
|
||||
chrome.cast.extensionId = extensionId;
|
||||
var apiScript = document.createElement("script");
|
||||
apiScript.src = chrome.cast.ApiBootstrap_.getCastSenderUrl_(extensionId);
|
||||
(document.head || document.documentElement).appendChild(apiScript);
|
||||
} else {
|
||||
var msg = "No cast extension found";
|
||||
console.log(msg);
|
||||
var callback = window.__onGCastApiAvailable;
|
||||
callback && "function" == typeof callback && callback(!1, msg);
|
||||
}
|
||||
});
|
||||
|
||||
var chrome = window.chrome || {};
|
||||
chrome.cast = chrome.cast || {};
|
||||
chrome.cast.media = chrome.cast.media || {};
|
||||
chrome.cast.ApiBootstrap_ = function () {
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.EXTENSION_IDS = ["boadgeojelhgndaghljhdicfkmllpafd", "dliochdbjfkdbacpmhlcpmleaejidimm", "hfaagokkkhdbgiakmmlclaapfelnkoah", "fmfcbgogabcbclcofgocippekhfcmgfj", "enhhojjnijigcajfphajepfemndkmdlo"];
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtension_ = function (callback) {
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtensionHelper_(0, callback);
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtensionHelper_ = function (index, callback) {
|
||||
index == chrome.cast.ApiBootstrap_.EXTENSION_IDS.length ? callback(null) : chrome.cast.ApiBootstrap_.isExtensionInstalled_(chrome.cast.ApiBootstrap_.EXTENSION_IDS[index], function (installed) {
|
||||
installed ? callback(chrome.cast.ApiBootstrap_.EXTENSION_IDS[index]) : chrome.cast.ApiBootstrap_.findInstalledExtensionHelper_(index + 1, callback);
|
||||
});
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.getCastSenderUrl_ = function (extensionId) {
|
||||
return "chrome-extension://" + extensionId + "/cast_sender.js";
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.isExtensionInstalled_ = function (extensionId, callback) {
|
||||
var xmlhttp = new XMLHttpRequest;
|
||||
xmlhttp.onreadystatechange = function () {
|
||||
4 == xmlhttp.readyState && 200 == xmlhttp.status && callback(!0);
|
||||
};
|
||||
xmlhttp.onerror = function () {
|
||||
callback(!1);
|
||||
};
|
||||
|
||||
try {
|
||||
// Throws an error in other browsers
|
||||
xmlhttp.open("GET", chrome.cast.ApiBootstrap_.getCastSenderUrl_(extensionId), !0);
|
||||
xmlhttp.send();
|
||||
} catch (ex) {
|
||||
|
||||
}
|
||||
};
|
||||
chrome.cast.ApiBootstrap_.findInstalledExtension_(function (extensionId) {
|
||||
if (extensionId) {
|
||||
console.log("Found cast extension: " + extensionId);
|
||||
chrome.cast.extensionId = extensionId;
|
||||
var apiScript = document.createElement("script");
|
||||
apiScript.src = chrome.cast.ApiBootstrap_.getCastSenderUrl_(extensionId);
|
||||
(document.head || document.documentElement).appendChild(apiScript);
|
||||
} else {
|
||||
var msg = "No cast extension found";
|
||||
console.log(msg);
|
||||
var callback = window.__onGCastApiAvailable;
|
||||
callback && "function" == typeof callback && callback(!1, msg);
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue