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. Simple way to play audio/video file in form?

Simple way to play audio/video file in form?

Scheduled Pinned Locked Moved C#
tutorialquestion
13 Posts 3 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 TrooperIronMan

    Enable user to play audio or video of their choice... is there some namespace that deal with this?

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #4

    No. You need to use the windows media player control, or involve the DirectShow platform, which requires the PSDK. Are you an Iron Maiden/Black Sabbath fan, or does your name mean something else ?

    Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

    T 1 Reply Last reply
    0
    • C Christian Graus

      No. You need to use the windows media player control, or involve the DirectShow platform, which requires the PSDK. Are you an Iron Maiden/Black Sabbath fan, or does your name mean something else ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      T Offline
      T Offline
      TrooperIronMan
      wrote on last edited by
      #5

      Christian Graus wrote:

      Are you an Iron Maiden/Black Sabbath fan, or does your name mean something else ?

      Definitely big fan of Iron Maiden, but also like Ozzy Osbourne as well so I combined name of two songs into nick name... :D

      Christian Graus wrote:

      No. You need to use the windows media player control, or involve the DirectShow platform, which requires the PSDK.

      Direct X SDK or? Anyway first one looks to be more simple... how to do it some simple example please if possible?

      C 1 Reply Last reply
      0
      • T TrooperIronMan

        Enable user to play audio or video of their choice... is there some namespace that deal with this?

        E Offline
        E Offline
        Ed Poore
        wrote on last edited by
        #6

        In .NET 2 I think there's a SoundPlayer [^]component that you can drop onto a form.

        T 1 Reply Last reply
        0
        • E Ed Poore

          In .NET 2 I think there's a SoundPlayer [^]component that you can drop onto a form.

          T Offline
          T Offline
          TrooperIronMan
          wrote on last edited by
          #7

          Ed.Poore wrote:

          In .NET 2 I think there's a SoundPlayer [^]component that you can drop onto a form.

          Looks like link is bad or something Page not Found An error occurred: The file '/script/comments/msdn2.microsoft.com/en-us/system.media.soundplayer.soundlocation.aspx' does not exist. This error has been recorded.

          E 1 Reply Last reply
          0
          • T TrooperIronMan

            Ed.Poore wrote:

            In .NET 2 I think there's a SoundPlayer [^]component that you can drop onto a form.

            Looks like link is bad or something Page not Found An error occurred: The file '/script/comments/msdn2.microsoft.com/en-us/system.media.soundplayer.soundlocation.aspx' does not exist. This error has been recorded.

            E Offline
            E Offline
            Ed Poore
            wrote on last edited by
            #8

            Just do a google for SoundPlayer +msdn.


            I have no idea what I just said. But my intentions were sincere.

            1 Reply Last reply
            0
            • T TrooperIronMan

              Christian Graus wrote:

              Are you an Iron Maiden/Black Sabbath fan, or does your name mean something else ?

              Definitely big fan of Iron Maiden, but also like Ozzy Osbourne as well so I combined name of two songs into nick name... :D

              Christian Graus wrote:

              No. You need to use the windows media player control, or involve the DirectShow platform, which requires the PSDK.

              Direct X SDK or? Anyway first one looks to be more simple... how to do it some simple example please if possible?

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #9

              I saw Maiden in Toronto - awesome. DirectShow is in the platform SDK. Intuitive, no ? The WMP control is actually more code, but you have it already. Just google, there are plenty of samples out there for both. The DirectShow comes with samples, too, but it's pretty self explanatory.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

              T 1 Reply Last reply
              0
              • C Christian Graus

                I saw Maiden in Toronto - awesome. DirectShow is in the platform SDK. Intuitive, no ? The WMP control is actually more code, but you have it already. Just google, there are plenty of samples out there for both. The DirectShow comes with samples, too, but it's pretty self explanatory.

                Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

                T Offline
                T Offline
                TrooperIronMan
                wrote on last edited by
                #10

                [ot]Never seen Maiden live, last time they were here I was 7... so that was long time ago actually, now they promise each year they will come but always miss our country for some reason (mostly local promoter don't have enough money to pay in advance, event though I'm sure it would be great concert, every 2nd kid in town during summer have IM T-shirt, so go figure)...[/ot] Thing I seen on local MS presentation was, guy dragged button on form, and written simple event that opened and played media (audio) file from disc on click... but I guess it was just System.Media.SoundPlayer call (and at least to documentation it only play wav)... so not much use of that... anyway I'll go for second solution I guess... I'll return later if I can't figure out how to do it... ;P :) BTW visit this www.ironmaiden.co.sr not in English... but anyway...

                C 1 Reply Last reply
                0
                • T TrooperIronMan

                  [ot]Never seen Maiden live, last time they were here I was 7... so that was long time ago actually, now they promise each year they will come but always miss our country for some reason (mostly local promoter don't have enough money to pay in advance, event though I'm sure it would be great concert, every 2nd kid in town during summer have IM T-shirt, so go figure)...[/ot] Thing I seen on local MS presentation was, guy dragged button on form, and written simple event that opened and played media (audio) file from disc on click... but I guess it was just System.Media.SoundPlayer call (and at least to documentation it only play wav)... so not much use of that... anyway I'll go for second solution I guess... I'll return later if I can't figure out how to do it... ;P :) BTW visit this www.ironmaiden.co.sr not in English... but anyway...

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #11

                  I'm in Australia, I flew to Toronto to see them, they never come here either :-)

                  TrooperIronMan wrote:

                  guy dragged button on form

                  You need to right click on the toolbox and choose 'change items' or something, and you get a list, from there you can add WMP to the toolbox. Then, you can indeed drag it onto a form.

                  TrooperIronMan wrote:

                  written simple event that opened and played media (audio) file from disc on click

                  I believe the control has a Url property, it has something like that, which you can point to a file, and it will just play it. It has a property call CtlControls, or something, under that are methods like play, pause, stop.

                  TrooperIronMan wrote:

                  BTW visit this www.ironmaiden.co.sr not in English... but anyway...

                  Will do :-)

                  Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

                  T 1 Reply Last reply
                  0
                  • C Christian Graus

                    I'm in Australia, I flew to Toronto to see them, they never come here either :-)

                    TrooperIronMan wrote:

                    guy dragged button on form

                    You need to right click on the toolbox and choose 'change items' or something, and you get a list, from there you can add WMP to the toolbox. Then, you can indeed drag it onto a form.

                    TrooperIronMan wrote:

                    written simple event that opened and played media (audio) file from disc on click

                    I believe the control has a Url property, it has something like that, which you can point to a file, and it will just play it. It has a property call CtlControls, or something, under that are methods like play, pause, stop.

                    TrooperIronMan wrote:

                    BTW visit this www.ironmaiden.co.sr not in English... but anyway...

                    Will do :-)

                    Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

                    T Offline
                    T Offline
                    TrooperIronMan
                    wrote on last edited by
                    #12

                    This work, I guess that is best solution, what is minimal version of MP that user should have in order this to run? Does it work on 2000/ME/98? does 2.0 run at all on 9x systems? how about 3.0?

                    C 1 Reply Last reply
                    0
                    • T TrooperIronMan

                      This work, I guess that is best solution, what is minimal version of MP that user should have in order this to run? Does it work on 2000/ME/98? does 2.0 run at all on 9x systems? how about 3.0?

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #13

                      .NET 2.0 requires 2000, and 3.0 requires XP.

                      Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

                      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