mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +00:00
refine hls m3u8 refresh interval and buffer time
This commit is contained in:
parent
c0c83848a4
commit
ec57e2170d
4 changed files with 7 additions and 2 deletions
|
@ -536,6 +536,9 @@
|
|||
srs_player = new SrsPlayer("player_id", srs_get_player_width(), srs_get_player_height());
|
||||
srs_player.on_player_ready = function() {
|
||||
var buffer_time = 0.5;
|
||||
if (url.indexOf('.m3u8') > 0) {
|
||||
buffer_time = 2;
|
||||
}
|
||||
|
||||
if (query.buffer) {
|
||||
for (var i = 0; i < bts.length - 1; i++) {
|
||||
|
|
Binary file not shown.
|
@ -110,7 +110,9 @@ package
|
|||
to = hls.duration * 1000 / hls.tsCount * m3u8_refresh_ratio;
|
||||
}
|
||||
setTimeout(refresh_m3u8, to);
|
||||
log("m3u8 not changed, retry after " + to.toFixed(2) + "ms");
|
||||
log("m3u8 not changed, retry after " + to.toFixed(2) + "ms, duration="
|
||||
+ hls.duration.toFixed(2) + "s, count=" + hls.tsCount.toFixed(0)
|
||||
+ ", refresh-ratio=" + m3u8_refresh_ratio.toFixed(2));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ package
|
|||
public class Player
|
||||
{
|
||||
// refresh every ts_fragment_seconds*M3u8RefreshRatio
|
||||
public static var M3u8RefreshRatio:Number = 0.5;
|
||||
public static var M3u8RefreshRatio:Number = 0.45;
|
||||
|
||||
// parse ts every this ms.
|
||||
public static var TsParseAsyncInterval:Number = 80;
|
||||
|
|
Loading…
Reference in a new issue