The RealForum is an email discussion group focused on using RealNetworks
products. The RealForum is a place to post messages about the best methods
for creating content using RealNetworks technologies and the planning and
implementation of streaming-media web sites.
********************************************************
From: "Kwari, Nicholas" <[EMAIL PROTECTED]>
Subject: Embedded object
I tried to embed the real player into a web page.
It is working. However, I am having trouble to play the SMIL file on it.
Can anyone help?
This is how my html looks like (notice: the lines in red):
<HEAD>
<title>SMIL Demo</title>
<!--- video play --->
<SCRIPT>
// edit this variable to point to proxy URL
var urlroot="rtsp://awatln02/reorganizationplan.smi";
var preroll=0;
var proxy_type="real"
var lastimg;
function PlayVideo(offset)
{
var d=document;
if (proxy_type == "real")
{
// set 'G2' variable...
var G2 = 0;
for(i=0; i< navigator.plugins.length; i++) { if
(navigator.plugins[i].name.match(/G2/)) { G2=1; } }
if (navigator.appName == "Netscape")
{
if (G2)
{
d.VideoImageWindow.SetSource(urlroot);
if ((offset + preroll*1000) > 0)
{
d.VideoImageWindow.SetPosition( Math.round(offset +
preroll*1000) );
}
else
{
d.VideoImageWindow.SetPosition( 0 );
}
d.VideoImageWindow.DoPlay();
}
else
{
if ((offset/1000 + preroll) > 0)
{
d.VideoImageWindow.SetSource(urlroot + "?start=" + "\"" +
Math.round(offset/1000 + preroll) + "\"");
}
else
{
d.VideoImageWindow.SetSource(urlroot + "?start=" + "\"" + 0 +
"\"");
}
d.VideoImageWindow.DoPlayPause();
}
}
else
{
if (G2)
{
d.RAOCX.Source = urlroot;
if ((offset + preroll*1000) > 0)
{
d.RAOCX.SetPosition( Math.round(offset + preroll*1000) );
}
else
{
d.RAOCX.SetPosition( 0 );
}
d.RAOCX.DoPlay();
}
else
{
if ((offset/1000 + preroll) > 0)
{
d.RAOCX.Source= urlroot + "?start=" + "\"" +
Math.round(offset/1000 + preroll) + "\"";
}
else
{
d.RAOCX.Source= urlroot + "?start=" + "\"" + 0 + "\"";
}
d.RAOCX.DoPlayPause();
}
}
}
if (proxy_type == "netshow")
{
NSPlay.Filename = urlroot;
if ((offset/1000 + preroll) > 0)
{
NSPlay.SelectionStart = Math.round(offset/1000 + preroll);
}
else
{
NSPlay.SelectionStart = 0;
}
NSPlay.Play();
}
if (proxy_type == "mbase")
{
var start;
if ((offset*1000 + preroll*1000000) > 0)
{
start = (offset*1000 + preroll*1000000);
}
else
{
start = 0;
}
d.location.href = urlroot + "?StartPosition=" + start +
"&AutoStart=TRUE";
}
if (proxy_type == "ovs")
{
if (navigator.userAgent.toLowerCase().indexOf("msie") == -1) //
netscape browser
{
document.video.load(urlroot);
if ((offset + preroll*1000) > 0)
{
document.video.play(offset+preroll*1000,offset+10000000);
}
else
{
document.video.play(0, 10000000);
}
}
else // msie browser
{
document.video.Load(urlroot);
document.video.Play();
if ((offset + preroll*1000) > 0)
{
document.video.SetPos(1,offset+preroll*1000);
}
else
{
document.video.SetPos(1,0);
}
}
}
if (proxy_type == "noproxy")
{
alert("No proxy available");
}
if (proxy_type == "mpeg")
{
if (navigator.appName == "Netscape")
{
document.NSPlay.SetFileName(urlroot);
if ((offset/1000 + preroll) > 0)
{
document.NSPlay.SetCurrentPosition(Math.round(offset/1000 +
preroll));
}
else
{
document.NSPlay.SetCurrentPosition(0);
}
}
else
{
document.NSPlay.Filename=urlroot;
if ((offset/1000 + preroll) > 0)
{
document.NSPlay.CurrentPosition = Math.round(offset/1000 +
preroll);
}
else
{
document.NSPlay.CurrentPosition = 0;
}
}
document.NSPlay.Play();
}
if (proxy_type == "quicktime")
{
alert("QuickTime does not support queing to a frame, please use the movie
controller instead")
}
if (proxy_type == "avi")
{
if (navigator.appName == "Netscape")
{
document.NSPlay.SetFileName(urlroot);
if ((offset/1000 + preroll) > 0)
{
document.NSPlay.SetCurrentPosition(Math.round(offset/1000 +
preroll));
}
else
{
document.NSPlay.SetCurrentPosition(0);
}
}
else
{
document.NSPlay.Filename=urlroot;
if ((offset/1000 + preroll) > 0)
{
document.NSPlay.CurrentPosition = Math.round(offset/1000 +
preroll);
}
else
{
document.NSPlay.CurrentPosition = 0;
}
}
document.NSPlay.Play();
}
}
</SCRIPT>
<!--- video play ends --->
</HEAD>
<BODY BGCOLOR='FFFFFF'>
<!-- BANNER BEGIN (You may consider changing the banner here) -->
<table width=640 cellspacing=0 cellpadding=0 border="0">
<tr>
<td><div align="center"><img src="http://awatln02/images/ANIGRPH.JPG"
width=117 height=110 border=0 alt=""><img
src="http://awatln02/images/EDHDR.GIF" width=364 height=115 border=0
alt=""></div></td>
</tr>
<tr>
<td width="0">
<Center>
<font size="+2"><b>OSFA Reorganization Plan by Greg
Woods</b></font><p>
<table>
<tr>
<td>
<OBJECT ID=RAOCX
CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"
WIDTH=240
HEIGHT=180>
<PARAM NAME="SRC"
VALUE="empty.rpm">
<PARAM NAME="CONTROLS"
VALUE="ImageWindow">
<PARAM NAME="CONSOLE"
VALUE="clip1">
<EMBED
SRC=empty.rpm
CONTROLS=ImageWindow
NAME=VideoImageWindow
AUTOSTART=false
CONSOLE=clip1
WIDTH=320
HEIGHT=240
BORDER=0>
</OBJECT><BR>
<EMBED
SRC=empty.rpm
WIDTH=240
HEIGHT=30
CONTROLS=ControlPanel
CONSOLE=clip1
AUTOSTART=false
BORDER=0>
</td>
<td>
<blockquote>
<b>Select a section of the video clip that
you wish to directly see:</b>
<ul>
<li><a
href="javascript:PlayVideo(0)">Introduction</a></li>
<li><a
href="javascript:PlayVideo(17000)">Reorganization</a></li>
<li><a
href="javascript:PlayVideo(27120)">Why Change everything?</a></li>
<li><a
href="javascript:PlayVideo(55000)">The bar has been raised to create
PBO</a></li>
<li><a
href="javascript:PlayVideo(145000)">How PBO was created</a></li>
<li><a
href="javascript:PlayVideo(204000)">Official Reorganization Date &
Organization Chart</a></li>
<li><a
href="javascript:PlayVideo(326000)">Q/A</a></li>
<li><a
href="javascript:PlayVideo(456000)">Summary</a></li>
</ul>
</blockquote>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
....
Nicholas Kwari
*******************************************************
If you ever want to remove yourself from this mailing list,
you can send mail to <[EMAIL PROTECTED]> with the following
command in the body of your email message:
unsubscribe realforum
or from another account, besides the address you subscribed with:
unsubscribe realforum <[EMAIL PROTECTED]>