Skip to content

Commit

Permalink
Fix chromecast support
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Nov 1, 2024
1 parent 5c2a3a1 commit 08b1dd0
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions public/_playersite/videojs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,30 @@ var config = {
liveui: true,
responsive: 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' }],
plugins: {
license: playerConfig.license,
chromecast: {
receiverApplicationId: 'CC1AD845'
},
},
plugins: {},
};

if (chromecast) {
config.techOrder = ['chromecast', 'html5'];
// Provide a default reciever application ID
config.plugins.chromecast = {
receiverApplicationId: 'CC1AD845',
};
}

var player = videojs('player', config);

player.ready(function () {

if (chromecast) {
player.chromecast();
}

if (airplay) {
player.airPlay();
}

player.license(playerConfig.license);

if (playerConfig.logo.image.length != 0) {
Expand Down

0 comments on commit 08b1dd0

Please sign in to comment.