C# webpage playing a video from server hard drive
-
Hi Everyone, I have created a placeholder that holds a windows media player object. ds is a DataSet that holds the video's location on the hard drive. here's the code:
PlaceHolder2.Controls.Add(new LiteralControl(
//adjust height here
" <OBJECT id=\"VIDEO\" width=\"640\" height=\"480\" " +
"CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" type=\"application/x-oleobject\"> " +
//put url here
"<PARAM NAME=\"URL\" VALUE=\"" + ds.Tables[0].Rows[0][0].ToString() + "\"> " +
"<PARAM NAME=\"SendPlayStateChangeEvents\" VALUE=\"True\"> <PARAM NAME=\"AutoStart\" VALUE=\"True\"> " +
" </OBJECT> "
));Normally this would work fine, except I am trying to access a file that is outside the IIS and on a seperate hard drive, so currently an example of the "url" would be "D:\videos\camping.wmv" The client won't be able to take this because it'll try to locate the file on the client's machine. What I'd like to know is if it is possible to reference a video file outside of the website folder, and how to do that. Regards, Brad
-
Hi Everyone, I have created a placeholder that holds a windows media player object. ds is a DataSet that holds the video's location on the hard drive. here's the code:
PlaceHolder2.Controls.Add(new LiteralControl(
//adjust height here
" <OBJECT id=\"VIDEO\" width=\"640\" height=\"480\" " +
"CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" type=\"application/x-oleobject\"> " +
//put url here
"<PARAM NAME=\"URL\" VALUE=\"" + ds.Tables[0].Rows[0][0].ToString() + "\"> " +
"<PARAM NAME=\"SendPlayStateChangeEvents\" VALUE=\"True\"> <PARAM NAME=\"AutoStart\" VALUE=\"True\"> " +
" </OBJECT> "
));Normally this would work fine, except I am trying to access a file that is outside the IIS and on a seperate hard drive, so currently an example of the "url" would be "D:\videos\camping.wmv" The client won't be able to take this because it'll try to locate the file on the client's machine. What I'd like to know is if it is possible to reference a video file outside of the website folder, and how to do that. Regards, Brad
Murphy's law says I look for something slightly off the topic and find the solution -_- The solution (for future reference) is to include a virtual directory through IIS. This allows you to reference the files as if they were in a folder in your website. I am now going to go hit my head against a wall. Regards, Brad
-
Murphy's law says I look for something slightly off the topic and find the solution -_- The solution (for future reference) is to include a virtual directory through IIS. This allows you to reference the files as if they were in a folder in your website. I am now going to go hit my head against a wall. Regards, Brad
-
twinscythe12332 wrote:
I am now going to go hit my head against a wall.
Have a beer and relax instead. If you hit your head against any solid matter, soon you won't be able to hit the keybord. Yeah I know, just saying.. :)
All the best, Dan
to have a beer would be to go against the teachings of my religion, but I get what you're saying =P