krsna,
Thanks for the reply. The article was interesting but I don't think think your question on interfering programs causing problems is the case here. The machines in question are not running any special software like you mention. My tests make me believe that my problem is due to trying to do something with the control before both of them have fully loaded.
One think I have done is move to using Microsofts .HTA approach (hypertext application). By changing the extension and adding a line in the html page it causes the system to treat the web page as an application.
It took away the problem of the video disappearing with a click, and appears to behave better this way.
The code I have displays 2 videos and allows you to switch between audio 1 and audio 2. Since I have seen some questions from people on how to do this here is the code to do it. Copy this code to a file with an .HTA extension and run it just like any executable. When you run it this code looks for 3 parameters - 2 IP addresses and text for the window. It is pretty simple to edit to do what you want. Hope it helps someone.
Code: Select all
<HTML>
<head>
<title>Playback</title>
<HTA:APPLICATION ID="LEPViewer"
APPLICATIONNAME="VIEW"
BORDERSTYLE="complex"
BORDER="dialog"
CAPTION="yes"
SHOWINTASHBAR="yes"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
scroll="no">
</head>
<SCRIPT LANGUAGE='javascript'>
var IPAddress1 = "";
var IPAddress2 = "";
var RecordPathNum = "";
function play()
{
document.v1.playlistClear();
document.v2.playlistClear();
//Below code 8 replaces the playlist and starts playing
document.v1.addTarget(IPAddress1, null, 8, 0);
document.v2.addTarget(IPAddress2, null, 8, 0);
setTimeout('Listen2V2()', 900);
setTimeout('Listen2V1()', 1000);
resizeTo(335,630);
moveTo(670,0);
}
function Closeobj()
{
//document.v1.stop();
//document.v2.stop();
}
function Listen2V1()
{
document.v2.volume = "0";
document.v1.volume = "100";
}
function Listen2V2()
{
document.v1.volume = "0";
document.v2.volume = "100";
}
</SCRIPT>
</HEAD>
<BODY marginwidth="0"
marginheight="0"
topmargin="0"
leftmargin="0"
onload="play()"
onunload="Closeobj()"
BGCOLOR="AAAAAA" >
<SCRIPT LANGUAGE='javascript'>
var argc = 0;
var arg = null;
var cmdLine = LEPViewer.commandLine;
var strlength = cmdLine.length;
var poshta = cmdLine.indexOf(".hta");
poshta = poshta + 7;
var newstrlen = strlength - poshta;
cmdLine = cmdLine.substring(poshta, strlength);
cmdLine = cmdLine.replace(" ", " ");
var argv = cmdLine.split(" ");
IPAddress1 = argv[0];
IPAddress2 = argv[1];
RecordPathNum = argv[2];
IPAddress1 = IPAddress1.replace(",", "");
IPAddress2 = IPAddress2.replace(",", "");
IPAddress1 = "udp://@" + IPAddress1 + ":1234";
IPAddress2 = "udp://@" + IPAddress2 + ":1234";
RecordPathNum = "Record Path " + RecordPathNum;
document.write('<center><font face="Tahoma" size=+1 color="005555"><B>');
document.write(RecordPathNum + ' - <font size="+2">Playback C</B></CENTER>');
</SCRIPT>
<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
width=320
height=240 id="v1"
events="True">
<param name="ShowDisplay" value="True"/>
<param name="AutoPlay" value="True"/>
<param name="Enabled" value="False" />
<param name="Volume" value="100">
</OBJECT>
<BR>
<SCRIPT LANGUAGE='javascript'>
document.write('<center><font face="Tahoma" size=+1 color="550055"><B>');
document.write(RecordPathNum + ' - <font size="+2">Playback D</B></CENTER>');
</SCRIPT>
<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
width="320" height="240" id="v2" events="True">
<param name="ShowDisplay" value="True"/>
<param name="AutoPlay" value="True"/>
<param name="Enabled" value="True" />
<param name="Volume" value="0">
</OBJECT>
<CENTER>
<form name="Formular" action="">
<font face="Tahoma" color="002222" size="+2"><B>Audio: </B></font>
<font face="Tahoma" color="005555" size="2">Playback <B><font size=6>C</B>
<input type="radio" name="AudioSource" value="AudioMain" checked onClick="Listen2V1()">
<font face="Tahoma" color="550055" size="2">Playback <font size="6">D</font>
<input type="radio" name="AudioSource" value="AudioBackup" onClick="Listen2V2()">
</form>
</CENTER>
</BODY>
</HTML>
[/code]