video control

function VideoControls(option){
this.id = option.videoId;
this.videoId = document.getElementsByTagName(option.videoId)[0];
this.prismplayer = option.prismplayer;
this.controls = $(".controls");
this.initData = {
playImage:"url('../../images/wx/experience/play.png')",
pauseImage:"url('../../images/wx/experience/pause.png')"
};
}
VideoControls.prototype = {
play:false,
allTime:"",
init:function(option){
this.allTimeFunction(option.time);
this.range();
this.click();
},
click:function(){
var self = this;
$("#playpausebtn").on("click",function(e){
e.stopPropagation();
self.playBtn($(this));
});
$("#fullscreenbtn").on("click",function(){
self.fullScreen();
});
},
timeIntel:function(time){
var mTime = Math.floor((time / 60));
var sTime = parseInt(time % 60);
var m = mTime > 9 ? mTime : "0" + mTime;
var s = sTime > 9 ? sTime : "0" + sTime;
return m + ":" + s;
},
currentTime:function(time){
$("#currentTime").html(this.timeIntel(time));
},
allTimeFunction:function(data){
var vallTime = data;
$("#allTime").html(this.timeIntel(vallTime));
this.allTime = vallTime;
},
range:function(time){
var self = this;
$("#seekslider").on("change",function(){
var val = ($(this).val() / 100) * self.allTime;
self.videoId.currentTime = val;
self.currentTime(val);
});
if(time){
$("#seekslider").val((time / self.allTime) * 100);
}
},
playBtn:function(self){
self = self || $("#playpausebtn");
var bgImg;
if(this.play){
bgImg = this.initData.playImage;
this.prismplayer.pause();
}else{
bgImg = this.initData.pauseImage;
this.prismplayer.play();
}
self.css({
"backgroundImage":bgImg
});
this.play = !this.play;
this.changeStatus();
},
changeStatus:function(){
var controls = this.controls;
controls.removeClass("controlshide");
setTimeout(function(){
controls.addClass("controlshide");
},1500);
},
fullScreen:function(){
// moboile will bug , TODO
//$(this.id).removeAttr("webkit-playsinline").removeAttr("playsinline").attr("x5-video-player-fullscreen","true");
if(this.videoId.requestFullScreen){
alert(1)
this.videoId.requestFullScreen();
} else if(this.videoId.webkitRequestFullScreen){
alert(2)
this.videoId.webkitRequestFullScreen();
} else if(this.videoId.mozRequestFullScreen){
alert(3)
this.videoId.mozRequestFullScreen();
}else{
alert(0)
}
},
timeupdate:function(time){
this.currentTime(time);
this.range(time);
}
};
video control的更多相关文章
- Video Codecs by FOURCC 视频格式编码
FOURCC Name Summary 1978 A.M.Paredes predictor This is a LossLess video codec. >>> 2VUY 2VU ...
- HTML 5 简介、视频、Video + DOM、音频、拖放
HTML5 是下一代的 HTML. 什么是 HTML5? HTML5 将成为 HTML.XHTML 以及 HTML DOM 的新标准. HTML 的上一个版本诞生于 1999 年.自从那以后,Web ...
- 6、USB Video Class Specification
关于USB Class 将设备归为既定的类别,并对相应类别的设备的在USB协议的应用级协议和接口作出规范,这样只要按照类设备的标准实现驱动程序和设备,则一套驱动可以驱动这一类的所有设备,而这一类设备可 ...
- Python应用03 使用PyQT制作视频播放器
作者:Vamei 出处:http://www.cnblogs.com/vamei 严禁任何形式转载. 最近研究了Python的两个GUI包,Tkinter和PyQT.这两个GUI包的底层分别是Tcl/ ...
- linux查看端口及端口详解
今天现场查看了TCP端口的占用情况,如下图 红色部分是IP,现场那边问我是不是我的程序占用了tcp的链接,,我远程登陆现场查看了一下,这种类型的tcp链接占用了400多个,,后边查了一下资料,说E ...
- DirectShow Filter的开发实践
一.介绍 摄像头图像采集处理在业界有着多种成熟的方案.从老的DirectShow.Grabber技术,到新的Windows Media Foundation框架,网络上都有着丰富的参考资料.OpenC ...
- bluetooth service uuid
转自:https://www.bluetooth.com/specifications/assigned-numbers/service-discovery service discovery ...
- Linux摄像头驱动学习之:(五)UVC-分析设备描述符
linux系统上插上USB摄像头设备后,内存就会有相应的设备描述符信息,后期可以根据这些信息进一步写驱动程序. 流程:Device(设备) -> Configuration(配置) -> ...
- PyQT制作视频播放器
Python应用03 使用PyQT制作视频播放器 作者:Vamei 出处:http://www.cnblogs.com/vamei 严禁任何形式转载. 最近研究了Python的两个GUI包,Tki ...
随机推荐
- 【PyQt5-Qt Designer】工具箱(QToolBox)用法讲解
QToolBox() 实现抽屉效果 总体介绍: QToolBox类提供了一列选项卡的小部件(选项卡内含项目). 工具箱是一个小部件,它将选项卡一个一个的显示,当前项目显示在当前选项卡下方.每个选项卡在 ...
- oracle中并行执行不一定比串行执行快
并行执行与串行执行相比,能否缩短执行时间,取决于如下几个方面:1.待执行的目标SQL是否适合并行执行,有些SQL是不太适合并行执行的,比如走索引的嵌套循环连接.2.数据库服务器上的硬件资源(如CPU. ...
- 【Python】脚本运行报错:IndentationError: unindent does not match any outer indentation level
[问题] 一个python脚本,本来都运行好好的,然后写了几行代码,而且也都确保每行都对齐了,但是运行的时候,却出现语法错误: IndentationError: unindent does not ...
- what's the python之可迭代对象、迭代器与生成器(附面试题)
可迭代对象 字符串.列表.元祖.集合.字典都是可迭代的,数字是不可迭代的.(可以用for循环遍历取出内部元素的就是可迭代的) 如何查看一个变量是否为可迭代: from collections impo ...
- CentOS 7 :Failed to start IPv4 firewall with iptables.
用iptables开启防火墙报错: Failed to start IPv4 firewall with iptables. 转载于:https://blog.csdn.net/ls1645/art ...
- TCP接收缓存大小的手动调整
给出了几个可调节的参数,它们可以帮助您提高 Linux TCP/IP 栈的性能. 表 1. TCP/IP 栈性能使用的可调节内核参数 可调节的参数 默认值 选项说明 /proc/sys/net/cor ...
- javascript封装animate动画
面向对象式: Element.prototype.animate=animate; Element.prototype.getStyle=getStyle; function animate(json ...
- [js]js的表单验证onsubmit方法
http://uule.iteye.com/blog/2183622 表单验证类 <form class="form" method="post" id= ...
- 【Java】-NO.16.EBook.4.Java.1.002-【疯狂Java讲义第3版 李刚】- 数据类型
1.0.0 Summary Tittle:[Java]-NO.16.EBook.4.Java.1.002-[疯狂Java讲义第3版 李刚]- 数据类型 Style:EBook Series:Java ...
- git push 提交某一个commit
(以下情况是我们的一位开发小哥哥遇到了提交失败,来找我,我给他解决的过程,以前我也没遇到,所以记录下来) 我们会遇到这样的情况,在develop分支上,第一天修改的文件,已经执行了git commit ...