Merge 6c4e1b8c87 into 0f980d49a6
This commit is contained in:
commit
313abaf984
|
|
@ -230,28 +230,34 @@
|
||||||
|
|
||||||
// Start play HLS.
|
// Start play HLS.
|
||||||
if (r.stream.indexOf('.m3u8') > 0) {
|
if (r.stream.indexOf('.m3u8') > 0) {
|
||||||
if (!Hls.isSupported()) {
|
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
||||||
hide_for_error();
|
$('#video_player').attr('src', r.url).show();
|
||||||
|
show_for_video_ok();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_for_video_ok();
|
if (Hls.isSupported()) {
|
||||||
|
show_for_video_ok();
|
||||||
|
|
||||||
// See https://github.com/video-dev/hls.js/blob/master/docs/API.md#maxlivesyncplaybackrate
|
// See https://github.com/video-dev/hls.js/blob/master/docs/API.md#maxlivesyncplaybackrate
|
||||||
// See https://github.com/video-dev/hls.js/issues/3077#issuecomment-705152394
|
// See https://github.com/video-dev/hls.js/issues/3077#issuecomment-705152394
|
||||||
hlsPlayer = new Hls({
|
hlsPlayer = new Hls({
|
||||||
enableWorker: true, // Improve performance and avoid lag/frame drops.
|
enableWorker: true, // Improve performance and avoid lag/frame drops.
|
||||||
lowLatencyMode: true, // Enable Low-Latency HLS part playlist and segment loading.
|
lowLatencyMode: true, // Enable Low-Latency HLS part playlist and segment loading.
|
||||||
liveSyncDurationCount: 2, // Start from the last few segments.
|
liveSyncDurationCount: 2, // Start from the last few segments.
|
||||||
liveMaxLatencyDurationCount: 10, // Maximum delay allowed from edge of live.
|
liveMaxLatencyDurationCount: 10, // Maximum delay allowed from edge of live.
|
||||||
maxBufferLength: 8, // Maximum buffer length in seconds.
|
maxBufferLength: 8, // Maximum buffer length in seconds.
|
||||||
maxMaxBufferLength: 10, // The max Maximum buffer length in seconds.
|
maxMaxBufferLength: 10, // The max Maximum buffer length in seconds.
|
||||||
maxLiveSyncPlaybackRate: 1.2, // Catch up if the latency is large.
|
maxLiveSyncPlaybackRate: 1.2, // Catch up if the latency is large.
|
||||||
liveDurationInfinity: true // Override current Media Source duration to Infinity for a live broadcast.
|
liveDurationInfinity: true // Override current Media Source duration to Infinity for a live broadcast.
|
||||||
});
|
});
|
||||||
hlsPlayer.loadSource(r.url);
|
hlsPlayer.loadSource(r.url);
|
||||||
hlsPlayer.attachMedia(video);
|
hlsPlayer.attachMedia(video);
|
||||||
video.play();
|
video.play();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
hide_for_error();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user