0
我试图使用mediaelement.js作为图库或视频交换的图库的一部分,具体取决于您点击的是哪个缩略图。该URL是在这里:http://www.altny.com/portfolio/interactive.html动态创建播放器在IE中不起作用
这里是我的代码(在一个单独的.js文件使用jQuery)
// portfolio image/video swap
$("div.gallery-thumb a.gallery-swap").click(function() {
var newDesc = "<p>" + $(this).attr("title") + "</p>";
var newSource = $(this).attr("href");
if ($(this).attr("rel") == "image") {
var newImage = "url(" + newSource + ")";
$("section#project-image").empty().css("background-image",newImage);
$("section#project-image").prepend(newDesc);
} else if ($(this).attr("rel") == "video") {
// video handling
$("section#project-image").css("background-image","none").empty().prepend("<video id=\"project-player\" src=\"" + newSource + "\" width=\"400\" height=\"270\"></video>");
$("video#project-player").mediaelementplayer();
$("div.mejs-container").css("margin","0 auto");
$("section#project-image").append(newDesc);
}
return false;
});
这是工作在Safari和Firefox,但在IE8无法正常工作(我不现在可以访问7或9)。我是否不正确地使用mediaelement.js?