Palli,
We are getting closer but not quite there. In an HTMLBox I can use all kinds of cool java scripts to do various things. Using an ActiveX box or an object box I seem to be limited to defining a Class Object and respective parameters. It seems I have no way of accessing the objects events and other properties.
For instance. See the HTML below. I have an event wired into the Class Object that will "SendOpenStateChangeEvents". Notice in JavaScript I have said function and will get an event from MediaPlayer. Also notice in JavaScript I can access the duration of media by getting that param "document.mediaPlayer.CurrentMedia.Duration".
Using your sample code, I tried accessing the variable "document.mediaPlayer.CurrentMedia.Duration" via ab.GetParameter(document.mediaPlayer.CurrentMedia.Duration") but I have no luck. Also using your example, I tried wiring up the event via ab.Parameters["SendOpenStateChangeEvents"] = "True" but where would the event fire?
Using your example, how do I access the object model and its properties, methods and events?
Seems we have issues with HTMLBox and Hosting Controls.
Whats next?
Also, in your first reply, you said "If you need further explanation, or if you need suggestions on how you can work around this using stateless contents in the HtmlBox let us know, and we will try to explain further.".
I guess we are at the point where I need to know how I can use "Stateless Contents" in the html box. This will give me the best of both worlds. A complete HTML file where I can set the object tag and its properties and wire up events, and javascript where I can access the complete object model with its respective properties, methods and events. Please reply. Thnx.
Last but not least, considering this is all part of one issue for us, please look at post: http://www.visualwebgui.com/Developers/Forums/tabid/364/forumid/59/threadid/46969/scope/posts/Default.aspx as we will need to know how to reach down and grab a javascript variable as well. One sample C# project showing all of this would be ideal and greatly appreciated.
<!--
<HTML>
<HEAD>
<TITLE>TEST</TITLE>
<SCRIPT TYPE="text/javascript" LANGUAGE = "JavaScript">
var PlayerReady = 0;
var IsNewLoad = 0;
var timerId;
function MediaPlayer_Load() {
if (document.mediaPlayer.ReadyState < 4)
{
timerId = setTimeout("MediaPlayer_Load()",250);
return;
}
if (!PlayerReady)
{
document.mediaPlayer.Controls.stop();
PlayerReady = 1;
}
if (PlayerReady)
{
clearTimeout(timerId);
IsNewLoad = 1;
setInterval("DSP_rotate()", 1000);
}
}
function MediaPlayer_Play() {
document.mediaPlayer.Controls.play();
}
function MediaPlayer_Stop() {
document.mediaPlayer.Controls.stop();
}
function DSP_rotate() {
if (IsNewLoad == 1) {
IsNewLoad = 0;
MediaPlayer_Play();
}
else {
document.playerCtrl.Length.value=document.mediaPlayer.CurrentMedia.Duration;
document.playerCtrl.Position.value=document.mediaPlayer.Controls.CurrentPosition;
}
}
</SCRIPT>
</HEAD>
<BODY>
<center>
<FORM NAME="playerCtrl">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top><P><FONT face=Verdana size=2>File Length:</FONT></P></TD>
<TD vAlign=top><P><INPUT value="Loading . . ." name="Length" READONLY><FONT face=Verdana size=2></FONT></P></TD>
<TD vAlign=top><P><FONT face=Verdana size=2>Current Position:</FONT></P></TD>
<TD vAlign=top><P><INPUT value="Loading . . ." name="Position" READONLY><FONT face=Verdana size=2></FONT></P></TD>
</TR>
</TBODY>
</TABLE>
<BR>
<BR>
<P>
<object id="mediaPlayer" width="100%" height="100%" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" align="middle">
<PARAM NAME="URL" VALUE="$$YOUR_VIDEO$$">
<param name="AutoStart" value="False" />
<param name="ShowStatusBar" value="True" />
<param name="StretchToFit" value="False" />
<param name="uiMode" value="full" />
<param name="SendOpenStateChangeEvents" value="True" />
</object>
</P>
</FORM>
</center>
<SCRIPT LANGUAGE = "JavaScript">
MediaPlayer_Load();
</SCRIPT>
<SCRIPT FOR="mediaPlayer"
EVENT="OpenStateChange(lOldState, lNewState)"
LANGUAGE="JScript">
if (lNewState >= 6) {
if (!PlayerReady) {
PlayerReady = 1;
setInterval("DSP_rotate()", 1000);
}
}
</SCRIPT>
</BODY>
</HTML>
-->