Improvements in DashHandler.js
Created by: ruslandinov
The purpose of this refactoring is simplification of DashHandler.js
by extracting segment list updating responsibility into separate classes. This makes code easier to maintain and simplifies working with segment lists, especially if someone is extending default dash.js behavior and needs access to segment list currently processed by player or wants to create arbitrary segment list range for his own needs. Writing unit tests for segment list updating should be easier now too.
Overview of what was done:
- Renamed
getSegments
intoupdateSegments
to better reflect what it actually does. - Code related to specific segments referencing scheme was separated into 3 classes(timeline, template, list).
- Extracted code that was shared by these 3 classes and
DashHandler.js
to separate file. - Implemented overriding of default value for segments availability upper limit(
availabilityUpperLimit
) by passing it as method param.