Embedd Windows Media player help

Need technical advice on coding your web pages? Covers HTML, JavaScript, CSS, and some server side technologies. Also the issue of some webpages not displayed well.

Moderator: Don_HH2K

Embedd Windows Media player help

Postby Lucky Luke » Sat 22 Jan, 2005 5:18 pm

Hello,

I am trying to embed a windows media player on one of my clients websites to play one of her video's. It works fine in IE but in Mozilla it displays nothing.
Here is the code I used:

<OBJECT ID="mPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-
0080c74c7e95" TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="my movie.wmv">
<PARAM NAME="ShowControls" VALUE="TRUE"> </OBJECT>

So I went and used a different script:

<SCRIPT LANGUAGE="JavaScript">

var WMP7;

if ( navigator.appName != "Netscape" ){
WMP7 = new ActiveXObject('WMPlayer.OCX');
}

// Windows Media Player 7 Code
if ( WMP7 )
{
document.write ('<OBJECT ID=MediaPlayer ');
document.write (' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6');
document.write (' standby="Loading Microsoft Windows Media Player components..."');
document.write (' TYPE="application/x-oleobject" width="300" height="290">');
document.write ('<PARAM NAME="url" VALUE="http://www.mysite.com/my video.wmv">');
document.write ('<PARAM NAME="AutoStart" VALUE="true">');
document.write ('<PARAM NAME="ShowControls" VALUE="1">');
document.write ('<PARAM NAME="uiMode" VALUE="mini">');
document.write ('</OBJECT>');
}

// Windows Media Player 6.4 Code
else
{
//IE Code
document.write ('<OBJECT ID=MediaPlayer ');
document.write ('CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ');
document.write ('CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ');
document.write ('standby="Loading Microsoft Windows Media Player components..." ');
document.write ('TYPE="application/x-oleobject" width="300" height="290">');
document.write ('<PARAM NAME="FileName" VALUE="http://www.mysite.com/my video.wmv">');
document.write ('<PARAM NAME="AutoStart" VALUE="true">');
document.write ('<PARAM NAME="ShowControls" VALUE="1">');

//Netscape code
document.write (' <Embed type="application/x-mplayer2"');
document.write (' pluginspage="http://www.microsoft.com/windows/windowsmedia/"');
document.write (' filename="http://www.mysite.com/my video.wmv"');
document.write (' src="http://ncnetshow/station1.asx"');
document.write (' Name=MediaPlayer');
document.write (' ShowControls=1');
document.write (' ShowDisplay=1');
document.write (' ShowStatusBar=1');
document.write (' width=290');
document.write (' height=320>');
document.write (' </embed>');

document.write ('</OBJECT>');
}

</SCRIPT>

This now works fine, except if you do not have the Java plugin.
Can anybody help me with this?
Ciao, LL
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Lucky Luke
new member
new member
 
Posts: 1
Joined: Sat 22 Jan, 2005 5:04 pm

Postby Al » Sat 22 Jan, 2005 6:10 pm

You need the Mozilla Active X to work. AFAIK
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.5) Gecko/20041108 Firefox/1.0
User of Firefox :ff: 3.0 on Windows XP
User avatar
Al
diamond member
diamond member
 
Posts: 1694
Joined: Fri 20 Dec, 2002 1:08 pm

Postby Don_HH2K » Sat 22 Jan, 2005 6:50 pm

Lucky Luke, you might want to reference Windows Media Player in Netscape 7.1, an archive of an old but good DevEdge article that explains how to embed a Windows Media Player object into a webpage.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (Donzilla/0.5)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm


Return to Web Design and Page Coding

Who is online

Registered users: Google [Bot], Yahoo [Bot]