shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.19k stars 1.34k forks source link

HLS #EXT-X-MEDIA Tags not parsed properly, Missing Attributes #5447

Closed WINOFFRG closed 12 months ago

WINOFFRG commented 1 year ago

Have you read the FAQ and checked for duplicate open issues? Yes

What version of Shaka Player are you using? v4.3.8 (uncompiled)

Can you reproduce the issue with our latest release version? Yes

Can you reproduce the issue with the latest code from main? Yes

Are you using the demo app or your own custom app? Demo

If custom app, can you reproduce the issue using our demo app? NA

What browser and OS are you using? Windows 11, Chrome v115

For embedded devices (smart TVs, etc.), what model and firmware version are you using? NA

What are the manifest and license server URIs?

Sent over mail

What configuration are you using? What is the output of player.getConfiguration()?

Default Configuration

What did you do?

Loaded the Manifest

What did you expect to happen? HLS Manifest has the #EXT-X-MEDIA tag however it isn't parsed properly attributes like Name, Deault, Language ... Tag:

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-98",LANGUAGE="hi",NAME="Hindi",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2"

What actually happened?

I see language as und and rest values as null

WINOFFRG commented 1 year ago

Tried debugging the issue found that HLS Parser filters outs the HLS Tags where uri is missing, In the case above instead of URI it's assigned via GROUP-ID this function below skips the respective #EXT-X-MEDIA tag

https://github.com/shaka-project/shaka-player/blob/ed93a0cb12173de65f76109136d179bb0f34c014/lib/hls/hls_parser.js#L1306-L1318

As per RFC8216 the URI attribute is optional which we are forcing here https://github.com/shaka-project/shaka-player/blob/main/lib/hls/hls_parser.js#L1795-L1796 Not sure but that's all what I could find.

  The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media
   type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO.
   If the media type is VIDEO or AUDIO, a missing URI attribute
   indicates that the media data for this Rendition is included in the
   Media Playlist of any EXT-X-STREAM-INF tag referencing this
   EXT-X-MEDIA tag.  If the media TYPE is AUDIO and the URI attribute is
   missing, clients MUST assume that the audio data for this Rendition
   is present in every video Rendition specified by the EXT-X-STREAM-INF
   tag.
avelad commented 1 year ago

@theodab can you review it?

avelad commented 1 year ago

@WINOFFRG can you provide a public url? Thanks!

WINOFFRG commented 1 year ago

Hi! Sorry I don't have any public sample at the moment. However I can share it with you over Slack if that's okay with you. However, it's Geo Restricted for India.

avelad commented 1 year ago

Public sample stream: https://s3.amazonaws.com/qa.jwplayer.com/~alex/121628/new_master.m3u8

WINOFFRG commented 1 year ago

Yes this is similar, The issue is same here tags aren't parsed.

WINOFFRG commented 1 year ago

Hi! Any updates on this issue?