欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

视频播放页php,html jquery简易视频播放器

发布时间:2025/4/16 63 豆豆
生活随笔 收集整理的这篇文章主要介绍了 视频播放页php,html jquery简易视频播放器 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

html jquery js 简易视频播放器 直接上代码:html>

Document

#durationbar{

width: 500px;

height: 20px;

}

#durationbar progress{

width: 100%;

height: 100%;

}

总时长:00:00:00  当前时长:00:00:00

开始

停止

2倍速度

function test(time_distance){

// 天时分秒换算

/*var int_day = Math.floor(time_distance/86400000)

time_distance -= int_day * 86400000; */

var int_hour = Math.floor(time_distance/3600)

time_distance = time_distance - int_hour * 3600;

var int_minute = Math.floor(time_distance/60)

time_distance = time_distance - int_minute * 60;

var int_second = Math.floor(time_distance)

// 时分秒为单数时、前面加零

/*if(int_day 

int_day = "0" + int_day;

} */

if(int_hour 

int_hour = "0" + int_hour;

}

if(int_minute 

int_minute = "0" + int_minute;

}

if(int_second 

int_second = "0" + int_second;

}

return int_hour+':'+int_minute+':'+int_second;

}

window.οnlοad=function(){

var oStart = document.getElementById('start');

var oEnd = document.getElementById('end');

var oPause = document.getElementById('pause');

var oSpeed = document.getElementById('speed');

var oVideo = document.getElementById('videoSource');

// 开始函数

oStart.οnclick=function(e){

console.log(oVideo.paused);

if(oVideo.paused==true){

$('#start').text('暂停');

oVideo.play();

}else{

$('#start').text('播放');

oVideo.pause();

}

}

// 暂停函数

/*oPause.οnclick=function(){

oVideo.pause();

} */

// 停止函数

oEnd.οnclick=function(){

oVideo.pause();

oVideo.currentTime=0;

}

// 加速函数

oSpeed.οnclick=function(){

oVideo.play();oVideo.playbackRate = 1.5;//注意这里速度大于4的时候,就没有声音了,声音得不到同步

}

var aa = test(oVideo.duration);

$("#zsc").text(aa);

//oVideo.currentTime=30;

var i = 0;

// 这个事件是在视频播放中一直执行的事件

oVideo.οntimeupdate=function(){

var oPositionBar = document.getElementById('positionBar');

oPositionBar.value= (oVideo.currentTime/oVideo.duration*100);

console.log('播放时长:'+oVideo.duration);

console.log('播放进度:'+oVideo.currentTime);

var bb = test(parseInt(oVideo.currentTime));

$("#dqsc").text(bb);

/*if(parseInt(oVideo.currentTime)==3 && i==0){

oVideo.pause();

i++;

alert("观看超市");

location.href='http://www.baidu.com';

}*/

}

}

html jquery js 简易视频播放器   快试试吧!

总结

以上是生活随笔为你收集整理的视频播放页php,html jquery简易视频播放器的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。