shaka-project / shaka-player

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

Embeded captions can not be displayed correctly #6693

Closed Wenjie-Shao closed 3 months ago

Wenjie-Shao commented 3 months ago

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

If the problem is related to FairPlay, have you read the tutorial?

No

What version of Shaka Player are you using? v4.8.7-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? The demo

If custom app, can you reproduce the issue using our demo app? N/A

What browser and OS are you using? Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

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

What are the manifest and license server URIs?

uri= https://lnc-tubi-originals.tubi.video/index.m3u8

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

Default config in demo page

What did you do?

Play and try to get videoElement.textTracks in console. It return an empty array.

What did you expect to happen? It should display the embedded cc tracks. I tried with hls.js and the tracks be added correctly.

Wenjie-Shao commented 3 months ago

I guess the reason is the manifest didn't contain a E-X-MEIDA tag with TYPE=CLOSED-CAPTIONS. The captions is carried in video stream. However according to the spec https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.6.1 . I think we should support this case.

absidue commented 3 months ago

shaka-player has it's own text track handling, so it doesn't add them to the browser's list. Use player.getTextTracks() to get all of them, player.selectTextTrack(textTrack) to select one and player.setTextTrackVisibility(isVisible) to show and hide the text track display.

avelad commented 3 months ago

Yes you need to declare your captions in the master playlist. Otherwise it doesn't work, see: https://github.com/shaka-project/shaka-player/issues/1826

Wenjie-Shao commented 3 months ago

Hi, @avelad . I noticed in the link you provided that we have supported this functionality for when loading a media playlist https://github.com/shaka-project/shaka-player/pull/5811 .

In this PR, it would only build captions while captions are declared in the master playlist but not in the media playlist, right? And we don't have any plan for supporting building captions while there is no declaration in both the master playlist and the media playlist?

avelad commented 3 months ago

Yes we want add it, but nobody is working on it now

Wenjie-Shao commented 3 months ago

Gotcha! Thank you!

avelad commented 3 months ago

@Wenjie-Shao see: https://github.com/shaka-project/shaka-player/pull/6700