amzn / exoplayer-amazon-port

Official port of ExoPlayer for Amazon devices
Apache License 2.0
173 stars 80 forks source link

Fire TV Stick - 2nd Gen (AFTT) gets stuck in buffering state after seeking #124

Open Koster35 opened 2 years ago

Koster35 commented 2 years ago

ExoPlayer Version

2.17.1

Devices that reproduce the issue

Devices that do not reproduce the issue

Reproducible in the demo app?

No

Reproduction steps

First, it's important to describe how our seekbar implementation works. We setup a listener on our seekbar like this:

        seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
            override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
                // Call Player.seekTo(windowIndex, positionMs)...
            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {
            }

            override fun onStopTrackingTouch(seekBar: SeekBar?) {
            }
        })

So, when the user moves the seekbar forward or back, it results in many successive Player.seekTo(windowIndex, positionMs) calls in a short period of time (multiple calls per second).

With that in mind, here are the steps:

  1. Seek forward or back through a video using repeated Player.seekTo(windowIndex, positionMs) calls.
  2. Observe that the player state changes from STATE_READY to STATE_BUFFERING when seeking starts.

Expected result

Player state changes from STATE_BUFFERING to STATE_READY after seeking completes, allowing playback to proceed.

Actual result

Player state never changes from STATE_BUFFERING after seeking, so the video cannot play further. Seeking again or changing the player's playWhenReady state has no effect, the player still remains stuck buffering.

Media

This can be reproduced with the HLS sample "Apple 16x9 basic stream (TS)" in the demo app: https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8

Bug Report