Welcome to MSDN Blogs Sign in | Join | Help

Eric Anderson's Blog

A dollop of all things Media (Center | Extender | Player)
Windows Media Player on Firefox

Alright, you can all breathe a collective sigh of relief as I am actually posting a blog entry. The delayed posting I think is worth it: today we are releasing a new Firefox plug-in for WMP! We’ve been tracking the issues in the forums about WMP showing some odd aspect ratio issues, as well as other bugs under Firefox, and we decided to tackle the problem and write a new plug-in to get this working again. Apologies to all for how long it took and the relative quietness we’ve had on this front – we’ve been heads-down getting Vista shipped and then directly afterwards we started working on this plug-in.

There is an existing Netscape plug-in out there, but we recommend that people use our new plug-in when developing web sites that use the WMP OCX. In a nutshell, here’s what we did with the new one:

  • New robust design that addresses all of the known issues with the old plug-in
  • WMP will now work in Firefox in Windows Vista
  • Support for the WMP OCX scripting interfaces

The plug-in has been scoped to support a subset of the 6.4 design time parameters, so existing sites that want to use the new plug-in may need to update some of their HTML tags. If you use the plug-ins new MIME type though, you can take advantage of fuller design time parameter support, based on 9.0 interfaces. We will have the MSDN documentation updated to reflect the supported tags/elements in the near future. In the meantime, if you want to start using the new plug-in, you can force your sites to use it by using the new application/x-ms-wmp MIME type.

Feel free to leave any feedback on the plug-in here, or contact me with further questions.

Posted: Monday, April 16, 2007 11:09 PM by errand

Comments

Rossman said:

I've put together a quick HOWTO on how to use this new Windows Media Player plugin for Firefox.

Feel free to check it out at:

http://www.therossman.org/experiments/wmp_play.html

It also shows that you can z-index with Flash content now, and shows a flash UI scripting the WMP in both Firefox and IE.

Cheers,

Rossman

# April 21, 2007 4:31 PM

errand said:

Thanks for that sample, Rossman!

# May 23, 2007 10:34 AM

jaus said:

With this new plugin I have been able to embed WMP in Firefox, and it plays an audio ok, but Im not able to get it to respond to scripting events in the .wma file, like highlighting html text at specified moments during the audio. This happens fine in IE.

Does anyone know a site with sample code that shows how (if its yet possible) to script for this in Firefox also?

# June 2, 2007 11:32 PM

errand said:

Hey Jaus,

Can you send me mail through this blog (Contact Me) and I'll send you preliminary documentation on the plug-in that shows which scripting events are supported in the plug-in.

Thanks,

Eric

# June 4, 2007 7:48 PM

ssssssssssss said:

Hi, I'm really interested in how to migrating it to the xulrunner platform.

Could you give me some suggestions?

Thanks a lot!

# November 10, 2007 4:47 AM

Rick75230 said:

This does work with FireFox.  However, with WinXP and WMP 10 MSIE does not recognize the application/x-ms-wmp MIME type and shows the "image missing" indicator.

You can nest the OBJECT tags and use type="application/x-ms-wmp" for one OBJECT tag and "video/x-ms-wmv" for the other.  FireFox will ignore the "video" tag and work correctly.  IE, of course, will show the "image missing" tag for one and then show the video for the other.

# May 24, 2008 6:44 PM

Rick75230 said:

I *FINALLY* got it.  This page explains the details, including sample code. It is not a bug. The various video pages on the site use this techique.

www.messianicworship.com/html/faq-firefox_resize.html

Rick Reinckens

# May 26, 2008 4:23 PM

PaulMolloy said:

I don't know if this blog is still active, but I'm trying to use your plug-in and I've got problems.

I've been through the documentation here;

http://msdn.microsoft.com/en-us/library/bb614511(VS.85).aspx

but most of the parameters are ignored by firefox.

There is also no response to any attempts to manipulate it by javascript (e.g. stop and play functions).

Has something changed since the plugins release? or is there a separate list of firefox parameters?

# July 24, 2008 6:15 AM

errand said:

Hey Paul,

Could you send me an email and I can help walk you through the issue you are hitting? Specifically if you have a short piece of sample code that you could send.

Thanks,

Eric

# July 29, 2008 12:54 PM

nicejack79 said:

Please find the code

<script language="JavaScript" for="contentPlayer" event="playStateChange(newState)">

   wmpPlayStateChange(newState);

// This function will run every time the Play State changes in Windows Media Player

function wmpPlayStateChange(newState) {

    // alert the play state value in plain text for convenience

    //alert ( playstateValues[newState] );

var WMP9=new Object();

WMP9=document.getElementById("contentPlayer");

boxtest = document.getElementById("testBox");

boxtest.value = boxtest.value + WMP9.playstate;

if ( WMP9.playstate == 8 )

{

if(xmlHttp){

xmlHttp.abort();

}

//alert( "inside setFlashvar_WMP_status");

var xmlHttp = GetXmlHttpObject();

index = document.getElementById("hidden").value;

var url = "http://localhost:8080/Need4All/servlet/PlayList";

url = url + "?pickMethod=NU&asxFileName=sample.asx&index=" + index +"&time="+encodeURIComponent((new Date()).getTime());

//alert(url);

xmlHttp.open("GET",url,true);

xmlHttp.onreadystatechange=function ()

{

if (xmlHttp.readyState==4)

{

if (xmlHttp.status==200)

{

var response = xmlHttp.responseText;

document.getElementById("debug1").value = response;

var index = response.substring( 0 , response.indexOf("|]"));

//alert(index);

var url = response.substring( response.indexOf("|]") + 2);

//alert(url);

if ( url.indexOf(".wmv") == -1){

alert("does not contain wmv file");

}

//var WMP9=new Object();

//WMP9=document.getElementById("contentPlayer");

if (url != null)

{

WMP9.URL = url;

document.getElementById("hidden").value = index;

WMP9.controls.play();

}

//alert(WMP9.URL);

}

}

}

xmlHttp.send(null);

}

function OnDSPlayStateChangeEvt(NewState)

{

alert("inside state change event");

}

}

</script>

Unable to send playstatechangeevent in fir3efox. Please help.

# January 14, 2009 10:33 AM
Anonymous comments are disabled
Page view tracker