question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Black screen sometimes when switching the same player from a playerView to another in recycler view

See original GitHub issue

Hi,

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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ramim94commented, Oct 3, 2019

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

0reactions
marcbaechingercommented, Nov 13, 2019

Closing for now. Please re-open if you have new insights.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found