Dynamically build an MPEG,AVI

D

DaveF

I need to put it in a specific place. Here is the old code

switch(CAMERA_TYPE_ID)

{

case "0":

case "7": // this is an image

Response.Write("<img id='RTC' SRC=" & url & ">");

Response.Write("<script>");

Response.Write("window.onload=starttime");

Response.Write("</script>");

case "1": // this is an MPEG

Response.Write("<object width='320' height='290'
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' id='mediaplayer1'>");

Response.Write("<param name='Filename'
value='http://www.xxxxx/TravInfo/rollFilm.asp?feed=13'>");

Response.Write("<param name='AutoStart' value='True'>");

Response.Write("<param name='ShowControls' value='False'>");

Response.Write("<param name='ShowStatusBar' value='False'>");

Response.Write("<param name='ShowDisplay' value='False'>");

Response.Write("<param name='AutoRewind' value='True'>");

Response.Write("<embed type='application/x-mplayer2'
pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer
/' width='320' height='290'
src='http://www.chart.state.md.us/TravInfo/rollFilm.asp?feed=13'
filename='kids.mpg' autostart='True' showcontrols='False'
showstatusbar='False' showdisplay='False' autorewind='True'>");

Response.Write("</embed>");

Response.Write("</object>");

case "2": // this is an AVI

Response.Write("<object id='o_camera_feed'
classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' align='baseline'
border='0' width='" & rsData("CAMERA_WIDTH") & "' height='" &
rsData("CAMERA_HEIGHT") & "'>");

Response.Write("<param name='controls' value='imagewindow'>");

Response.Write("<param name='console' value='master'>");

Response.Write("<embed type='audio/x-pn-realaudio-plugin'");

Response.Write("src='" & rsData("CAM_URL") & "' ");

Response.Write("align='baseline' ");

Response.Write("border='0' width='" & rsData("CAMERA_WIDTH") & "' ");

Response.Write("height='" & rsData("CAMERA_HEIGHT") & "' ");

Response.Write("name='e_camera_feed' ");

Response.Write("controls='imagewindow' ");

Response.Write("console='master'");

Response.Write("AUTOSTART='true'></embed>");

Response.Write("</object>");


--


David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
(e-mail address removed)
 
N

Nicholas Paldino [.NET/C# MVP]

Dave,

You aren't really specifying what you are trying to do, it's just a
bunch of code that has no comments and a title which doesn't help much
either. Can you give a little more insight into what you are trying to do,
and what the problem is?
 
D

DaveF

I need to dynamically build code for something like an MPEG. Right now I use
a Literal like below. Is there a better way?

case "6": // Delaware DOT
string splitString = ds.Tables[0].Rows[0][8].ToString();
char[] sep = {','};
string[] query_stringArray = splitString.Split(sep);
htmlString = "<APPLET codebase='http://webvideoserv.state.de.us/java'
width='352' height='240' code='GTS.VideoClient.class'>";
htmlString += "<PARAM name='cabbase' value='VideoClient.cab'>";
htmlString += "<PARAM name='framerate' value='" + query_stringArray[1] +
"'>";
htmlString += "<PARAM name='jitdetect' value='false'>";
htmlString += "<PARAM name='message' value='Welcome to Delaware.Com
Webcams!'>";
htmlString += "<PARAM name='video' value='/video.jpg?server=" +
query_stringArray[0] + "'>";
htmlString += "<PARAM name='videoheight' value='240'>";
htmlString += "<PARAM name='videowidth' value='352'>";
htmlString += "<PARAM name='connecttype' value='http-cache'>";
htmlString += "<CENTER>Java must be enabled to<BR>view GTS
Video</CENTER>";
htmlString += "</APPLET>";
break;
}
Literal1.Text = htmlString;


--


David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
(e-mail address removed)
Nicholas Paldino said:
Dave,

You aren't really specifying what you are trying to do, it's just a
bunch of code that has no comments and a title which doesn't help much
either. Can you give a little more insight into what you are trying to do,
and what the problem is?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

DaveF said:
I need to put it in a specific place. Here is the old code

switch(CAMERA_TYPE_ID)

{

case "0":

case "7": // this is an image

Response.Write("<img id='RTC' SRC=" & url & ">");

Response.Write("<script>");

Response.Write("window.onload=starttime");

Response.Write("</script>");

case "1": // this is an MPEG

Response.Write("<object width='320' height='290'
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' id='mediaplayer1'>");

Response.Write("<param name='Filename'
value='http://www.xxxxx/TravInfo/rollFilm.asp?feed=13'>");

Response.Write("<param name='AutoStart' value='True'>");

Response.Write("<param name='ShowControls' value='False'>");

Response.Write("<param name='ShowStatusBar' value='False'>");

Response.Write("<param name='ShowDisplay' value='False'>");

Response.Write("<param name='AutoRewind' value='True'>");

Response.Write("<embed type='application/x-mplayer2'
pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer
/' width='320' height='290'
src='http://www.chart.state.md.us/TravInfo/rollFilm.asp?feed=13'
filename='kids.mpg' autostart='True' showcontrols='False'
showstatusbar='False' showdisplay='False' autorewind='True'>");

Response.Write("</embed>");

Response.Write("</object>");

case "2": // this is an AVI

Response.Write("<object id='o_camera_feed'
classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' align='baseline'
border='0' width='" & rsData("CAMERA_WIDTH") & "' height='" &
rsData("CAMERA_HEIGHT") & "'>");

Response.Write("<param name='controls' value='imagewindow'>");

Response.Write("<param name='console' value='master'>");

Response.Write("<embed type='audio/x-pn-realaudio-plugin'");

Response.Write("src='" & rsData("CAM_URL") & "' ");

Response.Write("align='baseline' ");

Response.Write("border='0' width='" & rsData("CAMERA_WIDTH") & "' ");

Response.Write("height='" & rsData("CAMERA_HEIGHT") & "' ");

Response.Write("name='e_camera_feed' ");

Response.Write("controls='imagewindow' ");

Response.Write("console='master'");

Response.Write("AUTOSTART='true'></embed>");

Response.Write("</object>");


--


David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
(e-mail address removed)
 
N

Nicholas Paldino [.NET/C# MVP]

DaveF,

The better way would be to create a custom control which would embed
this in the page, and then embed that in your ASPX page.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

DaveF said:
I need to dynamically build code for something like an MPEG. Right now I
use
a Literal like below. Is there a better way?

case "6": // Delaware DOT
string splitString = ds.Tables[0].Rows[0][8].ToString();
char[] sep = {','};
string[] query_stringArray = splitString.Split(sep);
htmlString = "<APPLET codebase='http://webvideoserv.state.de.us/java'
width='352' height='240' code='GTS.VideoClient.class'>";
htmlString += "<PARAM name='cabbase' value='VideoClient.cab'>";
htmlString += "<PARAM name='framerate' value='" + query_stringArray[1]
+
"'>";
htmlString += "<PARAM name='jitdetect' value='false'>";
htmlString += "<PARAM name='message' value='Welcome to Delaware.Com
Webcams!'>";
htmlString += "<PARAM name='video' value='/video.jpg?server=" +
query_stringArray[0] + "'>";
htmlString += "<PARAM name='videoheight' value='240'>";
htmlString += "<PARAM name='videowidth' value='352'>";
htmlString += "<PARAM name='connecttype' value='http-cache'>";
htmlString += "<CENTER>Java must be enabled to<BR>view GTS
Video</CENTER>";
htmlString += "</APPLET>";
break;
}
Literal1.Text = htmlString;


--


David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
(e-mail address removed)
in
message news:[email protected]...
Dave,

You aren't really specifying what you are trying to do, it's just a
bunch of code that has no comments and a title which doesn't help much
either. Can you give a little more insight into what you are trying to do,
and what the problem is?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

DaveF said:
I need to put it in a specific place. Here is the old code

switch(CAMERA_TYPE_ID)

{

case "0":

case "7": // this is an image

Response.Write("<img id='RTC' SRC=" & url & ">");

Response.Write("<script>");

Response.Write("window.onload=starttime");

Response.Write("</script>");

case "1": // this is an MPEG

Response.Write("<object width='320' height='290'
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' id='mediaplayer1'>");

Response.Write("<param name='Filename'
value='http://www.xxxxx/TravInfo/rollFilm.asp?feed=13'>");

Response.Write("<param name='AutoStart' value='True'>");

Response.Write("<param name='ShowControls' value='False'>");

Response.Write("<param name='ShowStatusBar' value='False'>");

Response.Write("<param name='ShowDisplay' value='False'>");

Response.Write("<param name='AutoRewind' value='True'>");

Response.Write("<embed type='application/x-mplayer2'
pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer
/' width='320' height='290'
src='http://www.chart.state.md.us/TravInfo/rollFilm.asp?feed=13'
filename='kids.mpg' autostart='True' showcontrols='False'
showstatusbar='False' showdisplay='False' autorewind='True'>");

Response.Write("</embed>");

Response.Write("</object>");

case "2": // this is an AVI

Response.Write("<object id='o_camera_feed'
classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' align='baseline'
border='0' width='" & rsData("CAMERA_WIDTH") & "' height='" &
rsData("CAMERA_HEIGHT") & "'>");

Response.Write("<param name='controls' value='imagewindow'>");

Response.Write("<param name='console' value='master'>");

Response.Write("<embed type='audio/x-pn-realaudio-plugin'");

Response.Write("src='" & rsData("CAM_URL") & "' ");

Response.Write("align='baseline' ");

Response.Write("border='0' width='" & rsData("CAMERA_WIDTH") & "' ");

Response.Write("height='" & rsData("CAMERA_HEIGHT") & "' ");

Response.Write("name='e_camera_feed' ");

Response.Write("controls='imagewindow' ");

Response.Write("console='master'");

Response.Write("AUTOSTART='true'></embed>");

Response.Write("</object>");


--


David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top