mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update chromecast loading
This commit is contained in:
parent
2d4d70ed14
commit
7537bab562
2 changed files with 18 additions and 6 deletions
|
@ -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
|
||||
var currentResolve;
|
||||
|
@ -90,6 +90,8 @@
|
|||
*/
|
||||
CastPlayer.prototype.initializeCastPlayer = function () {
|
||||
|
||||
var chrome = window.chrome;
|
||||
|
||||
if (!chrome) {
|
||||
return;
|
||||
}
|
||||
|
@ -861,9 +863,17 @@
|
|||
|
||||
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()) {
|
||||
|
||||
postInitDependencies.push('cordova/connectsdk');
|
||||
|
||||
if (browserInfo.android) {
|
||||
postInitDependencies.push('cordova/android/mediasession');
|
||||
postInitDependencies.push('cordova/android/chromecast');
|
||||
|
||||
} else {
|
||||
postInitDependencies.push('cordova/volume');
|
||||
}
|
||||
|
||||
if (browserInfo.safari) {
|
||||
|
||||
postInitDependencies.push('cordova/connectsdk/connectsdk');
|
||||
|
||||
postInitDependencies.push('cordova/ios/orientation');
|
||||
|
||||
if (Dashboard.capabilities().SupportsSync) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue