just_audio icon indicating copy to clipboard operation
just_audio copied to clipboard

HLS support for Web

Open kcrebound opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. Can't play HLS in the web

Describe the solution you'd like Can't find info about the problem with HLS for web, any plans?

Describe alternatives you've considered I can use it without HLS, but with huge audio files, it is a big problem.

Nice packages! Thank you

kcrebound avatar Nov 12 '20 20:11 kcrebound

Note to self: this could be used: https://github.com/google/shaka-player/

ryanheise avatar Mar 08 '21 01:03 ryanheise

There is a package which adds Web HLS support for video_player, maybe it can be used as an inspiration for implementing HLS in just_audio - https://github.com/balvinderz/video_player_web_hls.

liri2006 avatar Jan 13 '22 13:01 liri2006

Good find, @liri2006 . Internally it is using hls.js instead of shaka and shaka also includes DASH support, but your link could be a useful guideline on how to integrate that into a Flutter plugin. Technically the javascript library can't directly be pulled in by the plugin, so there'll need to be some README instructions on what script tag the app developer will need to add to their app.

ryanheise avatar Jan 13 '22 13:01 ryanheise

Hey @ryanheise , I managed to get this done here: https://github.com/liorshk/just_audio/blob/704eb4de9d52dba41d751f378b4b56cabbefff31/just_audio_web/lib/just_audio_web.dart

Using hls.js library.

liorshk avatar Dec 21 '23 15:12 liorshk

Hi @liorshk , nice work! Sorry I missed this comment. Would you be interested in submitting a PR with instructions in the README for web setup instructions? Judging by the code, it also looks like the instructions could be optional for an app that doesn't actually use HLS.

ryanheise avatar Feb 29 '24 15:02 ryanheise