Opening .avi in VS2005

Last post 07-02-2009 7:30 AM by qwe123kids. 3 replies.

Sort Posts:

  • Opening .avi in VS2005

    07-02-2009, 2:48 AM
    • Member
      point Member
    • AimingBird
    • Member since 04-09-2009, 10:19 AM
    • Posts 5

    hi ,

       My project is in VS2005. I need to open a .avi file that has been stored in a dir ., and play on click of a link ( Say name of a file) . How can i do this in VS2005. Is their any one to give suggestion. i couldnt find proper codes in .net forums.

  • Re: Opening .avi in VS2005

    07-02-2009, 3:09 AM
    • All-Star
      26,651 point All-Star
    • qwe123kids
    • Member since 03-27-2008, 5:49 AM
    • Mumbai
    • Posts 4,530

    Hi,

    if ur using Asp.net then u can ue Object or Embed Tag..


    <OBJECT
    ID="MediaPlayer"
    STYLE="POSITION:ABSOLUTE; LEFT:10px; top:100px;"
    classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
    CODEBASE=
    "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
    width=320 height=240
    standby="Loading Microsoft Windows Media Player components..."
    type="application/x-oleobject">
    <PARAM NAME="FileName" VALUE="path.avi">
    <PARAM NAME="TransparentAtStart" Value="false">
    <PARAM NAME="AutoStart" Value="true">
    <PARAM NAME="AnimationatStart" Value="true">
    <PARAM NAME="ShowControls" Value="true">
    <PARAM NAME="ShowPositionControls" Value="false">
    <PARAM NAME="ShowStatusBar" Value="true">
    <PARAM NAME="autoSize" Value="false">
    <PARAM NAME="displaySize" Value="0">
    <Embed type="application/x-mplayer2"
    pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"
    src="path.avi"
    Name=MediaPlayer
    AutoStart=1
    Width=320 Height=240 transparentAtStart=0
    animationAtStart=1
    ShowControls=1
    ShowPositionControls=0
    ShowStatusBar=1
    autoSize=0
    displaySize=0></embed>
    </OBJECT>

    OR

    <embed src="video.avi" />

    Or

    u can also use simple Link..
    <a href="video.avi">Play a video file</a>

    for more Information
    http://www.w3schools.com/media/media_browservideos.asp

    Thanks
    Avinash Tiwari

    Remember to click “Mark as Answer” on the post, if it helps you.

    MY Blog

    Hacking Inside .net exe
  • Re: Opening .avi in VS2005

    07-02-2009, 6:24 AM
    • Member
      point Member
    • AimingBird
    • Member since 04-09-2009, 10:19 AM
    • Posts 5

     Hi,

         Your code playing the video for me. But is i make the Object tag as runat="server" ., the respective Id is not recognized in the code behind. I need to give the file name in runtime. how can i change the code?.

     

  • Re: Opening .avi in VS2005

    07-02-2009, 7:30 AM
    Answer
    • All-Star
      26,651 point All-Star
    • qwe123kids
    • Member since 03-27-2008, 5:49 AM
    • Mumbai
    • Posts 4,530

    Hi,

    U may Create a String ..

    String strpaler ="<object"
    ..........
    .....

    strpaler  = strpaler  + "PARAM NAME="FileName" VALUE=""+<value avi file/>+"">"

    ...Rest of code..

    Label.text = strpalyer
    or
    Response.write(strpaler)

    Thanks
    Avinash Tiwari

    Remember to click “Mark as Answer” on the post, if it helps you.

    MY Blog

    Hacking Inside .net exe
Page 1 of 1 (4 items)