Queue a task to fire an event with the name enterpictureinpicture at the video with its bubbles attribute initialized to true and its pictureInPictureWindow attribute initialized to Picture-in-Picture window.
According to DOM's specs rules for firing an event, you should be. passing the Interface name to use there (i.e., EnterPictureInPictureEvent).
From DOM:
To fire an event named e at target, optionally using an eventConstructor, with a description of how IDL attributes are to be initialized, and a legacy target override flag, run these steps:
So, something more like:
Queue a task to fire an event with the name "enterpictureinpicture", using {{EnterPictureInPictureEvent}}. at the video with its bubbles attribute initialized to true and its pictureInPictureWindow attribute initialized to Picture-in-Picture window.
Just a minor thing, but in:
According to DOM's specs rules for firing an event, you should be. passing the Interface name to use there (i.e.,
EnterPictureInPictureEvent
).From DOM:
So, something more like: