Black screen sometimes when switching the same player from a playerView to another in recycler view
See original GitHub issueHi,
I sometimes get a blackscreen on the new player view when switching from another player view with a new media source in recycler view. Note that audio plays correctly but the video is blacked out with the same view aspect ratio of the old player view. I am stopping the player when I switch to the new player view, and this is how I play it:
public void play (Uri uri){
if(playingUri != null && playingUri.equals(uri)){
Timber.d("Exo Player already playing!");
return;
}
playingUri = uri;
MediaSource mediaSource = new ProgressiveMediaSource.Factory(getDataSourceFactoryInstance(context))
.createMediaSource(uri);
playerView.setPlayer(player);
player.setPlayWhenReady(true);
player.prepare(mediaSource, true, false);
}
ANY HELP WOULD BE APPRECIATED!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ExoPlayer switching media source without black screen
I'm using exoplayer in my project, when switching mediasource i just use player.stop(); player ...
Read more >Learn with code: Jetpack Compose — Playing Media (Part 3)
Learn about playing media using ExoPlayer and lazy lists in Jetpack Compose. ... ExoPlayers' PlayerView is a traditional android view.
Read more >Playing a Video with Jetpack Compose | by Halil Ozercan
Before we start with how to play a video in a composable view, we need to ... One possible scenario is that the...
Read more >Changelog - Cosmoteer
Crash in multiplayer if a player deletes a crew role while another player is changing its name. Crash when attempting to take a...
Read more >Toro - Bountysource
In first case I have already used this player inside container and it is working fine. But on second case there is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I remember facing such an issue previously, for reaching limits of media codecs supported by the device. I had to change my implementation to invoke fewer instances of exoplayer.
I think it’s mentioned in https://github.com/google/ExoPlayer/issues/273
Closing for now. Please re-open if you have new insights.