Audio State Issues
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!
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!
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
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).
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)
- 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?
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
We do not support that, no. Sorry!