我正在尝试动态更改页面上的嵌入视频.它在Firefox中工作但由于某种原因它不适用于IE和Chrome(奇怪的组合).这是HTML:
<object id="viewer" width="575" height="344">
<param name="wmode" value="transparent" />
<param name="movie" value="http://www.youtube.com/v/Lmn94kn08Lw&hl=en&fs=1&color1=0x006699&color2=0x54abd6&rel=0" />
<param name="allowFullScreen" value="true" />
<embed id="embeddedPlayer" src="http://www.youtube.com/v/Lmn94kn08Lw&hl=en&fs=1&color1=0x006699&color2=0x54abd6&rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="575" height="344" wmode="transparent"></embed>
</object>
Run Code Online (Sandbox Code Playgroud)
这是我的javascript代码.单击链接以更改视频:
$("#video a").click(
function() {
var videoAddress = $(this).attr("href");
$("#embeddedPlayer").attr("src", videoAddress);
return false; // stop the default link so it just reloads in the video player
}
);
Run Code Online (Sandbox Code Playgroud)
就像我说的那样,视频在Firefox中完美变化,但在IE和Chrome中没有任何反应.有任何想法吗?