Video标签学习
来源:互联网 发布:淘宝网上如何退货 编辑:程序博客网 时间:2024/06/07 10:04
截图
通过视频下方的按钮,控制视频的播放,暂停,快进,音量控制等
html
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>video</title> <style> #myvideo { display: block; width: 600px; margin-bottom: 10px; } button { width: 100px; height: 30px; font-size: 1.5em; margin-right: 10px; } #progress { width: 600px; margin-bottom: 10px; } </style></head><body> <video id="myvideo"> <source src="video/section2.mp4" type="video/mp4"> </video> <input type="range" id="progress" min="0" max="100" step="1" value="0"> <br> <button id="play">Play</button> <button id="stop">Stop</button> <button id="ff">ff</button> <button id="fb">fb</button> <input type="range" id="volume" min="0" max="10" step="1"> <br> <script src="test.js"></script></body></html>
js
window.onload = function() { var video = document.querySelector("#myvideo"); var play = document.querySelector("#play"); var stop = document.querySelector("#stop"); var ff = document.querySelector("#ff"); var fb = document.querySelector("#fb"); var progress = document.querySelector("#progress"); var volume = document.querySelector("#volume"); var played = false; play.onclick = function() { if (!played) { video.play(); this.innerText = "Pause"; played = true; } else { video.pause(); this.innerText = "Play"; played = false; } }; stop.onclick = function() { video.currentTime = video.duration; }; ff.onclick = function() { if (video.currentTime <= video.duration) { video.currentTime += 3; } }; fb.onclick = function() { if (video.currentTime >= 0) { video.currentTime -= 3; } }; video.ontimeupdate = function() { progress.value = this.currentTime/this.duration*100; }; progress.onchange = function() { video.currentTime = this.value/100*video.duration; }; volume.onchange = function() { video.volume = this.value/10; };};
0 0
- html5学习 - video标签
- Video标签学习
- 学习html5的video标签
- html5学习笔记1--video标签
- HTML5学习笔记之video标签
- video标签
- video标签
- video标签
- HTML学习3——表单标签,select标签,textarea标签,datalist标签,video标签
- html5的Video和audio标签学习笔记
- H5学习之2 video标签的使用
- 视频播放- video标签
- html5 video视频标签
- html5标签video
- HTML5视频标签video
- HTML5 video标签使用
- video标签调研2
- html5之video标签
- leetcode第三周解题总结(5,7,66)
- Problem B: 平面上的点——Point类 (IV)
- Ubuntu 14.04 caffe 学习系列一,caffe安装only CPU
- 【数据压缩】实验一 YUV转RGB
- OpenCV运行出错:Microsoft C++ 异常: cv::Exception
- Video标签学习
- linq给现有class对象赋值
- Problem C: 平面上的点——Point类 (V)
- 微信小程序调用微信支付
- CppPrimer笔记 Chapter6 函数
- (待解决问题)springMVC连接数据库失败
- oracle中常用连接之我见
- 关于VMware Tool为空的原因
- 由Java反序列化对象异常想到的