player.js
player.js copied to clipboard
`play` event is delayed on video startup
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
- Go to https://player.vimeo.com/api/demo
- Open web inspector, throttle network to 3G
- 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
.
We have noticed issues like this with low bandwidth. Will check your patch, thnx.