Video events HTML5 jQuery

白昼怎懂夜的黑 提交于 2021-02-06 08:39:34

问题


Is it possible to get the video events using HTML5 and jQuery?

Events like:

  1. When the user start the video, get that event.
  2. When the user paused/stopped the video, get the time of the played video and remaining time to be played.
  3. When the video is played or not or not played because of error.

回答1:


You can find the events here: http://www.w3.org/2010/05/video/mediaevents.html

Example:

$("video").on("pause", function (e) {
  console.debug("Video paused. Current time of videoplay: " + e.target.currentTime );
});


来源:https://stackoverflow.com/questions/13557306/video-events-html5-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!