Click to See Complete Forum and Search --> : Media Player Over Netscape


anupam kant
May 8th, 2002, 12:28 AM
Hi,
I am using MediaPlayer to play media files over the web using <object> and <embed> tags.
MediaPlayer is embaded in a framed page (to control its behavior). This works fine in IE. But in NS6.1, when i refer this framed page MediaPlayer itself launched and play the file.
Framed page does not work so i lost control over the player.
Is there any other way (except <embed> tag)to embed the player in the page


Anupam.

_Leo_
May 8th, 2002, 03:09 PM
As far as I know, there is not other way... I have same problem... some Netscape versions may load the plug-in while other version are not able to do that.

When using communicator 4.79, it works fine.

In fact, Microsoft's download site has a plug-in for Navigator 4.x only.

From MSDN:

Because Netscape Navigator cannot communicate directly with Microsoft® ActiveX® controls, Windows Media Player includes a plug-in (Npdsplay.dll) to allow users of Netscape Navigator to watch Windows Media content. With the help of a proxy applet (Npds.zip), events triggered by the plug-in are visible in Netscape Navigator, and thus can be scripted.

:)



----------------------------
_Leo_
http://www.drk.com.ar

anupam kant
May 9th, 2002, 04:04 AM
Thanx,
can you please elaborate on how can I control the player.
Actually I had tried the proxy class in Netscape but got "Object Not Defined"
error everytime. What could be the problem?
Is there any problem with NPDS folder or class files location?
(in my case they reside in NPDS subfolder relative to the script file)
(I do not know much about Java)

This is my code:

(I want to stop and close mediaPlayer on button click)

<BODY ONLOAD="RegisterEventObservers()">
<APPLET code=NPDS.npDSEvtObsProxy.Class
width=5 height=5 name=appObs VIEWASTEXT>
</APPLET>
<OBJECT ID="MediaPlayerNew" width=320 height=240
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="mms://localhost/welcome1.asf">
<PARAM NAME="animationatStart" VALUE="true">
<PARAM NAME="transparentatStart" VALUE="true">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="showControls" VALUE="true">

<EMBED type="application/x-mplayer2"
name="MediaPlayerNew"
ID="MediaPlayerNew"
width=160
height=162
src = "mms://localhost/welcome1.asf"
AutoStart=false>
</EMBED>
</OBJECT>

<form name="frmTest" >
<input type="button" name="btntest" value="Test" onclick="fn_test()">
</form>
</BODY>
</HTML>
<script Language="Javascript">

function RegisterEventObservers() {
var plugin = document.MediaPlayerNew
alert("here" + plugin) // fine upto here returns HTML.EmbedObject
appObs.setByProxyDSScriptCommandObserver(plugin, true);
appObs.setByProxyDSPlayStateChangeObserver(plugin, true);
appObs.setByProxyDSReadyStateChangeObserver(plugin, true);

}
function OnDSReadyStateChangeEvt (ReadyState)
{
alert("ReadyState: " + ReadyState); //never appeared
}
function fn_test()
{
document.MediaPlayerNew.Stop; //not working no error
}
</script>

PLEASE HELP...



Anupam.
PI Softek Ltd. India

_Leo_
May 9th, 2002, 10:19 AM
A long time ago, I was working with Media Player and Netscape... I think this code works, but I'm not sure... since the site I am responsible now for has 84.7% of Internet explorer users and 1.5% of Netscape users, we don't support Netscape any longer.

<SCRIPT FOR="DSPlay1" EVENT="Disconnect(lResult)" LANGUAGE="JScript">
alert('Se ha perdido la conexión...');
DSPlay1.Stop();
DSPlay1.Play();
</SCRIPT>



First note how to declar an event in the SCRIPT tag.
My embed section looks like this:

<Embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
filename="/Demo.asx"
src="/Demo.asx"
Name=DSPlay1
ShowControls=0
ShowDisplay=0
ShowStatusBar=1
width=451
height=20>
</Embed>



----------------------------
_Leo_
http://www.drk.com.ar

anupam kant
May 10th, 2002, 02:29 AM
I am thinking of using some other player (that can be embeded in the window in netscape and thus can be controlled by script).
Anyway Thank you very much for the help...
will be back shortly for further help

:-)

Anupam.
PI Softek Ltd. India