javascript - 是否可以在 html5 视频中嵌入 Action ?

标签 javascript html

有没有办法播放 html5 视频,在视频中的已知点停止并执行 javascript?

最佳答案

是的,试试这个。您必须使用 currentTime 属性。从那里开始并从那里开始你的javascript函数。这就是您要找的吗?

var vid = document.getElementById("video");

//Add a timeupdate listener
video.addEventListener("timeupdate", function(){
    //Check for video properties from within the function
    if (this.currentTime == 5)
        this.pause();
        //cal javascript
    }
}

关于javascript - 是否可以在 html5 视频中嵌入 Action ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41076283/

相关文章:

html - .htaccess 使用别名 url 重定向

java - 将数据从 Bean 传递到 jsf 页面上的 javascript。谷歌 API 说明

javascript - 纯 JavaScript 的多级列表菜单

javascript - 无法在 angularjs 中调用 $http

javascript - 服务器端调试不起作用[Meteor 1.2]

html - 最大高度 : fit-content; not working as expected in Mozilla

html - 无法将颜色填充到我的 svg 文件中

css - 如何使用 CSS 对齐多个 div

javascript - 为什么我的函数没有在谷歌地图的点击事件中被调用?

javascript - 使用 javascript 确定正在使用的浏览器