Skip to content

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:

  1. Renamed getSegments into updateSegments to better reflect what it actually does.
  2. Code related to specific segments referencing scheme was separated into 3 classes(timeline, template, list).
  3. Extracted code that was shared by these 3 classes and DashHandler.js to separate file.
  4. Implemented overriding of default value for segments availability upper limit(availabilityUpperLimit) by passing it as method param.

Merge request reports