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

Video freezes for a few seconds after reattaching surface and resuming #5470

Closed
egorponomarev opened this issue Feb 4, 2019 · 3 comments
Closed
Assignees
Labels

Comments

@egorponomarev
Copy link

Exoplayer version: 2.9.3
Android OS versions: 4.4.2, 5.1.1
Devices: Samsung Galaxy Grand Prime (Android 5.1.1); Motorola MotoG3 (Android 5.1.1); Motorola RAZR XT907 (Android 4.4.2); Motorola DROID RAZR M (Android 4.4.2)

We are using a static instance of Exoplayer, which can attach to/detach from TextureView (e.g. when the orientation changes). On older Android versions (4.4.2 - 5.1.1) there is an issue: after the surface is reattached and the playback is resumed, the video may freeze for 3-10 seconds while the audio keeps playing, then continues normally.

We were able to reproduce it in the demo app: https://github.com/egorponomarev/Exoplayer-frame-issue-demo

Steps to reproduce in the demo:

  • open the app and wait for the video to start playing;
  • tap on the video to pause it;
  • send the app to background and then bring it back to foreground, or lock and then unlock the screen;
  • tap the video to resume playback.
@tonihei tonihei self-assigned this Feb 4, 2019
@tonihei
Copy link
Collaborator

tonihei commented Feb 4, 2019

We added a way to seamlessly switch surfaces on API levels 23+ (see #677). Unfortunately that's not available for older versions and we need to wait for a new keyframe in the video stream before being able to continue rendering on the new surface.

You can probably try to force the player to reload the stream at the current position (at the cost of extra buffering) by calling player.seekTo(player.getCurrentPosition()) directly after setting the new surface on these devices.

@egorponomarev
Copy link
Author

The "seekTo" solution works fine, thanks for your help.

@tonihei tonihei closed this as completed Feb 5, 2019
@nikunjparadva
Copy link

I have facing same issue and player.seekTo(player.getCurrentPosition()) is not worked for me.
issue scenario:

  • SimpleExoplayer play in Activity A
  • pause playing with player.setPlayWhenReady(false); and intent to Activity B
  • backpress on Activity B and back to Activity A
  • and resume exoplayer with player.setPlayWhenReady(true);

issue :- video frame forward more than 3 seconds, audio is working fine, but video frames forward more than 3 second , and after resuming video, video freez until that frame comes

@google google locked and limited conversation to collaborators Aug 5, 2019
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