Safari is open new window when I play the video

Viewed 61

I create a video tag in javascript and using the canvas to display the video:

const canvas = document.getElementById('canvas');
const ctx2d = canvas.getContext('2d');

const videoElement = document.createElement('video');
videoElement.height = canvas.height;
videoElement.width = canvas.width;
videoElement.playsinline = "playsinline";
videoElement.setAttribute('webkit-playsinline', 'webkit-playsinline');

videoElement.src = '.....';
videoElement.autoplay = false;
videoElement.loop = false;
videoElement.muted = true;

videoElement.addEventListener('play', () => {
  (function loop() {
    if (videoElement && !videoElement.paused && !videoElement.ended) {
            ctx2d.drawImage(videoElement, 0, 0, canvas.width, canvas.height);
            setTimeout(loop, 1000 / 30); // drawing at 30fps
    }
   })();
});

The problem is in my ios device (iphone 11 - safari), when I play the video, ios play the video in new window (fullscreen).

What I need to do to solve that problem? any safari developers here?

This is what I get when I play the video. the fullscreen mode of safari.

enter image description here

0 Answers
Related