View Full Version : Windows Media web interface problem

12-16-2006, 10:10 PM
I am creating an embedded Windows Media Player for the web which will have a variety of features useful in our elearning modules. It is supposed to read data from an asx file and use it to generate a menu with buttons, one for each entry in the asx file. I based the scripts on some instructions found on a windows media forum.

To see it working mostly correctly, look at the example link using IE 6 or later.

The example is here:

videowidget (http://thedesignspace.net/videowidget/index.htm)

Then look at it in Firefox 1.5 w/ ActiveX plugin installed. The player starts playing the movie, but does not generate any buttons from the asx file entries. It also does not STOP playing the movie, which it should do as soon as the entry buttons are loaded. And I get no error messages in the console.

I believe the issue has something to do with the speed at which the entries are read in Firefox - in other words a timing problem. There is a function called "loadPlayItems()" which sets the player URL to a given asx file, and then starts the player. Apparently there is a sort of bug in WMP where unless the player has actually started playing, the asx file cannot be read.

function loadPlayItems() {
var pl = WMP9.currentPlaylist;

loadPlayItems() is executed on page load. After the final HTML tag on the page, I have a script which calls "showPlayItems()". This function loops through all the items on the playlist and for each item, generates a div containing text and a mousedown event which should call the correct clip. Finally, after finishing the loop and rendering all the buttons, the player is shut off, awaiting user input.

function showPlayItems() {
var pl = WMP9.currentPlaylist;
var playlistItems=pl.count;
for (i=0; i<playlistItems; i++) {
var oneLink=(' id=\"btn'+ i +'\" class=\"toggle\" onmouseover=\"on(this.id)\" onmouseout=\"off(this.id)\" onmousedown=\"goTo(this.id, '+ i +')\">'+pl.item(i).name);

The complete set of files-there are 4 files total:

to download the complete file set (644K),
Click this link (http://thedesignspace.net/videowidget/example1.zip)

Thanks for any assistance!


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum