question

ChanEpic avatar image
ChanEpic asked ·

HLS Playback fails

I've been working with the Fire App builder and thanks for the stellar help from the Amazon Dev support team have gotten pretty much everything working. I have run into an error I am not able to resolve. Specifically with the app failing to play an HLS stream originating from: https://thefloridachannel.org/api/get_schedule/v/2/, the xpath query is pulling the content correctly and HLS playlists from other feeds work well. e.g. content from: http://thefloridachannel.org/videos/feed/ works fine. From Logcat:

05-15 11:57:44.241 27189-27358/com.fireappbuilder.android.thefloridachannel E/ExoPlayerImplInternal: Internal runtime error.
    java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
        at java.util.ArrayList.get(ArrayList.java:308)
        at com.google.android.exoplayer.hls.HlsChunkSource.selectTrack(HlsChunkSource.java:394)
        at com.google.android.exoplayer.hls.HlsChunkSource.prepare(HlsChunkSource.java:301)
        at com.google.android.exoplayer.hls.HlsSampleSource.prepare(HlsSampleSource.java:149)
        at com.google.android.exoplayer.SampleSourceTrackRenderer.doPrepare(SampleSourceTrackRenderer.java:54)
        at com.google.android.exoplayer.TrackRenderer.prepare(TrackRenderer.java:110)
        at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:273)
        at com.google.android.exoplayer.ExoPlayerImplInternal.prepareInternal(ExoPlayerImplInternal.java:264)
        at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:201)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
        at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
05-15 11:57:44.243 27189-27357/com.fireappbuilder.android.thefloridachannel I/ExoPlayerStateMachineImpl: onExoPlayerStateChanged: playWhenReady = false state= STATE_IDLE currentPlayerState (state machine) = Preparing
05-15 11:57:44.252 27189-27357/com.fireappbuilder.android.thefloridachannel E/ExoPlayerStateMachineImpl: exoplayer prepare failed
05-15 11:57:44.252 27189-27357/com.fireappbuilder.android.thefloridachannel I/ExoPlayerStateMachineImpl: dropping change change callback as prev and current state same. state= CLOSING
    Error state enter
    Message handled in initial state. Message what= unknown_msg_what_id=124 msg: { when=-12d4h11m25s114ms what=124 target=com.amazon.mediaplayer.StateMachineUtil.StateMachine$SmHandler }
05-15 11:57:44.255 27189-27189/com.fireappbuilder.android.thefloridachannel E/PlaybackActivity: Media Player error during playback
    java.lang.Throwable: com.google.android.exoplayer.ExoPlaybackException: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
        at com.amazon.mediaplayer.exoplayer.ExoPlayerStateMachineImpl.sendErrorUpdate(ExoPlayerStateMachineImpl.java:1717)
        at com.amazon.mediaplayer.exoplayer.ExoPlayerStateMachineImpl.onPlayerError(ExoPlayerStateMachineImpl.java:2869)
        at com.google.android.exoplayer.ExoPlayerImpl.handleEvent(ExoPlayerImpl.java:253)
        at com.google.android.exoplayer.ExoPlayerImpl$1.handleMessage(ExoPlayerImpl.java:87)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
     Caused by: com.google.android.exoplayer.ExoPlaybackException: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
        at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:246)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
        at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
     Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
        at java.util.ArrayList.get(ArrayList.java:308)
        at com.google.android.exoplayer.hls.HlsChunkSource.selectTrack(HlsChunkSource.java:394)
        at com.google.android.exoplayer.hls.HlsChunkSource.prepare(HlsChunkSource.java:301)
        at com.google.android.exoplayer.hls.HlsSampleSource.prepare(HlsSampleSource.java:149)
        at com.google.android.exoplayer.SampleSourceTrackRenderer.doPrepare(SampleSourceTrackRenderer.java:54)
        at com.google.android.exoplayer.TrackRenderer.prepare(TrackRenderer.java:110)
        at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:273)
        at com.google.android.exoplayer.ExoPlayerImplInternal.prepareInternal(ExoPlayerImplInternal.java:264)
        at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:201)
        at android.os.Handler.dispatchMessage(Handler.java:98) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.os.HandlerThread.run(HandlerThread.java:61) 
        at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
05-15 11:57:44.263 27189-27189/com.fireappbuilder.android.thefloridachannel D/PlaybackActivity: State change event! Oldstate= PREPARING NewState= CLOSING
    State change event! Oldstate= CLOSING NewState= ERROR
05-15 11:57:44.264 27189-27189/com.fireappbuilder.android.thefloridachannel D/MediaSessionHelper: Media session active in setPlayerState, playbackPosition:0
05-15 11:57:44.264 27189-27189/com.fireappbuilder.android.thefloridachannel D/MediaSessionController: current playback state: 7
05-15 11:57:44.264 27189-27189/com.fireappbuilder.android.thefloridachannel E/PlaybackActivity: Player encountered an error!
05-15 11:57:44.304 27189-27189/com.fireappbuilder.android.thefloridachannel D/PlaybackOverlayFragment: setSkipPreviousActionEnabled enabled? false

fire app builder
2 comments
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Looking into it...

0 Likes 0 ·

Levon, good morning. Please see below, I found the answer. Thanks for your help.

0 Likes 0 ·

1 Answer

ChanEpic avatar image
ChanEpic answered ·

I found the problem and it was with our CDN's delivery of the HLS manifest. It was reporting resolutions improperly causing the exo player to fail. The manifest now reports adaptive resolutions and voila, Fire App builder works.

1 comment
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the update ChanEpic, glad it works for you now. Thanks!

0 Likes 0 ·