Skip to content

Technikal Mind

Technical thoughts from a Curious Thinker

  • Home
  • About
  • GitHub
  • Curious Thinker Media

Building a Media Player using Vlc.DotNet, vlclib and WPF

Posted on September 6, 2016 - May 27, 2022 by technik

So for the last couple of days, I’ve been working on a Media Player project written in C# and WPF using Vlc.DotNet, a .NET control and wrapper for the VLC libraries.

Unfortunately, the documentation is rather sparse, so I’ve been trying to piece a few things together. If I get far enough into understanding it, I may consider contributing to the documentation.

My first issue was with getting the XAML control and the code-behind to work properly. I ended up realizing that the control is looking for the VLC libraries, so I had to define where they were located:

VlcControl.MediaPlayer.VlcLibDirectory = new DirectoryInfo(LIBVLC_PATH_DEFAULT_AMD64);

(Note: LIBVLC_PATH_DEFAULT_AMD64 is a private const string that is initialized outside of MainWindow() which holds the string value. In the future, I will expand this to determine whether to use x86 or x64 libs. For now, it’s using an explicitly defined path)

This passes a DirectoryInfo instance to the VlcLibDirectory property so that it can initialize in the next line:

VlcControl.MediaPlayer.EndInit();

Both of these are inside of a try-catch block, as they can throw a variety of exceptions, notably ArgumentException, DirectoryNotFoundException, and FileNotFoundException. At the moment, if one is detected, a MessageBox appears to notify us of the error, then the program gracefully closes.

I’m still exploring the code for the Vlc.DotNet project. I’ll have more to write in a follow up post.

Posted in C#/.NET, Computer Science, Development, Programming

Post navigation

Computationally Calculating Pi [in python]

Recent Posts

  • Building a Media Player using Vlc.DotNet, vlclib and WPF
  • Computationally Calculating Pi [in python]
  • Contribution to an open source project
  • Starting Computer Science program
  • Unity Game Development

Recent Comments

    Archives

    • September 2016
    • March 2016
    • November 2015
    • August 2015
    • July 2015
    • June 2015
    • April 2015
    • February 2015
    • January 2015
    • November 2014
    • August 2014
    • May 2013

    Categories

    • C#/.NET
    • Computer Science
    • Development
    • Education
    • Electronics
    • GameDev
    • Linux
    • Mathematics
    • Networking
    • Philosophy
    • Programming
    • Science
    • Technikal Mind
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    Proudly powered by WordPress | Theme: micro, developed by DevriX.