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

Audio State Issues #1024

Closed
cyberjaime45 opened this issue Dec 4, 2015 · 7 comments
Closed

Audio State Issues #1024

cyberjaime45 opened this issue Dec 4, 2015 · 7 comments

Comments

@cyberjaime45
Copy link

This library works perfectly, it plays shoutcast and icecast streams. It also plays HLS audio. The problem is that the state does not update for example from ready to idle. If I start the player for the first time the state changes accordingly, however if I get disconnected from the Internet while listening music the state does not change. Still displays "ready". Device used: Nexus 6 - 6.0

Great library!

@ojw28
Copy link
Contributor

ojw28 commented Dec 4, 2015

Does this reproduce in the demo app? Could you specify which stream this occurs with, and how to reproduce (e.g. is going into airplane mode during playback sufficient)? Thanks!

@cyberjaime45
Copy link
Author

Yes this occurs in the demo, since I was testing before incorporating to my project. This occurs with any icecast, shoutcast live steams. For example turning off wifi or simple pause the audio from player control. The stream will stop, and the state will change. Only playWhenReady will update but not playBackState. This will always be ready. if I release the player, then called again preparePlayer, the playBackState will update properly

@ojw28
Copy link
Contributor

ojw28 commented Dec 4, 2015

I tried this in the demo app with a Shoutcast stream and the state transitioned to idle fine for me. This was using the current master branch. Note that transition takes about 5 seconds to occur, whilst a few retries are made to see if the playback can recover.

Please provide more specific reproduction steps (i.e. exactly what stream you're testing with, what version of ExoPlayer + its demo app you're able to reproduce the issue with etc).

@cyberjaime45
Copy link
Author

This is happening with Demo:
When I play I shoutcast stream or any other live stream form SampleChooseActivity, the function onStateChanged, once the audio is playing, the state is"
playWhenReady = true
playbackSate = R

Now when I pause/stop the audio: player.getPlayerControl().pause()

The state changes to:
playWhenReady = false
playbackSate = R

Now when I called the function: releasePlayer() yo stop the audio I get the following error. At this time, onStateChanged function does not get called.

12-06 15:50:57.317 14196-31505/com.google.android.exoplayer.demo W/MessageQueue: Handler (com.google.android.exoplayer.upstream.Loader$LoadTask) {fb132f5} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (com.google.android.exoplayer.upstream.Loader$LoadTask) {fb132f5} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:631)
at android.os.Handler.sendMessageAtTime(Handler.java:600)
at android.os.Handler.sendMessageDelayed(Handler.java:570)
at android.os.Handler.sendEmptyMessageDelayed(Handler.java:534)
at android.os.Handler.sendEmptyMessage(Handler.java:519)
at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:212)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2015

  • It's working as intended that onStateChanged isn't called when the player is released. Once you release the player, you're done and you should not expect any further state change notifications.
  • The error you're seeing is a warning only. In this case it's in no way harmful, and can be safely ignored.

So I think everything is fine here?

@cyberjaime45
Copy link
Author

I see now. Thanks for your help. Great library. Is there a way to get the metadata from icecast and shoutcast stream?
For example: StreamTitle, icy-name, icy-description

@ojw28
Copy link
Contributor

ojw28 commented Dec 8, 2015

We do not support that, no. Sorry!

@ojw28 ojw28 closed this as completed Dec 8, 2015
@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.
Projects
None yet
Development

No branches or pull requests

2 participants