player icon indicating copy to clipboard operation
player copied to clipboard

Cancelling onMediaSeekRequest does not reset TimeSlider when paused

Open elbotho opened this issue 1 year ago • 1 comments

Current Behavior:

It seems both ways of canceling the onMediaSeekRequest from the Docs functionally work but the Thumb still moves to the seeked position. When the player is playing this is not really a problem since the Thumb positions updates immediately after. But when paused the TimeSlider indicates a position that does not correspond with the currentTime of the player.

Expected Behavior:

When canceling onMediaSeekRequest the TimeSlider should reset to the (actual) position before the cancelled seek.

Steps To Reproduce:

Code to reproduce looks something like this

<MediaPlayer […] onMediaSeekRequest={(time, nativeEvent) => nativeEvent.preventDefault((}>…</MediaPlayer>

With a paused player drag & drop the Thumb to any position.

Reproduction Link: [How to create a repro?][repro]

Sorry, the example Stackblitz examples are broken for me and do not load the media. (But this would probably be the example here)

Environment:

Example:

  • Framework: React
  • Meta Framework: Next.js
  • Node: 20.12.1
  • Device: older MacBook
  • Browser: Chrome@latest -->

Anything Else?

Expected (when playing): expected

Buggy (when paused): buggy-when-paused

elbotho avatar Sep 27 '24 13:09 elbotho

sidenote: it's not nice, but this workaround improves the behaviour :)

if (player.paused) {
  void player.play().then(() => player.pause())
}

elbotho avatar Oct 04 '24 11:10 elbotho