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

Can I use setTextTrackVisibility() on iOS when useNativeHlsOnSafari is true? #6346

Open
kuroishi opened this issue Mar 19, 2024 · 8 comments
Labels
component: captions/subtitles The issue involves captions or subtitles component: HLS The issue involves Apple's HLS manifest format platform: iOS Issues affecting iOS priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Milestone

Comments

@kuroishi
Copy link

kuroishi commented Mar 19, 2024

Have you read the Tutorials?
yes.

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

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

N/A

What version of Shaka Player are you using?
4.7.9

What browser and OS are you using?
iOS 15.4
Safari

Please ask your question
Can I use setTextTrackVisibility() when useNativeHlsOnSafari is true?
It doesn't seem to work correctly.
In Safari on macOS, I can use the method as I expect but on iOS I can't.
Maybe it doesn't matter whether or not the useNativeHlsOnSafari is true/false on iOS.

@kuroishi kuroishi added the type: question A question from the community label Mar 19, 2024
@kuroishi kuroishi changed the title Can I use setTextTrackVisibility() when useNativeHlsOnSafari is true? Can I use setTextTrackVisibility() on iOS when useNativeHlsOnSafari is true? Mar 19, 2024
@absidue
Copy link

absidue commented Mar 19, 2024

As you are on iOS 15.4 shaka-player will always use native HLS, Apple only added the APIs (ManagedMediaSource) for non-native HLS playback in iOS 17.1.

https://caniuse.com/mdn-api_managedmediasource

@kuroishi
Copy link
Author

I can control the visibility using setTextTrackVisibility() on macOS even when useNativeHlsOnSafari is true.
But on iOS 15.4 it doesn't work. Is it right?

@joeyparrish
Copy link
Member

@absidue may be mistaken. Native HLS on iOS should not cause setTextTrackVisibility to fail. Thank you for the report.

@joeyparrish joeyparrish added type: bug Something isn't working correctly component: HLS The issue involves Apple's HLS manifest format component: captions/subtitles The issue involves captions or subtitles platform: iOS Issues affecting iOS priority: P2 Smaller impact or easy workaround and removed type: question A question from the community labels Mar 20, 2024
@shaka-bot shaka-bot added this to the v5.0 milestone Mar 20, 2024
@absidue
Copy link

absidue commented Mar 20, 2024

@absidue may be mistaken.

On iOS versions older than 17.1, the useNativeHlsOnSafari setting makes no difference, because before that iOS had neither the MediaSource API or the ManagedMediaSource API, so shaka-player will always use native playback/LoadMode.SRC_EQUALS. macOS and iPadOS have had the MediaSource APIs for a long time.

@absidue
Copy link

absidue commented Mar 20, 2024

@kuroishi Make sure that you call selectTextTrack first before you call setTextTrackVisibility, otherwise shaka-player won't know which text track it should make visible.

@kuroishi
Copy link
Author

I checked and I surely call selectTextTrack(). Again, it works on macOS and Native HLS Safari using the same code.

@joeyparrish
Copy link
Member

Okay, sounds like a bug. Text tracks should work on all platforms and all versions.

@avelad
Copy link
Collaborator

avelad commented Mar 27, 2024

@joeyparrish I tested it, and it works in Safari 16+ but it fails in Safari 15. The bug seems to be here: https://github.com/shaka-project/shaka-player/blob/main/lib/player.js#L2533 that the browser does not always fill the texttracks at startup, sometimes it takes a time.I have no way to debug further because I don't have a real device, I tried it with a borrowed device.

@avelad avelad modified the milestones: v4.8, v4.9 Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: captions/subtitles The issue involves captions or subtitles component: HLS The issue involves Apple's HLS manifest format platform: iOS Issues affecting iOS priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

5 participants