以下是源码,希望得到大神解答,我就是想格外增加一个显示视频播放时间的,但是不知怎么敲代码,希望大神帮忙看看,谢谢了!<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>media3</title></head><body> <video id="myVideo" width="800" height="600" currentTime = 0;> <source src="https://s3.amazonaws.com/distill-videos/videos/processed/1716/Northernlights2_HD.mp4.mp4" type="video/mp4"> 瀏覽器不支援標籤 </video> <br> 方法 <br> <button id="play_btn">play</button> <button id="pause_btn">pause</button> <button id="stop_btn">stop</button> <button id="load_btn">load</button> <script> var myMedia = document.getElementById("myVideo"); document.querySelector("#play_btn").onclick = function(){ myMedia.play(); } document.querySelector("#pause_btn").onclick = function(){ myMedia.pause(); } document.querySelector("#stop_btn").onclick = function(){ myMedia.pause(); myMedia.currentTime = 0; } document.querySelector("#load_btn").onclick = function(){ myMedia.load(); } </script></body></html>
添加回答
举报
0/150
提交
取消