Low latency improvements
Created by: epiclabsDASH
Set of improvements for low latency mode:
- Implemented a new rate control mechanism similar to what was described in #2693 (closed). This enables playback synchronization across different clients.
- Rate control adaptations to overcome Safari limitations. Due to the way playbackRate works in Safari (stalls when playbackRate changes and the stream has an audio track), our rate control mechanism take this into account and when using Safari it increases the minimum acceptable playbackRate change.
- A new control mechanism has been added to dash.js to better recover from rebuffering situations when in low latency mode.
- Three new config methods added to control the new rate control mechanism:
-
setCatchupPlaybackRate
- Sets the maximum playback rate variation (from 0-0.5 and with respect to playback rate 1.0) allowed to reach target latency. 0 means catchup mechanism will be deactivated. -
setLowLatencyMinDrift
- Sets the minimum latency deviation allowed before activating catch-up mechanism. -
setLowLatencyMaxDriftBeforeSeeking
- Sets the maximum latency deviation allowed before dash.js does a seeking to live position.
-
- Fixed compatibility issues with Safari and Firefox (#2796 (closed)). There are some differences in the way timing is reported in Chrome vs Firefox/Safari which caused playback stall problems when working with low latency streams.
- Take into consideration client/server time differences for calculating latency.
- Fixed buffer/latency stability issues.
I also changed the way the graph of dash.js reference player is plotted. For time variable now it uses time since start of the playback instead of using the playback time reported by the player, which caused weird curves mainly when there were seeking operations.
Still I am testing this PR exhaustively but wanted to create it to make it available to anyone interested on testing low latency stuff.
Any feedback is more than welcome!