C# WPF tutorial 2: Media player (beginner)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
26,058
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 30, 2010

in this tutorial we'll be going over how to make a basic media player in WPF, with Play/Stop/Pause/Open functions.

http://xsgteam.net/

To allow "Load" dialog to close without an error:
replace
"mediaElement1.Source = new Uri(ofd.FileName);"
with this. try { mediaElement1.Source = new Uri(ofd.FileName); } catch { new NullReferenceException("Error"); }

Link to this comment:

Share to:

Uploader Comments (XSkullsGames)

  • If you hate this song , go make your own C# tutorial with your own song....

    He did a good job of a good tutorial , just cuz you cant make one , doesnt mean you gotta hate it because of a bad song...

  • @codaassasin

    Thanks! Check out our Paradox videos! :)

  • yes,that is the exception i'm getting

  • @praveen7k

    is there any info you can give me? Code, error line #?

    etc.

    I cannot help you with just that little bit of information.

see all

All Comments (28)

Sign In or Sign Up now to post a comment!
  • @codaassasin or even better just mute the video and play your own song over it.

  • @maddy76852 same problem here :S sucks

  • My question to you is that when I code it,the code works fine, showing no errors....but as soon as i browse

    to select vedio.....there are no vedio file showing ...?????????

  • Everything works fine, but when I am trying to open System.Windows.Forms, gives an error: the namespace 'Windows' is not defined.I also tried to add reference but i am not able to find that kind of reference name.please help if you can

    thanks

  • Sound sucks

  • OH crap - the KILLER SONG stops in the middle!

    Dude- you got AN AWESOME method to teach like this - ... jam some Floyd too!

    Do it more! More with music - Crap - I should do these for MVVM studies for folks :)

  • Works perfectly thanks~

  • very nice tutorial!

  • check the XAML file below and see whether the MediaElement has LoadedBehavior = "manual" and UnLoadedBehavior = "manual".If not add it to the XAML file itself. For some reason changing it in the properties doesnt affect my MediaELement attributes in the XAML File.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more