Search code examples
c#wpfwpf-mediakit

Can't get WpfMediaKit to work


I've discovered WpfMediaKit which seems like a good alternative to <MediaElement>. However, I can't seem to get it to work.

In Visual Studio I create a new WPF project, then I downloaded the NuGet package. I add the xmlns and a player element, and assign a source to the element and start the application... but nothing happens. Nothing is displayed, no errors.

<Window x:Class="MainApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:MainApp"
    xmlns:wpfmediakit="clr-namespace:WPFMediaKit.DirectShow.Controls;assembly=WPFMediaKit"
    mc:Ignorable="d"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
        <wpfmediakit:MediaUriElement Source="https://domain/path/video.mp4" />
    </Grid>
</Window>

Downloading the file and using the local copy, by changing the source to file://C:/Temp/File.mp4, doesn't help a bit.

I feel like I must be missing something essential, but what?


Solution

  • It happens to me as well and the problem was I didn't install the codecs the best free codec available in my opinion is Klite just download and install and everything will work fine