jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

Feature request: DASH support #304

Open jyio opened 9 years ago

jyio commented 9 years ago

I use youtube-dl to grab URL's of audio streams from YouTube videos, which I then feed directly into jPlayer. Quite often, only m4a is available, but this isn't the usual m4a format -- it's DASH. Chrome/Chromium browser supports the format natively, so jPlayer uses html mode. Firefox doesn't, so jPlayer uses Flash, which also doesn't know what to do with DASH.

How does one obtain a DASH file? Like this:

$ youtube-dl -F https://www.youtube.com/watch?v=0P23b8rEe7I
...
141          m4a        audio only DASH audio  256k , m4a_dash container, aac  @256k (44100Hz), 10.45MiB
...

$ youtube-dl -gf 141 https://www.youtube.com/watch?v=0P23b8rEe7I
https://r1---sn-ab5l6nlz.googlevideo.com/videoplayback?id=d0fdb76fcac47bb2&itag=141&source=youtube&requiressl=yes&pl=18&mm=31&ms=au&mv=m&gcr=us&ratebypass=yes&mime=audio/mp4&gir=yes&clen=10957114&lmt=1379210294498795&dur=343.655&sver=3&signature=5304DDFC6BF574E773036653177BBDB4F9655E5D.8109AD72D4819275C5697C7858811E2B3DC6B895&mt=1427155954&key=dg_yt0&fexp=900720,901440,907263,916723,934947,934954,9405135,9405696,9405970,9407103,9407577,9407852,9407869,9408101,948124,951511,951703,952302,952612,952901,955301,957201,958601,959701,960613,961404&upn=EZW09BJG9w8&ip=72.43.201.4&ipbits=0&expire=1427177635&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,ms,mv,gcr,ratebypass,mime,gir,clen,lmt,dur

$ wget `youtube-dl -gf 141 https://www.youtube.com/watch?v=0P23b8rEe7I`

Note that if one used youtube-dl to download the file directly, i.e.

$ youtube-dl -f 141 https://www.youtube.com/watch?v=0P23b8rEe7I
...
[ffmpeg] Correcting container...

it would use ffmpeg to copy the data into a normal m4a file. Unfortunately, this needs to be done on the server.

It would be awesome if jPlayer could play DASH files/streams directly :) Thank you for entertaining my request.