player.js icon indicating copy to clipboard operation
player.js copied to clipboard

`play` event is delayed on video startup

Open luwes opened this issue 3 years ago • 1 comments

Expected Behavior

When using MediaSource that the play event is fired quickly after calling the play() method on the API or when the user clicks the play button in the player.

Actual Behavior

The play event is fired after a delay. It's preloading segments first it looks like, when that is resolved play and playing is fired right after each other. I patched it here to get a correct video startup time in the benchmark, https://github.com/playerxo/playerx/blob/26603717fa7fa99cd8b9a59d8e095abf81fea54d/src/playerx/video-shim.js#L79-L87

Steps to Reproduce

  1. Go to https://player.vimeo.com/api/demo
  2. Open web inspector, throttle network to 3G
  3. Start playback and check the event logs, play event is only fired after the video started playing.

The play event should ideally be fired before bufferstart.

luwes avatar Dec 02 '21 03:12 luwes

We have noticed issues like this with low bandwidth. Will check your patch, thnx.

vidiot1969 avatar Dec 03 '21 20:12 vidiot1969