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.

Seeking to a negative value makes the ExoPlayer to pause over HLS

See original GitHub issue

Passing a negative value to the player.seekTo() function makes the ExoPlayer puts itself in a “pause” state and it never re-positions the playhead to 0 seconds. Still, we can see that the seek command is executed in the logcat.

To reproduce this we can use the Exo demo app. In the PlayerActivity set a delay of, could be 10 seconds, and then execute a player.seetTo(-3000). Then the video will pause, the current position label will be at -0:00 but the Play/Pause button will stay as playing, and nothing else will happen. There is no error message returned/thrown by the ExoPlayer nor printed in the logcat.

This is only with HLS videos. DASH and SmoothStreaming videos work fine.

Could you take a look, please?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ojw28commented, Sep 10, 2021

This should be fixed by the commit above, which constrains the seek position after it’s resolved to a period position, for which negative values really are always invalid.

0reactions
LuGO0commented, Sep 8, 2021

@ojw28 apart from assertions what could be possible ways to not allowing negative seek for various media types?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exoplayer How to set duration/position manually for live ...
Normally if the broadcast is live, the seek bar is set to right end side and on the left end side live video...
Read more >
Akamai Blog | Enhancing video streaming quality for ExoPlayer
Enhancing Video Streaming Quality for ExoPlayer—Part 1: Quality of User Experience Metrics ... The online video player landscape is fragmented ...
Read more >
1382151 - [Fennec][HLS] Pause ExoPlayer when player is ...
The patch intends to pause the Exoplayer when the player is paused to avoid OOM crash. When pausing, mediaelement allows seeking, so we...
Read more >
Seeking / Playback Rate | AVPro Video - RenderHeads
One safe alternative to adjusting rate is to pause the video and fast seek to simulate a change in playback rate. This approach...
Read more >
Monitor ExoPlayer - Mux Docs
The Mux integration with ExoPlayer is built on top of Mux's core Java SDK, ... Make sure to monitor the player before calling...
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