mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Move prompt, confirm and sendcastapi to one module each
This commit is contained in:
parent
f50d709161
commit
cb97baa61a
6 changed files with 131 additions and 152 deletions
34
src/components/castSenderApi.js
Normal file
34
src/components/castSenderApi.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
define([], function() {
|
||||
'use strict';
|
||||
|
||||
if (window.appMode === "cordova" || window.appMode === "android") {
|
||||
return {
|
||||
load: function () {
|
||||
window.chrome = window.chrome || {};
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
var ccLoaded = false;
|
||||
return {
|
||||
load: function () {
|
||||
if (ccLoaded) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var fileref = document.createElement("script");
|
||||
fileref.setAttribute("type", "text/javascript");
|
||||
|
||||
fileref.onload = function () {
|
||||
ccLoaded = true;
|
||||
resolve();
|
||||
};
|
||||
|
||||
fileref.setAttribute("src", "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js");
|
||||
document.querySelector("head").appendChild(fileref);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue