Skip to content

Bug: Play event behavior does not match video play event #898

Open
@andrewbrennanfr

Description

@andrewbrennanfr

Is there an existing issue for this?

  • I have searched the existing issues

Which Mux Elements/Packages does this apply to? Select all that apply

mux-video

Which browsers are you using?

Chrome

Which operating systems are you using?

macOS

Description

In your docs, it's mentioned that the Mux player emits all of events available on the HTML5 video element & I would expect the same behaviors between both.

I've experienced 2 cases where there is a misalignment in behavior - both very similar.

The order of events emitted from the player is not the same - which is particularly problematic in the case of an error loading the video.


<mux-video /> => https://stackblitz.com/edit/vitejs-vite-e37ply?file=src%2FApp.vue&terminal=dev
<video /> => https://stackblitz.com/edit/vitejs-vite-mmoxmh?file=src%2FApp.vue&terminal=dev

Reduced test case

https://stackblitz.com/edit/vitejs-vite-e37ply?file=src%2FApp.vue&terminal=dev

Steps to reproduce

✅ Case 1 - A video successfully loads

Order of events for <video /> element

  • Load video player
  • loadedmetadata event is emitted first
  • Then play event is emitted

Order of events for <mux-video /> element

  • Load mux video
  • play event is emitted first
  • Then loadedmetadata event is emitted

❌ Case 2 - A video does not successfully load

Order of events for <video /> element

  • Load video player
  • error event is emitted

Order of events for <mux-video /> element

  • Load mux video
  • play event is emitted (even though the video isn't played)
  • Then error event is emitted

Current Behavior

The play event is always emitted immediately when autoplay is true - even if the video is errored.

The play event is emitted, before the loadedmetadata - which should not be the case.

Expected Behavior

play can & should only be emitted after the video successfully loads - both when autoplay is true & also if the user was to try & play the video before it loaded successfully.

Errors

No response

What version of the package are you using?

v0.17.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions