Peer5 / videojs-contrib-hls.js

HLS library for video.js using Dailymotion's hls.js tech
Apache License 2.0
108 stars 55 forks source link

Dependency on other videojs-contrib-hls project #12

Closed boushley closed 7 years ago

boushley commented 7 years ago

Why does this project depend on and include the entire bundle for the videojs/videojs-contrib-hls project?

Right now the package.json depends on the other project. The Gulpfile is bundling the entire other library. In addition the example separated.html file this other library is included.

However if I remove that dependency from separated.html example the library continues to work. Does this library actually need a dependency on videojs/videojs-contrib-hls? If so, what for?

shacharz commented 7 years ago

It needs the dependency to support old browsers that hls.js can play on, and they require flash to play HLS. So in case hls.js's .isSupported() returns false it can fallback to the videojs-contrib-hls code to do it's thing. Having said that, it can be interesting to load it async only on demand.

boushley commented 7 years ago

I'd consider removing that as a dependency entirely. That seems like something that developers using this plugin could do, without adding the 162kb of code to each distribution.

For my use case I don't need or want any Flash fallback, so I'll have to rely on a custom build that doesn't include that fallback.

saarangsoltani commented 7 years ago

+1 for removing the extra dependancy. We are opting for this plugin as a replacement for the original videojs-contrib-hls as the media errors are not handled properly by that and it does not make much sense to still carry that around. I think using Flash as a fallback handler for HLS should be left to the developer not to mention the fact that Flash is deprecated and Google is panning to block Adobe Flash and implement an 'HTML5 by Default' policy on Chrome by the end of 2016. The intention is to use HTML5 automatically, and force users to explicitly accept the use of Flash only where there is no other choice.

shacharz commented 7 years ago

I think it's a good idea, but I think it should be opt-out. Since that's the expectations for videojs-contrib-hls and we wouldn't want to break that behavior. How about an additional build?

JonAlpha commented 7 years ago

Another build is a better idea. You still have users on old IE browsers

shacharz commented 7 years ago

see https://github.com/Peer5/videojs-contrib-hls.js/issues/15