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的更多相关文章

  1. Video Codecs by FOURCC 视频格式编码

    FOURCC Name Summary 1978 A.M.Paredes predictor This is a LossLess video codec. >>> 2VUY 2VU ...

  2. HTML 5 简介、视频、Video + DOM、音频、拖放

    HTML5 是下一代的 HTML. 什么是 HTML5? HTML5 将成为 HTML.XHTML 以及 HTML DOM 的新标准. HTML 的上一个版本诞生于 1999 年.自从那以后,Web ...

  3. 6、USB Video Class Specification

    关于USB Class 将设备归为既定的类别,并对相应类别的设备的在USB协议的应用级协议和接口作出规范,这样只要按照类设备的标准实现驱动程序和设备,则一套驱动可以驱动这一类的所有设备,而这一类设备可 ...

  4. Python应用03 使用PyQT制作视频播放器

    作者:Vamei 出处:http://www.cnblogs.com/vamei 严禁任何形式转载. 最近研究了Python的两个GUI包,Tkinter和PyQT.这两个GUI包的底层分别是Tcl/ ...

  5. linux查看端口及端口详解

    今天现场查看了TCP端口的占用情况,如下图   红色部分是IP,现场那边问我是不是我的程序占用了tcp的链接,,我远程登陆现场查看了一下,这种类型的tcp链接占用了400多个,,后边查了一下资料,说E ...

  6. DirectShow Filter的开发实践

    一.介绍 摄像头图像采集处理在业界有着多种成熟的方案.从老的DirectShow.Grabber技术,到新的Windows Media Foundation框架,网络上都有着丰富的参考资料.OpenC ...

  7. bluetooth service uuid

    转自:https://www.bluetooth.com/specifications/assigned-numbers/service-discovery service discovery ​​​ ...

  8. Linux摄像头驱动学习之:(五)UVC-分析设备描述符

    linux系统上插上USB摄像头设备后,内存就会有相应的设备描述符信息,后期可以根据这些信息进一步写驱动程序. 流程:Device(设备) -> Configuration(配置) -> ...

  9. PyQT制作视频播放器

    Python应用03 使用PyQT制作视频播放器   作者:Vamei 出处:http://www.cnblogs.com/vamei 严禁任何形式转载. 最近研究了Python的两个GUI包,Tki ...

随机推荐

  1. Vue子组件调用父组件的方法

    Vue子组件调用父组件的方法   Vue中子组件调用父组件的方法,这里有三种方法提供参考 第一种方法是直接在子组件中通过this.$parent.event来调用父组件的方法 父组件 <temp ...

  2. Python 标准输出 sys.stdout 重定向(转)

    add by zhj: 其实很少使用sys.stdout,之前django的manage.py命令的源码中使用了sys.stdout和sys.stderr,所以专门查了一下 这两个命令与print的区 ...

  3. 配置svn用户及权限

    权限使用的用户名,必须在passwd文件里面存在,权限配置文件的修改立即生效,不必重启SVN: 例如创建一个运维组 用户组格式: [groups] yunwei = ligang,liming 其中, ...

  4. jmeter测试文件上传接口报错:connection reset by peer: socket write error

    最近在对文件上传接口性能测试时,设置150线程数并发时,总会出现以下错误:connection reset by peer: socket write error 在网上搜索了一下,得到的原因有这些: ...

  5. 虚函数后面的const=0

    const 和 =0要分开理解. 成员函数后面用 const 修饰,const表示this是一个指向常量的指针,即对象成为一个常量,即它的成员不能够变化.(默认情况下,this的类型是指向类类型非常量 ...

  6. root_objectlist, root_object, container_objectlist, container_object 之间的关系。

  7. abap异常处理 , update module

    1:异常 https://www.cnblogs.com/rainysblog/p/6665455.html 2:update module https://www.cnblogs.com/cindy ...

  8. IOT-SpringBoot-angular启动

    1  D:\workspace_iot\iot-hub\src\main\angular     cmd 启动  npm  start 2  eclipse中启动springboot 3  local ...

  9. Java通过POI生成Excel

    import java.io.FileOutputStream; import java.text.SimpleDateFormat; import java.util.ArrayList; impo ...

  10. 【UML】-NO.43.EBook.5.UML.1.003-【UML 大战需求分析】- 状态机图(State Machine Diagram)

    1.0.0 Summary Tittle:[UML]-NO.43.EBook.1.UML.1.003-[UML 大战需求分析]- 状态机图(State Machine Diagram) Style:D ...