Fix chromecast support

This commit is contained in:
Ingo Oppermann 2024-11-01 11:23:06 +01:00
parent 5c2a3a1fa5
commit 08b1dd0ba0
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E

View File

@ -6,24 +6,22 @@ var config = {
liveui: true, liveui: true,
responsive: true, responsive: true,
fluid: true, fluid: true,
// Needed to append the url origin in order for the source to properly pass to the cast device. Also provide a default reciever application ID // Needed to append the url origin in order for the source to properly pass to the cast device
sources: [{ src: window.location.origin + '/' + playerConfig.source, type: 'application/x-mpegURL' }], sources: [{ src: window.location.origin + '/' + playerConfig.source, type: 'application/x-mpegURL' }],
plugins: { plugins: {},
license: playerConfig.license,
chromecast: {
receiverApplicationId: 'CC1AD845'
},
},
}; };
if (chromecast) { if (chromecast) {
config.techOrder = ['chromecast', 'html5']; config.techOrder = ['chromecast', 'html5'];
// Provide a default reciever application ID
config.plugins.chromecast = {
receiverApplicationId: 'CC1AD845',
};
} }
var player = videojs('player', config); var player = videojs('player', config);
player.ready(function () { player.ready(function () {
if (chromecast) { if (chromecast) {
player.chromecast(); player.chromecast();
} }
@ -31,7 +29,7 @@ player.ready(function () {
if (airplay) { if (airplay) {
player.airPlay(); player.airPlay();
} }
player.license(playerConfig.license); player.license(playerConfig.license);
if (playerConfig.logo.image.length != 0) { if (playerConfig.logo.image.length != 0) {