js 行: 176 错误: 'currentMedia.duration' 为空或不是对象 红色代码为176行

心灵彩虹 心灵彩虹 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<!--
var isPorV = 0;
var fFlag= false;

//drag func
var pFlag = false;
var pZoneWidth = 129;
var infoChange = 1;

var bufferingProgress;
var downloadProgress;
var bitRate;
var currentPositionString;
var mediaTitle;
var itemTitle;
var mediaInfo;

function getOLeft(myObj){
curObj = myObj;
var objLT = curObj.offsetLeft;
while(curObj!=curObj.offsetParent && curObj.offsetParent) {
curObj=curObj.offsetParent;
if(curObj.tagName=="DIV") {
objLT += curObj.offsetLeft;
}
}
return objLT;
}

//truncation string
function trunStr(str) {
if (str.length > 35){
return str.substr(0,35) + "...";
}
else{
return str;
}
}

function toPlay() {
if ($("MediaPlayer").playState != 3) {
if ($("MediaPlayer").controls.isAvailable('Play')) {
$("MediaPlayer").controls.play();
$("Play").src="mediaplayer/lightblue/p_play1.gif";
toDisplay(1);
}
}
else {
toPause();
}
}

function toPause() {
if ($("MediaPlayer").currentMedia.duration > 0) {
infoChange = 1;
$("MediaPlayer").controls.Pause();
$("Play").src="mediaplayer/lightblue/p_play.gif";
}
}

function toStop() {
if ($("MediaPlayer").currentMedia.duration > 0) {
$("MediaPlayer").controls.Stop();
$("Play").src="mediaplayer/lightblue/p_play.gif";
toDisplay(0);
}
}

function toScreen(){
$("MediaPlayer").fullScreen=1;
}

function toMute(){
if($("MediaPlayer").settings.mute){
$("MediaPlayer").settings.mute = false;
$('Mute').src='mediaplayer/lightblue/p_mute.gif';
}
else{
$("MediaPlayer").settings.mute = true;
$('Mute').src='mediaplayer/lightblue/p_mute1.gif';
}
}

function toDisplay(v){
var P=$("playzone").getElementsByTagName("div");
if(v){
P[0].style.display='none';
P[1].style.display='block';
}
else{
P[1].style.display='none';
P[0].style.display='block';
}
}

function mouseDown(objSign) {
isPorV = objSign;
if(isPorV == 0) {
if($("MediaPlayer").currentMedia.duration > 0) {
pFlag = true;
if(window.event.srcElement.id!="pZone") {
$("pBox").style.left = $("pBox").offsetLeft -1;
}
else {
$("pBox").style.left = window.event.x;
}
}
}
else if (isPorV == 1) {
vFlag = true;
//alert($("vBox").offsetLeft);
if(window.event.srcElement.id!="vZone") {
$("vBox").style.left = $("vBox").offsetLeft;
}
else {
$("vBox").style.left = window.event.x;
}
}
}

function mouseMove() {
if(isPorV == 0) {
if($("MediaPlayer").currentMedia.duration > 0) {
if (pFlag)
$("pBox").style.left = window.event.clientX - getOLeft($("pZone")) - 12 +"px";
if (parseInt($("pBox").style.left.replace("px","")) > pZoneWidth)
$("pBox").style.left=pZoneWidth +"px";
if (parseInt($("pBox").style.left.replace("px","")) < -5)
$("pBox").style.left=-5 +"px";
}
} else if (isPorV == 1) {
if(vFlag) $("vBox").style.left = window.event.clientX - getOLeft($("vZone")) - 4 +"px";
if (parseInt($("vBox").style.left.replace("px","")) > 46) $("vBox").style.left = 44 +"px";
if (parseInt($("vBox").style.left.replace("px","")) < 1) $("vBox").style.left = 1 +"px";

if(isPorV==1) {
if (vFlag){
tempVol = (parseInt($("vBox").style.left) - 4)*5.9;
$("MediaPlayer").settings.volume=Math.round(tempVol);
$("MediaPlayer").settings.mute = false;
$('Mute').src='mediaplayer/lightblue/p_mute.gif';
}
}
}
}

function mouseUp() {
if (isPorV == 0) {
if($("MediaPlayer").currentMedia.duration > 0) {
if (pFlag) {
var duration = $("MediaPlayer").currentMedia.duration;
$("MediaPlayer").controls.CurrentPosition=duration * (parseInt($("pBox").style.left)/pZoneWidth);
}
pFlag = false;
}
} else if (isPorV == 1) {
if (vFlag) {
tempVol = (parseInt($("vBox").style.left) -9)*1.7;
$("MediaPlayer").settings.volume=Math.round(tempVol);
}
vFlag = false;
}
}

function mouseEnd() {
window.event.returnValue = false;
}

function OnloadFun() {
mediaInfo = $("mediaInfo");
startdrag();
setInterval("FixPos()", 1000);
}

function startdrag() {
if($("MediaPlayer").currentMedia.duration||(!isNaN($("MediaPlayer").currentMedia.duration))) {
window.document.onmousemove = mouseMove;
window.document.ondragstart = mouseEnd;
window.document.onmouseup = mouseUp;
}
}

function FixPos() {
if ($("MediaPlayer").currentMedia.duration > 0) {
var duration = $("MediaPlayer").currentMedia.duration;
var pos = $("MediaPlayer").controls.CurrentPosition;
if (pos == 0) {
var pBoxPos = Math.round(pos/duration*pZoneWidth)+1;
} else {
var pBoxPos = Math.round(pos/duration*pZoneWidth)+1;
}

if (!isNaN(pBoxPos)) {
$("pBox").style.left = pBoxPos;
}

if($("MediaPlayer").playState == 1) {
$("pBox").style.left = 1;
mediaInfo.innerHTML="<a href='mailto:haixiao_yao@yahoo.com.cn' class='cWhite' target='_blank'>�޲��ع�����</a>�����춼���ʣ�";
$("Play").src="mediaplayer/lightblue/p_play.gif";
toDisplay(0);
}

bufferingProgress = $("MediaPlayer").network.bufferingProgress;
downloadProgress = parseInt($("MediaPlayer").network.downloadProgress);
bitRate = $("MediaPlayer").network.bitRate;
currentPositionString = $("MediaPlayer").Controls.currentPositionString;
mediaTitle = $("MediaPlayer").currentPlaylist.item(0).getItemInfo("Title");
itemTitle = $("MediaPlayer").currentPlaylist.getItemInfo("Title");
$("mediaTime").innerText =' '+ currentPositionString.toString();

switch($("MediaPlayer").playState) {
case 7: {
mediaInfo.innerText="����";
}
break;

case 6: {
if ( parseInt(bufferingProgress) > 0 && parseInt(bufferingProgress) < 100 ) {
mediaInfo.innerText="����:���� "+bufferingProgress.toString()+"%";
} else {
mediaInfo.innerText="����";
}
}
break;

case 3: {
if ( downloadProgress == 0 ) {
mediaInfo.innerText="���ڲ���"; }
showPlayInfo();
}
break;
}
}
}

function showPlayInfo() {
if ( infoChange ==1 ) {
if ( downloadProgress < 100 ) {
mediaInfo.innerText="���ڲ���: "+downloadProgress.toString()+"% ������";
}
else {
mediaInfo.innerText="���ڲ���: "+Math.round(bitRate/1000)+" ǧ����/��";
}

if ( downloadProgress == 0 ) {
mediaInfo.innerText="���ڲ���";
}
}

if ( infoChange ==4 ) {
mediaInfo.innerText="����:"+itemTitle.toString();
}

if ( infoChange ==8 ) {
mediaInfo.innerText="����: "+trunStr(mediaTitle).toString();
}

if ( infoChange < 11 ) {
infoChange += 1;
}
else {
infoChange = 1;
}
}

setOnloadEvent(OnloadFun);
...全文

相关推荐

js注册表单错误输入框红色圆角提示效果

类似这种注册页面,国外已经很普遍了,只是国内的还比较少。火狐浏览器下,提示框为圆形渐隐渐现效果,IE浏览器下则差一点儿,为长方形效果

weixin_38654382

Vue,JS判断数组中的对象的每一个值不能为空,判断数组中的每一层对象的某一个字段属性值不能为空或其他条件

Vue,JS判断数组中包含的每一层对象的某一个属性值不能为空或者其他 终极大法:就是用every,some遍历数组,区别:every只要有一项不满足条件都返回false some有一项满足都会返回true 这种操作一般用来操作列表,提交数据时需要判断某一个字段不能为空等条件 此次案例:在点击最下方的提交时,需要判断红色框内的每一个分数不能为空 方法一:使用every()函数,此函数不怎么常用,想要了解更多请自查 注:其实判断这种列表中的数组,用for循环也可以,但是最终的效果是判断数组中的对象,只提示一个

HuiRonmantic

IDEA maven依赖错误中包下面红色波浪线

主要介绍了IDEA maven依赖错误中包下面红色波浪线,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

weixin_38644233

jq非空验证,js正则表达式验证邮箱和手机号码

jq非空验证,为空的时候input后面加红色字体的用户名不能为空。 js正则表达式验证邮箱和手机号码,验证邮箱必须含有@符,手机号码必须1开头并且固定11个字符

fatesgo

javascript css红色经典选项卡效果实现代码

主要为大家详细介绍了javascript css红色经典选项卡效果的实现代码,需要的朋友可以参考下

weixin_38571603
评论 5
收藏 已收藏
分享
返回顶部
心灵彩虹
.NET社区 62,273 成员 668,968 内容