日期:2014-05-17  浏览次数:20732 次

jsp中嵌入swf视频,在ie下不能动态改变embed中src问题
我要在jsp页面中嵌入多个视频,实现点击按钮,视频自动变换。
现在使用这个方法,但只能在火狐下运行,ie和360都不能运行。
实现点击按钮,标签自动变换。
试过通过每次加载新的embed方法,也是不行。
js这样写的:
function play(url, desc) {
document.getElementById('video1').src=url;
document.getElementById('video1').setAttribute("src",url);
}

页面这样实现的:
<div id="mian1">
<div id="aside" style="margin-left:10px;margin-top:10px; border-right:0px solid #d1d2d2;">
         <ul>
        
         <li style="overflow:hidden"><a href="javascript:play('http://swf.ws.126.net/openplayer/v02/-0-2_M85KB5UHS_M85KDUDPK-vimg1_ws_126_net//image/snapshot_movie/2012/7/U/B/M85KDUQUB-.swf','1">1</a></li>
<li style="overflow:hidden"><a href="javascript:play('http://swf.ws.126.net/openplayer/v02/-0-2_M85KB5UHS_M85M7RDOV-vimg1_ws_126_net//image/snapshot_movie/2013/8/R/N/M95NEMKRN-.swf','2');">2</a></li>
        
         </ul>
        </div>
         <div id="radio_container">
 <embed align="middle" allowScriptAccess="always" allowFullScreen="true" mode="transparent" type="application/x-shockwave-flash" id="video1"   
 src="http://swf.ws.126.net/openplayer/v02/-0-2_M85KB5UHS_M85M7RDOV-vimg1_ws_126_net//image/snapshot_movie/2013/8/R/N/M95NEMKRN-.swf" name="player" volume="100"> </embed></div>
         
        <div id="rside" >
        
        </div>       
       

embed中src问题

------解决方案--------------------
IE FIREFOX 测试没问题


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<div id="mian1">
 <div id="aside" style="margin-left:10px;margin-top:10px; border-right:0px solid #d1d2d2;">
          <ul>
          
         <li style="overflow:hidden"><a href="javascript:play('http://swf.ws.126.net/openplayer/v02/-0-2_M85KB5UHS_M85KDUDPK-vimg1_ws_126_net//image/snapshot_movie/2012/7/U/B/M85KDUQUB-.swf','1');">1</a></li>
 <li style="overflow:hidden"><a href="javascript:play('http://swf.ws.126.net/openplayer/v02/-0-2_M85KB5UHS_M85M7RDOV-vimg1_ws_126_net//image/snapshot_movie/2013/8/R/N/M95NEMKRN-.swf','2');">2</a><