请问谷歌浏览器是不是所有的API都不支持啊,currentTime和快进功能都无法实现
来源:3-2 currentTime、src、volume、controls
weibo_执著的弧线_0
2019-09-21 18:25:18
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<!-- video 标签 -API- currentTime -->
<video controls src='data/imooc.mp4' id='myVideo'></video>
<button id='playNode'>播放</button>
<button id='stopNode'>暂停</button>
<button id='faster'>快进</button>
<script type="text/javascript">
//选中video标签
var VideoNode = document.getElementById('myVideo');
//currentTime 能返回当前视频的一个播放长度
/*
setInterval(function(){
console.log(VideoNode.currentTime);
},1000);
*/
/* 直接设置视频的播放时间为第30秒 */
VideoNode.currentTime = 30;
/* 快进 */
faster.onclick = function(){
VideoNode.currentTime = VideoNode.currentTime +3;
};
/* 给playNode-div一个暂停video的事件 */
stopNode.onclick = function(){
VideoNode.pause();
};
/* 给playNode-div一个播放video的事件 */
playNode.onclick = function(){
VideoNode.play();
};
</script>
</body>
</html>2回答
同学你好!
这边测试快进和滑动当前时间是没有问题的,同学可以清除下浏览器缓存再测试一下。
如果帮助到了你,欢迎采纳,祝学习愉快~
小仙女要好好学习
2019-09-21
谷歌浏览器都是支持的呀,测试了下你的代码也没有任何问题呀。
相似问题