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

Not stop playback when SimpleExoPlayerView.setPlayer(null) #2461

Closed
keima opened this issue Feb 16, 2017 · 3 comments
Closed

Not stop playback when SimpleExoPlayerView.setPlayer(null) #2461

keima opened this issue Feb 16, 2017 · 3 comments
Assignees

Comments

@keima
Copy link

keima commented Feb 16, 2017

Thanks for developing very useful library.

A description of the issue.

Not catching STATE_ENDED and not stop and keep moving position (player.getCurrentPosition()'s value) when position is exceeded to MediaSource's duration at specific condition.
(Sorry I'm just trying HlsMediaSource so I don't know other MediaSource)

I doubt that my project has two SimpleExoPlayerView and switch active view ( on the one hand is view#setPlayer(player) , on the other hand is view.setPlayer(null) ).
But I reproduced issue when single SimpleExoPlayerView and setPlayer(null) after setPlayer(player) and prepare/play HLS source.

Steps describing how the issue can be reproduced, ideally in the ExoPlayer demo app.

This issue is not reproduce ExoPlayer demo app.
(demo app doesn't provide setPlayer(null))

I make sample app that able to set player instance and null.
https://github.com/keima/ExoPlayerExample/tree/link/exoplayer-issue-overrun-position

How to reproduce:

  1. Run sample app
  2. Tap [1] Prepare button
  3. Tap [2] setPlayer(player and show controller in SimpleExoPlayerView
  4. Tap play button on SimpleExoPlayerView
  5. (if you bored waiting 30mins, you can seek to about 29min30sec.)
  6. Tap [3] setPlayer(null) before reach to 30min (about 1800000 milliseconds on debug text).
  7. You will looking over-running currentPosition on debug text.

The version of ExoPlayer being used.

r2.2.0 (I occured r2.0.2, but reproduced at latest version).

@AquilesCanta AquilesCanta self-assigned this Feb 16, 2017
@AquilesCanta
Copy link
Contributor

Please, see #2432. Thank you for the thorough report!

keima added a commit to keima/ExoPlayerExample that referenced this issue Feb 17, 2017
@keima
Copy link
Author

keima commented Feb 17, 2017

Thanks suggestion! I fixed this issue.

I write below commit for fix this issue.
Please someone who to have same trouble may check below commit.
keima/ExoPlayerExample@392c748

@keima
Copy link
Author

keima commented Feb 17, 2017

@AquilesCanta
Could you answer a few question?

After investigating my implement above, I realized stream is stop little bit like buffering when setRendererDisabled(index, false) after setRendererDisabled(index, true).
(Not happened when setRendererDisabled(index, true) after false.)

I watching logcat during above situation, AdaptiveMediaSourceEventListener#onLoadStarted() and onLoadCompleted() are called but nothing called ExoPlayer.EventListener#onPlayerStateChanged().

I want to prevent "buffering" ( stop streaming little bit ), are you know any solution, or impossible?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants