How to play video on my website

Last post 09-26-2008 5:49 AM by Ramkrishna. 9 replies.

Sort Posts:

  • How to play video on my website

    01-05-2007, 9:21 PM
    Locked
    • Member
      25 point Member
    • hervens
    • Member since 01-06-2007, 2:16 AM
    • montreal, Quebec
    • Posts 62

    Hello all,

     I was wandering if there was someway that i could play videos from a webcam on my website, using microsoft visual web developer 2005 express.

    I already know how to upload a file to my server. I just dont know how to play that movie file.

    Thx in advance

  • Re: How to play video on my website

    01-06-2007, 12:05 AM
    Answer
    Locked
    • Contributor
      4,773 point Contributor
    • mkamoski
    • Member since 07-04-2002, 8:05 PM
    • ZULU-0500
    • Posts 1,299
    hervens:

    Hello all,

     I was wandering if there was someway that i could play videos from a webcam on my website, using microsoft visual web developer 2005 express.

    I already know how to upload a file to my server. I just dont know how to play that movie file.

    Thx in advance

    Here is a code sample.

    1. Create a file in your site called "TestVideo.aspx" and make it so the code-behind file does NOT exist. Just a single file called "TestVideo.aspx".
    2. Put the code below into the page.
    3. Run the site and load the page.
    4. Put the URL of the video in the TextBox and press the Load button.

     

    ..........CodeBegin

     <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

     protected void Button1_Click(object sender, EventArgs e)
     {
      try
      {
       string mySourceUrl = this.TextBox1.Text;
       bool isFullSize = false;
       this.Literal1.Text = this.GetWmaObject(mySourceUrl, isFullSize);
      }
      catch (Exception ex)
      {
       this.Response.Write(ex.ToString());
      }
     }

     private string GetWmaObject(string sourceUrl, bool isFullSize)
     {
      string myObjectTag = "";
      sourceUrl = sourceUrl + "";
      sourceUrl = sourceUrl.Trim();

      if (sourceUrl.Length > 0)
      {
       //Continue.
      }
      else
      {
       throw new System.ArgumentNullException("sourceUrl");
      }
      
      string myWidthAndHeight = "";

      if (isFullSize)
      {
       myWidthAndHeight = "";
      }
      else
      {
       myWidthAndHeight = "width='640' height='480'";
      }

      myObjectTag = myObjectTag + "<object classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' id='player' " + myWidthAndHeight + " standby='Please wait while the object is loaded...'>";
      myObjectTag = myObjectTag + "<param name='url' value='" + sourceUrl + "' />";
      myObjectTag = myObjectTag + "<param name='src' value='" + sourceUrl + "' />";
      myObjectTag = myObjectTag + "<param name='AutoStart' value='true' />";
      myObjectTag = myObjectTag + "<param name='Balance' value='0' />"; //-100 is fully left, 100 is fully right.
      myObjectTag = myObjectTag + "<param name='CurrentPosition' value='0' />"; //Position in seconds when starting.
      myObjectTag = myObjectTag + "<param name='showcontrols' value='true' />"; //Show play/stop/pause controls.
      myObjectTag = myObjectTag + "<param name='enablecontextmenu' value='true' />"; //Allow right-click.
      myObjectTag = myObjectTag + "<param name='fullscreen' value='" + isFullSize.ToString() + "' />"; //Start in full screen or not.
      myObjectTag = myObjectTag + "<param name='mute' value='false' />";
      myObjectTag = myObjectTag + "<param name='PlayCount' value='1' />"; //Number of times the content will play.
      myObjectTag = myObjectTag + "<param name='rate' value='1.0' />"; //0.5=Slow, 1.0=Normal, 2.0=Fast
      myObjectTag = myObjectTag + "<param name='uimode' value='full' />"; // full, mini, custom, none, invisible
      myObjectTag = myObjectTag + "<param name='showdisplay' value='true' />"; //Show or hide the name of the file.
      myObjectTag = myObjectTag + "<param name='volume' value='50' />"; // 0=lowest, 100=highest
      myObjectTag = myObjectTag + "</object>";

      return myObjectTag;
     }
     
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
      <br />
      <br />
      <asp:literal id="Literal1" runat="server"></asp:literal>
      <br />
      <br />
      <asp:textbox id="TextBox1" runat="server" width="500px" height="50px" wrap="true" textmode="multiLine" readonly="false" >http://download.microsoft.com/download/8/3/6/836dd5f8-fa92-499f-8219-0d326f13bf18/hilo_data_final.wmv</asp:textbox>
      <br />
      <br />
      <asp:button id="Button1" runat="server" text="Load Video" onclick="Button1_Click" />
        </div>
        </form>
    </body>
    </html>

    ..........CodeEnd

      

    HTH.

    Thank you.

    -- Mark Kamoski

  • Re: How to play video on my website

    01-06-2007, 12:39 AM
    Locked
    • Contributor
      4,773 point Contributor
    • mkamoski
    • Member since 07-04-2002, 8:05 PM
    • ZULU-0500
    • Posts 1,299
    hervens:

    Hello all,

     I was wandering if there was someway that i could play videos from a webcam on my website, using microsoft visual web developer 2005 express.

    I already know how to upload a file to my server. I just dont know how to play that movie file.

    Thx in advance

    FYI, I also made a working sample and posted in online, with all the source code, here...

    http://www.WebLogicArts.com/DemoWindowsMediaPlayer.aspx

    HTH.

    Thank you.

    -- Mark Kamoski

  • Re: How to play video on my website

    01-06-2007, 2:34 PM
    Locked
    • Member
      25 point Member
    • hervens
    • Member since 01-06-2007, 2:16 AM
    • montreal, Quebec
    • Posts 62

    Hello, thank you very much.

    Its working perfectly now.

  • Re: How to play video on my website

    11-19-2007, 1:15 AM
    Locked

    hello sir, I just gone though your reply regarding for  play video on web site..i want to show in the same way..but i want to play live webcam streaming video which is attached to my system..

     

    If you give the any sugession or any idea..i really proud of you..coz its very important to me..

    thanks in advance..

    Regards

    Balu Munugoti 

  • Re: How to play video on my website

    04-08-2008, 11:13 PM
    Locked
    • Member
      2 point Member
    • kumaravel26
    • Member since 04-08-2008, 1:41 PM
    • chennai
    • Posts 1

    Hai,

     I also want to to play the live webcam streaming video. I searched lot in sites. But I couldnot find a solution. Does we need to include activeX controls ?? Any of you having solution or valuable suggestion welcome. Thanks in Advance.

    Regards

    kumaravel

  • Re: How to play video on my website

    04-10-2008, 7:55 AM
    Locked
    • Contributor
      4,773 point Contributor
    • mkamoski
    • Member since 07-04-2002, 8:05 PM
    • ZULU-0500
    • Posts 1,299

    kumaravel26:

     I also want to to play the live webcam streaming video. I searched lot in sites. But I couldnot find a solution. Does we need to include activeX controls ??

    I do not know.

    -- Mark Kamoski

  • Re: How to play video on my website

    06-19-2008, 7:24 AM
    Locked
    • Member
      2 point Member
    • sujitvns
    • Member since 06-19-2008, 11:20 AM
    • Posts 1

     Hi

     

      It's working fine in internet explorer  Not show video in firefox if you have any idea then let us me

     

    Thanks
     

  • Re: How to play video on my website

    06-24-2008, 10:15 AM
    Locked
    • Contributor
      4,773 point Contributor
    • mkamoski
    • Member since 07-04-2002, 8:05 PM
    • ZULU-0500
    • Posts 1,299

    sujitvns:

    It's working fine in internet explorer  Not show video in firefox if you have any idea then let us me

    As of now, one might consider SilverLight as a strong option.

  • Re: How to play video on my website

    09-26-2008, 5:49 AM
    Locked
    • Member
      78 point Member
    • Ramkrishna
    • Member since 11-16-2006, 5:29 AM
    • Posts 10

    Do you like create videos like youtube? Want know how to play videos and convert the videos in ASP.Net, Here is your solution... http://ramcrishna.blogspot.com/2008/09/playing-videos-like-youtube-and.html

    Ram Krishna
    http://ramcrishna.blogspot.com
Page 1 of 1 (10 items)