HTML5:在带有控件的视频上放置画布 [英] HTML5: Placing a canvas on a video with controls

查看:233
本文介绍了HTML5:在带有控件的视频上放置画布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在HTML5视频上画东西。为此,我试图在HTML5视频元素上放置一个画布。

I want to draw things on HTML5 video. For that I am trying to place a canvas on the HTML5 video element.

但是,当我将画布放在视频元素上时,视频控件不起作用。由于画布获取所有鼠标悬停和点击事件。有没有办法将事件委托给视频控件或在其他地方显示控件?

But there is a problem when I place the canvas on the video element the video controls do not work. Since canvas getting all the mouseover and click events. Is there a way to delegate the events to video controls or show the controls in somewhere else?

任何帮助/想法都会很棒。

Any help/idea would be great.

推荐答案

你应该做的是实现你自己的控件(或者使用现有的设置,比如 videojs

您可以阅读我对这个问题的回答: Html5视频叠加架构

What you should do is implement your own controls (or use an existing set such as videojs)
You can read my answer to this question: Html5 video overlay architecture

这篇关于HTML5:在带有控件的视频上放置画布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆