spacehsheep
asked on
Chage swfobject params usign javascript(jquery)
hi experts,
i have a page that contains a flash video player
an i would like to change ideo('medi a/test2.fl v');">chan ge video</a>
any ideas?
i have a page that contains a flash video player
<div id="video-player">
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("media/VideoPlayer_small.swf", "Videoplayer", "299", "168", "10", "#ffffff");
so.addVariable("MMredirectURL",window.location);
so.useExpressInstall('js/detection/expressinstall.swf');
so.setAttribute("redirectUrl","js/detection/noflash.html");
so.addParam("menu","false");
so.addParam("scale","noscale");
so.addParam("quality","high");
so.addParam("allowFullScreen","true");
so.addParam("wmode","transparent");
so.addParam("FlashVars", "videoURL=media/test.flv");
so.write("video-player");
// ]]>
</script>
</div>
an i would like to change
so.addParam("FlashVars", "videoURL=media/test.flv");
to
so.addParam("FlashVars", "videoURL=media/test2.flv");"
dynamically by clicking a link like <a href="#" onlick="javascript:ChangeVany ideas?
You will need to re-load the swf for this to work, unfortunately you cannot change the flashvars and have flash notice that. However you could make a method available to javascript to change the video using ExternalInterface. Have a look at http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html#addCallback%28%29
ASKER
Thanks edchipman for your reply, actually i'm able to change flash vars by removing swfobject from dom and adding a new one to the dom with the help of wonderful plugin http://jquery.thewikies.com/swfobject/
I believe I mentioned this at the beginning of my post "You will need to re-load the swf for this to work"
ASKER
ok i can give points to you but you said "unfortunately you cannot change the flashvars and have flash notice that" and your solution was to change it using ExternalInterface, which totally has no similarity with my solution and didn't help me to solve my problem.
if you think you deserved points i will accept
if you think you deserved points i will accept
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Partially solved my question