Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# webpage playing a video from server hard drive

C# webpage playing a video from server hard drive

Scheduled Pinned Locked Moved C#
tutorialcsharpsysadminwindows-admin
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    twinscythe12332
    wrote on last edited by
    #1

    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

    T 1 Reply Last reply
    0
    • T twinscythe12332

      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

      T Offline
      T Offline
      twinscythe12332
      wrote on last edited by
      #2

      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

      D 1 Reply Last reply
      0
      • T twinscythe12332

        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

        D Offline
        D Offline
        Dan Mos
        wrote on last edited by
        #3

        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

        T 1 Reply Last reply
        0
        • D Dan Mos

          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

          T Offline
          T Offline
          twinscythe12332
          wrote on last edited by
          #4

          to have a beer would be to go against the teachings of my religion, but I get what you're saying =P

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups