videogular2
videogular2 copied to clipboard
Better way of providing hls.js
Description
Currently, hls.js source file need to be added in angular.json file. Then, we're assuming that we have global Hls variable:
https://github.com/videogular/videogular2/blob/f82d320256e3db9c6d63585155bdba1dccbf9f1c/src/streaming/vg-hls/vg-hls.ts#L17
It's kind of ok, but if I want to use videogular2 with hls.js capabilities only in lazy-loaded module, that means that hls.js will be still bundled inside main app bundle (which doesn't use it at all). Not really optimal solution if you ask me.
I'm curious why it was done that way, and if there is a better way to do do this.
I was thinking of directly importing hls.js inside vg-hls.ts. Or maybe utilizing providers property in VgStreamingModule.
I thought about it and I think it is definitely doable, maybe I will create PR after fixing some issues I encountered when I forked this to improve HLS playing. :)
@pegak That'll be great, otherwise I could also try to come up with PR