开发者

Canvas superimposed over video in IOS safari

开发者 https://www.devze.com 2023-03-01 14:42 出处:网络
Can you superimpose canvas over video in IOS safari (IPAD)? I tried adding text to the canvas but it does not show up on top of the video playing.

Can you superimpose canvas over video in IOS safari (IPAD)? I tried adding text to the canvas but it does not show up on top of the video playing.

ON SAfari desktop it just works fine.开发者_Go百科

video_dom.addEventListener('play', function() {

        ctx_overlay.font = "bold 16px sans-serif";
        ctx_overlay.fillStyle="black"; 
        ctx_overlay.fillText("Video1 Video1 Video1", 200, 225);

}, false);

<video id="video-canvas-fancy"   loop autoplay loop height="640" width="965" style="position:absolute; top: 5; left: 5;"> 
<source src="http://severe-fire-901.heroku.com/videos/home.m3u8"> 
</video>
<canvas id="canvas-overlay" height="640" width="965" style="position:absolute; top: 10; left: 10;">
</canvas>


Please give more details or a code example in the future.

You mean <video>? With absolute positioning you should be able to put anything over it.

If you can't for some (buggy) reason on IOS, you can always use a <canvas> to render the video (call context.drawImage(video,0,0) every x frames per second) and then either render stuff on top of that or on top of a second canvas.

0

精彩评论

暂无评论...
验证码 换一张
取 消