mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
update chromecast loading
This commit is contained in:
parent
27045096ea
commit
9f48886829
@ -1,4 +1,4 @@
|
|||||||
(function (window, chrome, console) {
|
define(['https://www.gstatic.com/cv/js/sender/v1/cast_sender.js'], function () {
|
||||||
|
|
||||||
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
||||||
var currentResolve;
|
var currentResolve;
|
||||||
@ -90,6 +90,8 @@
|
|||||||
*/
|
*/
|
||||||
CastPlayer.prototype.initializeCastPlayer = function () {
|
CastPlayer.prototype.initializeCastPlayer = function () {
|
||||||
|
|
||||||
|
var chrome = window.chrome;
|
||||||
|
|
||||||
if (!chrome) {
|
if (!chrome) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -861,9 +863,17 @@
|
|||||||
|
|
||||||
castPlayer = new CastPlayer();
|
castPlayer = new CastPlayer();
|
||||||
|
|
||||||
MediaController.registerPlayer(new chromecastPlayer());
|
var registeredPlayer = new chromecastPlayer();
|
||||||
|
MediaController.registerPlayer(registeredPlayer);
|
||||||
|
|
||||||
|
// To allow the native android app to override
|
||||||
|
document.dispatchEvent(new CustomEvent("chromecastloaded", {
|
||||||
|
detail: {
|
||||||
|
player: registeredPlayer
|
||||||
|
}
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
requirejs(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"], initializeChromecast);
|
initializeChromecast();
|
||||||
|
|
||||||
})(window, window.chrome, console);
|
});
|
@ -2276,16 +2276,18 @@ var AppInfo = {};
|
|||||||
|
|
||||||
if (Dashboard.isRunningInCordova()) {
|
if (Dashboard.isRunningInCordova()) {
|
||||||
|
|
||||||
postInitDependencies.push('cordova/connectsdk');
|
|
||||||
|
|
||||||
if (browserInfo.android) {
|
if (browserInfo.android) {
|
||||||
postInitDependencies.push('cordova/android/mediasession');
|
postInitDependencies.push('cordova/android/mediasession');
|
||||||
|
postInitDependencies.push('cordova/android/chromecast');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
postInitDependencies.push('cordova/volume');
|
postInitDependencies.push('cordova/volume');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browserInfo.safari) {
|
if (browserInfo.safari) {
|
||||||
|
|
||||||
|
postInitDependencies.push('cordova/connectsdk/connectsdk');
|
||||||
|
|
||||||
postInitDependencies.push('cordova/ios/orientation');
|
postInitDependencies.push('cordova/ios/orientation');
|
||||||
|
|
||||||
if (Dashboard.capabilities().SupportsSync) {
|
if (Dashboard.capabilities().SupportsSync) {
|
||||||
|
Loading…
Reference in New Issue
Block a user