mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Migrated castSenderApi.js to es6 module
This commit is contained in:
parent
ce8484e8f0
commit
8c58472dcf
3 changed files with 24 additions and 29 deletions
|
@ -169,6 +169,7 @@
|
|||
"src/components/toast/toast.js",
|
||||
"src/components/upnextdialog/upnextdialog.js",
|
||||
"src/components/viewContainer.js",
|
||||
"src/components/castSenderApi.js",
|
||||
"src/controllers/session/addServer/index.js",
|
||||
"src/controllers/session/forgotPassword/index.js",
|
||||
"src/controllers/session/redeemPassword/index.js",
|
||||
|
|
|
@ -1,23 +1,16 @@
|
|||
define([], function() {
|
||||
'use strict';
|
||||
|
||||
class CastSenderApi {
|
||||
load() {
|
||||
if (window.appMode === 'cordova' || window.appMode === 'android') {
|
||||
return {
|
||||
load: function () {
|
||||
window.chrome = window.chrome || {};
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
var ccLoaded = false;
|
||||
return {
|
||||
load: function () {
|
||||
let ccLoaded = false;
|
||||
if (ccLoaded) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var fileref = document.createElement('script');
|
||||
return new Promise(function (resolve) {
|
||||
const fileref = document.createElement('script');
|
||||
fileref.setAttribute('type', 'text/javascript');
|
||||
|
||||
fileref.onload = function () {
|
||||
|
@ -29,6 +22,7 @@ define([], function() {
|
|||
document.querySelector('head').appendChild(fileref);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export default CastSenderApi;
|
||||
|
|
|
@ -577,7 +577,7 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
|
|||
this.isLocalPlayer = false;
|
||||
this.lastPlayerData = {};
|
||||
|
||||
castSenderApiLoader.load().then(initializeChromecast.bind(this));
|
||||
new castSenderApiLoader().load().then(initializeChromecast.bind(this));
|
||||
}
|
||||
|
||||
ChromecastPlayer.prototype.tryPair = function (target) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue