question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exoplayer playback failed issue

See original GitHub issue

Our testers found a video file that was getting stuck when seeking to a particular position in the video.

I tested it against the demo application recommended in the template ( http://exoplayer.dev/demo-application.html). I modified the media.exolist.json to just my test file

[
  {
    "name": "Test",
    "samples": [
      {
        "name": "Test media",
        "uri": "file:///storage/emulated/0/Download/01_2x2.mp4"
      }
    ]
  }
]

The issue occurs when seeking to 0:30 in the video. Seeking anywhere else works correctly. The issue was also not reproducible in exoplayer-2.11.x. The media used can be found here:

https://drive.google.com/file/d/1sbirYDNNcn6bpCGhSLCCvxmyUHt_K0DO/view?usp=sharing

I have attached a video where I was able to reproduce the bug:

https://user-images.githubusercontent.com/53452295/110393781-c2ce0800-8030-11eb-8f6f-620db9ee4566.mp4

Error log from my demo app:

2021-03-08 17:12:28.395 15042-15177/com.leia.stereodemo E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:586)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: java.lang.IllegalStateException: Playback stuck buffering and not loading
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1015)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:477)
  • ExoPlayer version number - 2.12.x, 2.13.x, Lastest code in branch release-v2
  • Android version - 11
  • Android device - Pixel 4 XL

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
toniheicommented, Mar 9, 2021

I think this may be working as intended. Your file only has 4 keyframes at samples 0, 250, 500 and 750, which are about 130MB of data apart from each other. So if you seek to just before a keyframe the player needs to load data from the previous keyframe and eventually reaches its default memory limit of 131 MB without having enough media available for playback yet. This is what the exception is detecting. In 2.11. we forced loading more data in such case without any upper limit, that’s why you can’t reproduce in 2.11.

To solve this, you should ideally create the file with more keyframes if it has such a high bitrate, or increase the allowed memory limit in DefaultLoadControl.Builder.setTargetBufferBytes.

1reaction
toniheicommented, Mar 9, 2021

Sorry, I must have missed that!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Playback failed · Issue #10365 · google/ExoPlayer - GitHub
When inspecting the video with mediainfo , the video appears to be interlaced. I don't think Android officially supports interlaced H264 and ...
Read more >
Unable to catch ExoPlaybackException: Source error
No matter what I try, I am not able to catch "ExoPlaybackException: Source error" error. The video playback stops and I can see...
Read more >
How can I reset the exoplayer while playing encountered an ...
google.android.exoplayer2.upstream.exoplayer HttpDataSource$HttpDataSourceException: Unable to connect to https... and I can catch the error in ...
Read more >
ExoPlayer - Android Developers
This guide describes how to use ExoPlayer for playing Android supported ... An app should also show an appropriate error to the user...
Read more >
Load error handling in ExoPlayer - Medium
Assuming the servers serving other qualities are working normally, the app could continue normal playback by blacklisting the failing quality.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found