Tutorial: Simple video player using WPF/C# Posted byZahidJune 26, 2011June 29, 2011Posted inProgrammingTags:C#, Csharp, mediaElement, video player, WPF Just recorded: Share this:TwitterFacebookEmailPrintMoreRedditLinkedInLike this:Like Loading... Related
2 thoughts on “Tutorial: Simple video player using WPF/C#”
I like your tutorial,it’s very simple and easy to understand. 🙂
Where did you get the style for the video player at the beginning?
And how one can implement the auto hide option,full screen mode,and different frame size like 16:9 or 4:3 ?
The idea behind the video player that i show at the start was to have a UI that doesn’t distract the user. A lot of video players show the UI at all times, its not necessary because a user doesn’t interact with the UI most of the time.
I made a tutorial on how you would implement an auto hide function (it’s just a fade animation), you can check it out here: http://www.youtube.com/watch?v=TocJyPEvc2Y
As far as i know, there is no one line of code you can use to control the aspect ratio. I use a trick to do this, set the media element’s ‘Stretch’ property to fill and then put the media element inside of a canvas (or other container). Then programmatically control the size of the media element to the correct aspect ratio.