homepage Welcome to WebmasterWorld Guest from 54.211.97.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Updating an embed tags attribute using AJAX (for WMP)
Updating an embed tags attribute using AJAX (for WMP)
papapet

5+ Year Member



 
Msg#: 3066944 posted 6:44 am on Aug 31, 2006 (gmt 0)

I have spent quite a bit of time on this and I can't get it to work.

Here's the deal. I have embeded a windows media control on a page. It plays an asx file but the controls are hidden. I have created a custom stop button, start button and a volume slider.

Now, in a nutshell I HAVE to use the CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 version of the WM control AND I have to make it work in firefox with the custom buttons. So ,I do not have access to the WM contols event handlers in FFox.

I have the start and stop working using AJAX but the volume is another story.

Here is the control:
<EMBED type="application/x-mplayer2" src="http://www.myweb.com/myplaylist.asx" filename="http://www.myweb.com/myplaylist.asx" showstatusbar="0" showcontrols="0" autostart="true" showdisplay="0" name="player" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&" volume="-200" width="0" height="0"></EMBED>

The initial volume is set to -200. Basically, when a user changes the volume I need to update the volume inside the embed tag using AJAX so not to reload the control.

Here is my Code:
var sound = document.getElementsByTagName('embed');
alert(sound[i_tem].getAttribute('volume') );
sound[i_tem].setAttribute('volume','-900')
alert(sound[i_tem].getAttribute('volume') );

This gets executed when they raise the volume so I am raising it from -200 to -900. The alerts both show as -200 and then as -900 so the value is changing. The problemn is, it has no effect on the volume.

So, is it even possible to modify the embed tag of the WM Control and have it accept the changes and continue playing wihout reloading?

 

papapet

5+ Year Member



 
Msg#: 3066944 posted 8:12 pm on Sep 1, 2006 (gmt 0)

Thanks - I will figure it out myself

Hanu

10+ Year Member



 
Msg#: 3066944 posted 6:52 am on Sep 17, 2006 (gmt 0)

Changing attributes of the embed element after the plugin was loaded is not going to be effective. The plugin has already read the parameters and will not read them again until the page is fully reloaded.

As reloading the page is not an option in AJAX, you have two alternatives: 1) use ActionScript to manipulate the volume from within the SWF file or 2) use the JavaScript scripting interface to the Flash plugin [adobe.com].

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved