videogular2 icon indicating copy to clipboard operation
videogular2 copied to clipboard

Better way of providing hls.js

Open impankratov opened this issue 6 years ago • 2 comments
trafficstars

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.

impankratov avatar Jan 13 '19 17:01 impankratov

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. :)

BleedingDev avatar Jan 16 '19 15:01 BleedingDev

@pegak That'll be great, otherwise I could also try to come up with PR

impankratov avatar Jan 23 '19 10:01 impankratov