jeudi 26 août 2021

enterpictureinpicture event doesn't fire on first run

I have a video element and trying to listen "enterpictureinpicture" event (ios safari). The event doesn't fire when user first enters the Picture in Picture mode. After first time everything works. This only happens on autoplay. If I interact with the video (pause, mute etc.) the event fires on first time. It also works when it isn't autoplay.

example code:

const videoElement = getVideoElement();
videoElement.addEventListener('enterpictureinpicture', () => {
  console.log('user has entered picture in picture')
})



Aucun commentaire:

Enregistrer un commentaire