Welcome to WebmasterWorld Guest from 50.16.126.107

Forum Moderators: open

Message Too Old, No Replies

Updating an embed tags attribute using AJAX (for WMP)

Updating an embed tags attribute using AJAX (for WMP)

     
6:44 am on Aug 31, 2006 (gmt 0)

New User

10+ Year Member

joined:Aug 22, 2006
posts:4
votes: 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?

8:12 pm on Sept 1, 2006 (gmt 0)

New User

10+ Year Member

joined:Aug 22, 2006
posts:4
votes: 0


Thanks - I will figure it out myself
6:52 am on Sept 17, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 8, 2003
posts:548
votes: 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].

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members