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

How to tell MediaItem.SubtitleConfigurations apart in ExoPlayer.getCurrentTracksInfo().getTrackGroupInfos()? #9673

Closed
moneytoo opened this issue Nov 9, 2021 · 1 comment
Assignees

Comments

@moneytoo
Copy link
Contributor

moneytoo commented Nov 9, 2021

I'm using latest ExoPlayer 2.16.0. Let's say I want to save and restore user selected audio and subtitle "tracks" on app restart. If I add multiple MediaItem.SubtitleConfigurations, how I can I distinguish these in ExoPlayer.getCurrentTracksInfo().getTrackGroupInfos()?

Format(null, null, null, application/x-subrip, null, -1, null, [-1, -1, -1.0], [-1, -1])
Format(null, null, null, application/x-subrip, null, -1, null, [-1, -1, -1.0], [-1, -1])

MediaItem.SubtitleConfiguration doesn't let me specify any id. Label or user facing name may not be necessarily unique, especially if I allow users loading subtitles. The only difference may be the subtitle content/uri.

In ExoPlayer 2.15.1, I was able to tell a difference from DefaultTrackSelector.SelectionOverride.groupIndex.

@icbaker
Copy link
Collaborator

icbaker commented Nov 22, 2021

This seems like a reasonable request - I think it would make sense to add SubtitleConfiguration.Builder setter that propagates through to Format#id.

I'm not sure about Format#accessibilityChannel (the only 'text-specific' field in Format), since I don't think it's actually relevant for any sideload-able subtitle formats.

icbaker added a commit to androidx/media that referenced this issue Dec 7, 2021
Issue: google/ExoPlayer#9673

#minor-release

PiperOrigin-RevId: 414413320
icbaker added a commit that referenced this issue Dec 8, 2021
Issue: #9673

#minor-release

PiperOrigin-RevId: 414413320
@icbaker icbaker closed this as completed Dec 8, 2021
@google google locked and limited conversation to collaborators Feb 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants