Visit Mozilla.org

Talk:Windows Media in Netscape

From MDC

I used the code snippet given in the article.

But i have been facing some problems. Its working fine with Internet Explorer. but giving errors with firefox.

It throws the following exception [Exception... "Unable to create an instance of the desired COM classCOM Error Result = 80004005" nsresult: "0x80570039 (NS_ERROR_XPC_COM_CREATE_FAILED). i am pasting the modified snippet

try {

 if (window.ActiveXObject)
 {

alert("1");

   player = new ActiveXObject("MediaPlayer.MediaPlayer.1");
 }
 else if (window.GeckoActiveXObject)
 {
 	alert("2");
   player = new GeckoActiveXObject("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}");
 }
 else
 {
 	alert("3");
   // Plugin code using navigator.mimeTypes
   player = navigator.mimeTypes["application/x-mplayer2"].enabledPlugin;		
 }

} catch(e) {

 alert('Handle error -- no WMP control'+e);
 document.write(e);
 // Download: http://www.microsoft.com/windows/windowsmedia/download/default.asp

}

if (player) {

 alert('Windows Media Player control exists');

}

the exception is thrown after the window.GeckoActiveXObject is detected i have tried all of the options for the id given in the document. Probably some cj\hanges need to be made in the browser settings i suppose.


The version of my firefox browser is given below Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7