Make dash.js a composite of separate reusable modules
Created by: alexanderwallin
I am writing this suggestion as someone new to the dash.js project. I am aware of the amount of work it takes to be compliant with the DASH standard and making it work for everyone everywhere, and you are doing an awesome job doing that! This issue is mainly aiming to create a discussion and see what you guys think of it.
The entry point for me is one where I need a lot of the DASH functionality, but not the whole thing. For instance, video is out and multi-track audio is in. I am a bit scared of extending it due to the 18K* lines of code and 175 intertwined classes that makes up the source.
*Comments and blank lines excluded. Derived using cloc.
As an example; MPD parsing, network speed monitoring and continuous segment HTTP requests are features that in my own opinion seem highly suitable for being developed and published separately. Good examples of this approach are babel and lodash.
The main benefits as I see it would be:
- Lower threshold in understanding how the different parts work, thus making it easier for people to contribute to each of them
- Generally higher reusability of components, not necessarily used inside a player
- It would be easier to extend the functionality — say an audio-only player — without understanding the entire project, but instead switching the player component (like using
dash-webaudio-player
instead ofdash-html5-player
)
I made a simple proof of concept by extracting the MPD parsing into dash-mpd-parser
.
What do you think of this approach? Given the roadmap and status of this project, is modularisation (the dreadful big rewrite) doable within a reasonable timeframe?
Cheers!