我自己得到了解决方案,终于!!!!!!
问题:IE9 索引第一个标签,即使我们通过 jQuery 将 src="" 注入标签
解决方案:播放器启动时,将第一个“source”元素的“src”值注入标签。
if(firstTime)
{
$hdVideo.attr('src', videoAttr.src[0]);
firstTime=0;
}
然后编写函数将相应的“source url”注入标签的 src="" 属性...
var hdswipe = function(){
var currVid, currExt, currVidName, currQuality, i;
if($hdVideo.attr('paused')==false)
playerstage=1;
currVid = $hdVideo[0].currentSrc;
currExt = currVid.substr(currVid.lastIndexOf('.') + 1);
for(i=0; i<videoAttr.quality.length; i++) //Get current video quality
if(currVid == videoAttr.src[i])
currQuality=videoAttr.quality[i];
for(i=0; i<videoAttr.quality.length; i++) //Swipe the Video
{
if((currExt==videoAttr.src[i].substr(videoAttr.src[i].lastIndexOf('.') + 1))&&(currQuality!= videoAttr.quality[i]))
{
$hdVideo.attr('src', videoAttr.src[i]);
gPlay();
createSeek();
createBuffer();
playerstage=0;
break;
}
}
if(currQuality == "sd")
$("a.hd-hd-swipe-button").addClass("hd-hd-swipe-button-hd");
else
$("a.hd-hd-swipe-button").removeClass("hd-hd-swipe-button-hd");
return false;
}