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

STATE_ENDED not called if the video renderer surface is null. #1512

Closed
spalmerin21 opened this issue May 9, 2016 · 2 comments
Closed

STATE_ENDED not called if the video renderer surface is null. #1512

spalmerin21 opened this issue May 9, 2016 · 2 comments
Labels

Comments

@spalmerin21
Copy link

spalmerin21 commented May 9, 2016

I have this method below to show/hide the surface.

public void setDisplay(boolean shouldShow) {
    Surface surface = PlayerFragment.mPreview.getHolder().getSurface();

    if (videoRenderer == null) {
        return;
    }

    if (shouldShow) {
        exoPlayer.sendMessage(
                videoRenderer, MediaCodecVideoTrackRenderer.MSG_SET_SURFACE, surface);
    } else {
        exoPlayer.blockingSendMessage(
                videoRenderer, MediaCodecVideoTrackRenderer.MSG_SET_SURFACE, null);
    }
}

If shouldshow is false, the player continues to receive the STATE_READY, STATE_BUFFERING, and STATE_PREPARING callbacks. Once the player reaches the end however, the STATE_ENDED callback is not called.

If shouldshow is true, the player receives all of the callbacks including STATE_ENDED.

Is there something else that needs to be set to get the STATE_ENDED callback when the surface is null? I am using a Nexus 6p on Android 6.0.1 with Exoplayer r1.5.7.

Thanks.

@ojw28
Copy link
Contributor

ojw28 commented May 10, 2016

Do you need to actually unset the surface, or can you achieve what you're trying to achieve some other way? What's the use case exactly? Will the surface be hidden for a potentially extended period of time?Normally you should disable the video renderer in such cases, rather than leaving it enabled but without a surface.

@ojw28
Copy link
Contributor

ojw28 commented May 10, 2016

Let's use #1520 to track this, since it's the same question but the issue contains more information.

@ojw28 ojw28 closed this as completed May 10, 2016
@google google locked and limited conversation to collaborators Jun 28, 2017
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

2 participants