Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS content playback on Safari does not use UITextDisplayer #2585

Closed
Qingkui9 opened this issue May 21, 2020 · 13 comments · Fixed by #6985
Closed

HLS content playback on Safari does not use UITextDisplayer #2585

Qingkui9 opened this issue May 21, 2020 · 13 comments · Fixed by #6985
Labels
browser: Safari Issues affecting Safari or WebKit derivatives component: captions/subtitles The issue involves captions or subtitles component: HLS The issue involves Apple's HLS manifest format priority: P3 Useful but not urgent type: enhancement New feature or request
Milestone

Comments

@Qingkui9
Copy link

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

What version of Shaka Player are you using?
The one from master branch.

Please ask your question
It seems like the HLS content playback on Safari doesn't pick up the UITextDisplayer. It is alway using its own shadow dom text track container. Is this the correct behavior or did I miss anything?

@Qingkui9 Qingkui9 added the type: question A question from the community label May 21, 2020
@joeyparrish
Copy link
Member

Native HLS playback on Safari includes native text rendering, I believe. I don't think we have any control over that, as the subtitles/captions are fetched by Apple below the level of JavaScript. We don't have any access to that data unless we are in control of playback, as we are when we use MediaSource on desktop Safari or other platforms. But MediaSource isn't an option for us on iOS or when FairPlay is used on desktop.

Sorry for the confusion!

@avelad
Copy link
Collaborator

avelad commented May 22, 2020

I think there is a way to implement this. Taking the cuechange event, you could map activeCues to a Cue understood by the ShakaPlayer and use the UITextDisplayer.

Note: for this you would also have to disable native rendering via css.
Note2: right now Safari supports PiP with subtitles and this would be lost.

@TheModMaker
Copy link
Contributor

In my testing, native HLS doesn't populate the activeCues field.

@avelad
Copy link
Collaborator

avelad commented May 26, 2020

I just tested again with Safari 13.1 in macOS 10.15.4 and activeCues only is available with showing mode

@TheModMaker
Copy link
Contributor

I tested in Safari 13.0.5, so it may be a new feature. So we can have this be an enhancement for the future.

@TheModMaker TheModMaker added component: captions/subtitles The issue involves captions or subtitles type: enhancement New feature or request component: HLS The issue involves Apple's HLS manifest format and removed type: question A question from the community labels May 26, 2020
@TheModMaker TheModMaker added this to the Backlog milestone May 26, 2020
@avelad
Copy link
Collaborator

avelad commented May 27, 2020

I attach a screenshot with what I see and with the code that I have tried:
Captura de pantalla 2020-05-27 a las 8 34 03

@TheModMaker If you make the same change as me, do you see the same result?

In Safari you can modify the css cue style with

video::-webkit-media-text-track-container {
    // Style the container
}

video::-webkit-media-text-track-background {
    // Style the text background
}

video::-webkit-media-text-track-display {
    // Style the text itself
}

With this you can disable CSS rendering and use activeCues as you like.

@TheModMaker
Copy link
Contributor

Sorry, I naively just picked the first TextTrack element. After finding the active one, I see the activeCues contains the correct cues.

@TheModMaker TheModMaker added priority: P3 Useful but not urgent browser: Safari Issues affecting Safari or WebKit derivatives labels Sep 29, 2021
@bidisha15hotstar
Copy link

Still exists for me.

@joeyparrish
Copy link
Member

PRs are always welcome! The team at Google doesn't have the bandwidth to resolve all feature requests, but the beauty of open source is that you don't have to wait on anyone else.

@bidisha15hotstar
Copy link

@joeyparrish , the active cue is empty when we switch to english to arabic to english.

@avelad avelad added the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Jul 5, 2023
@avelad
Copy link
Collaborator

avelad commented Jan 8, 2024

Is there anyone still interested in this? Thanks!

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 8, 2024
@shaka-bot
Copy link
Collaborator

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 15, 2024
@avelad avelad removed this from the Backlog milestone Jan 18, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Mar 15, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Mar 15, 2024
@avelad avelad reopened this Jul 3, 2024
@avelad
Copy link
Collaborator

avelad commented Jul 3, 2024

@tykus160 will work on it

@shaka-bot shaka-bot added this to the Backlog milestone Jul 3, 2024
@avelad avelad removed flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this status: archived Archived and locked; will not be updated labels Jul 4, 2024
@avelad avelad modified the milestones: Backlog, v4.11 Jul 4, 2024
@shaka-project shaka-project unlocked this conversation Jul 4, 2024
@avelad avelad closed this as completed in 6c0c63d Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: Safari Issues affecting Safari or WebKit derivatives component: captions/subtitles The issue involves captions or subtitles component: HLS The issue involves Apple's HLS manifest format priority: P3 Useful but not urgent type: enhancement New feature or request
6 participants