@@ -57,14 +57,16 @@ class OwncastPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.vjsPlayer = videojs(VIDEO_ID, VIDEO_OPTIONS);
|
videojs.Vhs.xhr.beforeRequest = options => {
|
||||||
|
if (options.uri.match('m3u8')) {
|
||||||
this.vjsPlayer.beforeRequest = function (options) {
|
const cachebuster = Math.round(new Date().getTime() / 1000);
|
||||||
const cachebuster = Math.round(new Date().getTime() / 1000);
|
options.uri = `${options.uri}?cachebust=${cachebuster}`;
|
||||||
options.uri = `${options.uri}?cachebust=${cachebuster}`;
|
}
|
||||||
return options;
|
return options;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.vjsPlayer = videojs(VIDEO_ID, VIDEO_OPTIONS);
|
||||||
|
|
||||||
this.addAirplay();
|
this.addAirplay();
|
||||||
this.vjsPlayer.ready(this.handleReady);
|
this.vjsPlayer.ready(this.handleReady);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user