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

Cannot select any other than 1st audio/subtitle track in StyledPlayerView (regression) #9649

Closed
moneytoo opened this issue Nov 4, 2021 · 3 comments
Assignees
Labels

Comments

@moneytoo
Copy link
Contributor

moneytoo commented Nov 4, 2021

I'm migrating from ExoPlayer 2.15.1 to 2.16.0. When I select any audio or subtitle track (in StyledPlayerView), other than the first one, there is no audio heard or subtitle visible. I can replicate in something like this:

public class MainActivity extends AppCompatActivity {

    private StyledPlayerView playerView;
    private ExoPlayer player;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        playerView = findViewById(R.id.video_view);

        MediaItem.Builder mediaItemBuilder = new MediaItem.Builder()
                .setUri(getIntent().getData())
                .setMimeType(getIntent().getType());

        player = new ExoPlayer.Builder(this)
                .build();

        playerView.setPlayer(player);

        player.setMediaItem(mediaItemBuilder.build());

        player.prepare();
    }
}

Video used for testing: https://github.com/ietf-wg-cellar/matroska-test-files/blob/master/test_files/test5.mkv

Steps:

  1. Open test5.mkv
  2. Change audio track from "Auto" to "Stereo" - it plays
  3. Change audio track to "English, Mono" - it doesn't play

It's the same with subtitles. Only the first one (English) are visible. It works fine when using ExoPlayer 2.15.1.

  • ExoPlayer version number: 2.16.0
  • Android version: Android 10
  • Android device: OnePlus 7
@tonihei
Copy link
Collaborator

tonihei commented Nov 5, 2021

I can reproduce the issue, thanks! Worth noting that this related to the built-in audio/text selection button in StyledPlayerView. Track selection via the ExoPlayer demo app debug controls still works as expected.

tonihei added a commit that referenced this issue Nov 5, 2021
When we have multiple overrides for TrackGroups associated with
one renderer, we need to look at all of them to find the non-empty
one. Empty ones should only be used to remove previously selected
tracks for this group and otherwise be ignored.

Currently this is broken because the first override (no matter if
it's empty or not) is used as the final selection for this renderer.

Issue: #9649

#minor-release

PiperOrigin-RevId: 407792330
@tonihei
Copy link
Collaborator

tonihei commented Nov 5, 2021

Fixed by the commit above.

@tonihei tonihei closed this as completed Nov 5, 2021
moneytoo pushed a commit to moneytoo/ExoPlayer that referenced this issue Nov 5, 2021
When we have multiple overrides for TrackGroups associated with
one renderer, we need to look at all of them to find the non-empty
one. Empty ones should only be used to remove previously selected
tracks for this group and otherwise be ignored.

Currently this is broken because the first override (no matter if
it's empty or not) is used as the final selection for this renderer.

Issue: google#9649

#minor-release

PiperOrigin-RevId: 407792330
tonihei added a commit that referenced this issue Nov 8, 2021
When we have multiple overrides for TrackGroups associated with
one renderer, we need to look at all of them to find the non-empty
one. Empty ones should only be used to remove previously selected
tracks for this group and otherwise be ignored.

Currently this is broken because the first override (no matter if
it's empty or not) is used as the final selection for this renderer.

Issue: #9649

PiperOrigin-RevId: 407792330
icbaker pushed a commit to androidx/media that referenced this issue Nov 9, 2021
When we have multiple overrides for TrackGroups associated with
one renderer, we need to look at all of them to find the non-empty
one. Empty ones should only be used to remove previously selected
tracks for this group and otherwise be ignored.

Currently this is broken because the first override (no matter if
it's empty or not) is used as the final selection for this renderer.

Issue: google/ExoPlayer#9649

#minor-release

PiperOrigin-RevId: 407792330
@rkarimi88
Copy link

Hi.
I'm using new version (2.16.0) and I still have the same problem (just for subtitles). When I switch subtitles to "None", I cannot switch it back to my subtitle anymore.
Is this problem solved? Shall I add any additional code to my app to fix it?

Thanks in advance.

@google google locked and limited conversation to collaborators Jan 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants