Spiele HLS mit hls.js, wenn der Browser es nur behauptet
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
57802dfe48
commit
30833f62a1
1 file changed
+6
-6
+6
-6
@@ -7,16 +7,16 @@ document.querySelectorAll('video[data-hls]').forEach((video) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
|
||||||
video.src = source;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Hls.isSupported()) {
|
if (Hls.isSupported()) {
|
||||||
const playback = new Hls();
|
const playback = new Hls();
|
||||||
playback.loadSource(source);
|
playback.loadSource(source);
|
||||||
playback.attachMedia(video);
|
playback.attachMedia(video);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
||||||
|
video.src = source;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user