You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unimplemented getCurrentTracks() in MediaController #102
I recently transitioned my app over to media3 and I've noticed that the closed captions button is always disabled. All of my videos are HLS and on exoplayer2 it was loading all of the tracks correctly. I went to debug this through the media3 code and found that I kept hitting a TODO(b/178486745) line here: https://github.com/androidx/media/blob/release/libraries/session/src/main/java/androidx/media3/session/MediaController.java#L1674-L1677 Is this why subtitles are not enabled for media3? Is there a way I can get subtitles working correctly? Is there a timeline when this TODO will be addressed? Thanks!
Subtitles should still work as before in terms of ExoPlayer. But if I understand correctly and for the reasons you found, the PlayerControlView thinks there are no text tracks when you set a MediaController to playerView.setPlayer(player), so the view does not display them for selection.
Can you confirm that with the closed captions button is always disabled you mean that the PlayerControleView does not show the buttons to enable/disable subtitles?
That TODO needs to be addressed latest until we release the stable version of media3-1.0.0. I'd actually say we should see that we have this done asap and land it with the next release. We will update this issue when we have pushed the fix to the main branch and then again when it goes to the release branch.
Thanks @marcbaechinger what I mean by the closed captions button is always disabled is that the button is always shown but greyed out like its disabled. So I put some break points in and traced the code that enables and disables it. It led me to this updateTracksList() which calls initTrackSelectionAdapter() which calls the getCurrentTracks() method that always returns empty (the TODO one). Since it always returns empty the code will always hit updateButton and set enabled to false.
I looked at the blame and saw that this TODO has been in the code for awhile so I'm not sure if my issue is directly related to my transition to media3. Previously when subtitles were working for me I was just using an ExoPlayer (exoplayer2) for everything and hand constructing a foreground service to play it in the background. I made the jump to media3 because it seemed like the easiest move to get a MediaController to fix a bluetooth headset bug. And I now use a MediaService for running the notification. Since a MediaController is a Player and am ExoPlayer is also a Player it feels like some of the calls previously are getting confused. I can only set the MediaItem on the MediaController now which is why I think subtitles are broken is because the MediaController version of getCurrentTrack that differs from the ExoPlayer version which was working. I've tried a couple different ways of trying to set the media item on the exoplayer instead of the media controller but it doesn't seem to work. Any thoughts on how I can get this working again? Really appreciate you taking the time!
@nplasterer@christosts
Hello,
1.0.0 has been released 3 days ago. 🥳
I tried to use MediaController.getCurrentTracks() and to me it looks like it works as intended now. I think this issue can be closed.
Activity
marcbaechinger commentedon Jul 1, 2022
Subtitles should still work as before in terms of
ExoPlayer. But if I understand correctly and for the reasons you found, thePlayerControlViewthinks there are no text tracks when you set aMediaControllertoplayerView.setPlayer(player), so the view does not display them for selection.Can you confirm that with
the closed captions button is always disabledyou mean that thePlayerControleViewdoes not show the buttons to enable/disable subtitles?That TODO needs to be addressed latest until we release the stable version of media3-1.0.0. I'd actually say we should see that we have this done asap and land it with the next release. We will update this issue when we have pushed the fix to the
mainbranch and then again when it goes to thereleasebranch.nplasterer commentedon Jul 1, 2022
Thanks @marcbaechinger what I mean by
the closed captions button is always disabledis that the button is always shown but greyed out like its disabled. So I put some break points in and traced the code that enables and disables it. It led me to this updateTracksList() which calls initTrackSelectionAdapter() which calls the getCurrentTracks() method that always returns empty (the TODO one). Since it always returns empty the code will always hit updateButton and set enabled to false.I looked at the blame and saw that this TODO has been in the code for awhile so I'm not sure if my issue is directly related to my transition to
media3. Previously when subtitles were working for me I was just using an ExoPlayer (exoplayer2) for everything and hand constructing a foreground service to play it in the background. I made the jump to media3 because it seemed like the easiest move to get aMediaControllerto fix a bluetooth headset bug. And I now use aMediaServicefor running the notification. Since aMediaControlleris aPlayerand amExoPlayeris also aPlayerit feels like some of the calls previously are getting confused. I can only set theMediaItemon theMediaControllernow which is why I think subtitles are broken is because theMediaControllerversion ofgetCurrentTrackthat differs from theExoPlayerversion which was working. I've tried a couple different ways of trying to set the media item on the exoplayer instead of the media controller but it doesn't seem to work. Any thoughts on how I can get this working again? Really appreciate you taking the time!Exclude tracks if COMMAND_GET_TRACKS is not available
Enable subtitle selection in session demo app
Exclude tracks if COMMAND_GET_TRACKS is not available
Enable subtitle selection in session demo app
Exclude tracks from `PlayerInfo` if not changed
Exclude tracks from `PlayerInfo` if not changed
Exclude tracks from `PlayerInfo` if not changed
Exclude tracks from `PlayerInfo` if not changed
Impr/doris 1730 migrate exo 2.18.4 (#77)
fknives commentedon Mar 25, 2023
@nplasterer @christosts
Hello,
1.0.0 has been released 3 days ago. 🥳
I tried to use
MediaController.getCurrentTracks()and to me it looks like it works as intended now. I think this issue can be closed.Chore/migrate media 1.0.2 (#10)
Merge pull request androidx#102 from Guovin/dev