video: add HLS fallback
parent
99ec1a50cc
commit
3d35741ed0
|
@ -95,7 +95,6 @@ class VideoContentSetup {
|
|||
...hlsSources,
|
||||
{
|
||||
src: e.slide.data.src,
|
||||
label: "Original",
|
||||
},
|
||||
],
|
||||
preload: "metadata",
|
||||
|
@ -108,6 +107,18 @@ class VideoContentSetup {
|
|||
},
|
||||
});
|
||||
|
||||
content.videojs.on("error", function () {
|
||||
if (this.error().code === 4) {
|
||||
if (this.src().includes("m3u8")) {
|
||||
// HLS could not be streamed
|
||||
console.error("Video.js: HLS stream could not be opened.");
|
||||
this.src({
|
||||
src: e.slide.data.src,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
content.videojs.qualityLevels();
|
||||
content.videojs.hlsQualitySelector({
|
||||
displayCurrentQuality: true,
|
||||
|
|
Loading…
Reference in New Issue