Browse Source

hls: support reading on iOS Safari

pull/509/head
aler9 5 years ago
parent
commit
ffe4a2d1e7
  1. 5
      internal/core/hls_remuxer.go

5
internal/core/hls_remuxer.go

@ -48,6 +48,10 @@ const index = `<!DOCTYPE html>
const create = () => { const create = () => {
const video = document.getElementById('video'); const video = document.getElementById('video');
if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = 'stream.m3u8';
video.play();
} else {
const hls = new Hls({ const hls = new Hls({
progressive: false, progressive: false,
}); });
@ -66,6 +70,7 @@ const create = () => {
hls.attachMedia(video); hls.attachMedia(video);
video.play(); video.play();
}
} }
create(); create();

Loading…
Cancel
Save