Compare commits

...

3 Commits

Author SHA1 Message Date
Ingo Oppermann
08b1dd0ba0
Fix chromecast support 2024-11-01 11:23:06 +01:00
Ingo Oppermann
5c2a3a1fa5
Merge pull request #73 from badincite/main
Fix chromecast
2024-11-01 11:09:13 +01:00
badincite
67cc21b1fa Fix chromecast
Chromecast needs to append the url origin for the source to properly pass to the cast device. And it appears to need the default receiver application ID.
2024-10-29 09:45:05 -04:00

View File

@ -6,18 +6,22 @@ var config = {
liveui: true,
responsive: true,
fluid: true,
// Needed to append the url orgin in order for the source to properly pass to the cast device
sources: [{ src: playerConfig.source, type: 'application/x-mpegURL' }],
// 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: {},
};
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();
}
@ -25,7 +29,7 @@ player.ready(function () {
if (airplay) {
player.airPlay();
}
player.license(playerConfig.license);
if (playerConfig.logo.image.length != 0) {