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 ...
随机推荐
- 预备作业2 :学习基础和C语言基础调查
剑网三毒经pk心得: 看完标题的你真的没有进错,这里是博客园. 想到写这篇文章的原因一部分是自己的确没啥技能比超过90%以上的人还好,还有一部分是受到了作业提示的指引...... 如果你有类似的技能获 ...
- 【PyQt5-Qt Designer】在GUI中使用pyqtgraph绘图库
pyqtgraph绘图库 1.1 简介: pyqtgraph是Python平台上一种功能强大的2D/3D绘图库,相对于matplotlib库,由于内部实现方式上,使用了高速计算的numpy信号处理库以 ...
- Webpack傻瓜式指南(转)
add by zhj: 作者写了三篇文章,这是第一篇幅,另外两篇参见 https://zhuanlan.zhihu.com/p/20397902 https://zhuanlan.zhihu.com/ ...
- ubuntu windows10 in GPT HDD GRUB Boot
some thing wrong with my input, I can just use English -_-!!! The HDD have two kinds of formart, GP ...
- javascript 实例 静态 公共 私有
传统 javascript 的原型对象 和 ts的类 对比 传统原型队形说明: //对象构造函数 function Atest(name) { //私有属性,只能在对象构造函数内部使用 var cla ...
- css权重计算规则
1.第一等:代表内联样式,如 style=" ",权值为1000: 2.第二等:代表ID选择器,如 #content,权值为0100: 3.第三等:代表类,伪类和属性选择器,如 . ...
- InnoDB Next-Key Lock
InnoDB有三种行锁的算法: 1,Record Lock:单个行记录上的锁 2,Gap Lock:间隙锁,锁定一个范围,但不包括记录本身 3,Next-Key Lock:Record Lock + ...
- css自动换行如何设置?url太长会撑开页面
我们更新文章时如果有引用其他文章一般会带一个原文url,但这个链接如果太长的话会把内容的版块撑开,整个排版乱了.那我们能不能设置css自动换行呢?如下图所示,其实只要两个样式就能搞定 word-wra ...
- dxCameraControl控件(拍照)
拍照演示 主要属性设置 Active:True DeviceIndex:设备号,默认为0 其他方法 procedure Capture; //捕获 procedure Pause; //暂停 proc ...
- LigerUi自动检索输入
var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASI ...