Upanisad
Guest
|
Posted:
Thu Jun 03, 2004 7:03 pm Post subject:
Embedding WMV & Real with autodetect JS on Helix Server |
|
|
Hi there!
I've built an embedded stream player for a site, using a Javascript
code snippet I got from Apple site
(http://developer.apple.com/internet/webcontent/detectplugins.html) to
autodetect the plug-ins. Then it writes the right code to the HTML to
embed the right player. It basically searches for Real Player and if
it doesn't find it, it reloads the PHP for the Windows Media Player.
Now, everything works, as far as the player is concerned.
The problem lies within the server or its interaction with the
script!!! We're using a small Helix Server, the free Basic version.
After a couple of days with the streamer online it gets stucked by
streams left open, way beyond their length as if it's still playing
them (but they're 30 seconds long, not hours and days!!)! It never
closes some of them (don't ask me why just SOME, but it seems to
happen with WMVs) and so it gets to fill its allowed rate or just
simply crashes!
Before I started to use the embedded player, with direct links to the
videos, it never happened. So it has to do with embedding, but I just
havent' got a clue about WHAT's wrong! I checked and rechecked
hundreds of times! :/
Could someone tell me what's going on???? I just can't get it!!!
It's quite complex, you can check the whole HTML here:
http://www.tvspot.it/streamer.php?speed=56k&fname=Casio-GShock
As for the embedding only, the code it writes for WMP is this one:
<SCRIPT language=JavaScript type=text/javascript>window.resizeTo(372,
562);</SCRIPT>
<OBJECT id=MediaPlayer1 type=application/x-oleobject
height=302
width=320
classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6><PARAM NAME="URL"
VALUE="http://archivio.tvspot.it:8081/asxgen/stream/Casio-GShock.wmv"><PARAM
NAME="autoStart" VALUE="true"><PARAM NAME="uiMode" VALUE="full"><PARAM
NAME="stretchToFit" VALUE="false"><PARAM NAME="playCount"
VALUE="1"><PARAM NAME="enabled" VALUE="true">
<EMBED TYPE="application/x-mplayer2" NAME="MediaPlayer1"
WIDTH=320
HEIGHT=314
src="http://archivio.tvspot.it:8081/asxgen/stream/Casio-GShock.wmv"
filename="http://archivio.tvspot.it:8081/asxgen/stream/Casio-GShock.wmv"
autoStart="true" showcontrols="True" showstatusbar="True"
showdisplay="False" autorewind="True"
pluginspage="http://www.microsoft.com/windows/windowsmedia/download/default.asp">
</EMBED></OBJECT>
The code for Real is:
<OBJECT ID="videobox"
CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH="320"
HEIGHT="240"><PARAM name="src"
value="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm"><PARAM
name="controls" value="imagewindow"><PARAM name="CENTER"
value="TRUE"><PARAM name="console" value="video"><PARAM
name="autostart" value="true"><EMBED
TYPE="audio/x-pn-realaudio-plugin"
SRC="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm"
WIDTH="320" HEIGHT="240" AUTOSTART="true" CONTROLS="imagewindow"
CENTER="true" CONSOLE="video" NOJAVA="true"></EMBED></OBJECT><OBJECT
ID="controlsbox" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"
WIDTH="320" HEIGHT="69"><PARAM name="src"
value="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm"><PARAM
name="controls" value="All"><PARAM name="console" value="video"><EMBED
TYPE="audio/x-pn-realaudio-plugin"
SRC="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm"
WIDTH="320" HEIGHT="69" CONTROLS="All" CONSOLE="video"
NOJAVA="true"></EMBED></OBJECT>
or this, when it gets built by JS:
document.write ('<OBJECT ID="videobox"
CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH="320"
HEIGHT="240">');document.write ('<PARAM name="src"
value="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm">');document.write
('<PARAM name="controls" value="imagewindow"><PARAM name="CENTER"
value="TRUE"><PARAM name="console" value="video"><PARAM
name="autostart" value="true">');document.write ('<EMBED
TYPE="audio/x-pn-realaudio-plugin"
SRC="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm"
WIDTH="320" HEIGHT="240" AUTOSTART="true" CONTROLS="imagewindow"
CENTER="true" CONSOLE="video" pluginspage="http://italy.real.com"
NOJAVA="true">');document.write ('</EMBED></OBJECT>');document.write
('<OBJECT ID="controlsbox"
CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH="320"
HEIGHT="69">');document.write ('<PARAM name="src"
value="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm">');document.write
('<PARAM name="controls" value="All"><PARAM name="console"
value="video">');document.write ('<EMBED
TYPE="audio/x-pn-realaudio-plugin"
SRC="http://archivio.tvspot.it:8081/ramgen/stream/Casio-GShock.rm"
WIDTH="320" HEIGHT="69" CONTROLS="All" CONSOLE="video"
NOJAVA="true">');document.write ('</EMBED></OBJECT>');
|
|