mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
parent
bda430f791
commit
67c3f8ee38
@ -57,14 +57,16 @@ class OwncastPlayer {
|
||||
}
|
||||
|
||||
init() {
|
||||
this.vjsPlayer = videojs(VIDEO_ID, VIDEO_OPTIONS);
|
||||
|
||||
this.vjsPlayer.beforeRequest = function (options) {
|
||||
const cachebuster = Math.round(new Date().getTime() / 1000);
|
||||
options.uri = `${options.uri}?cachebust=${cachebuster}`;
|
||||
videojs.Vhs.xhr.beforeRequest = options => {
|
||||
if (options.uri.match('m3u8')) {
|
||||
const cachebuster = Math.round(new Date().getTime() / 1000);
|
||||
options.uri = `${options.uri}?cachebust=${cachebuster}`;
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
this.vjsPlayer = videojs(VIDEO_ID, VIDEO_OPTIONS);
|
||||
|
||||
this.addAirplay();
|
||||
this.vjsPlayer.ready(this.handleReady);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user