我发现WpfMediaKit似乎是<MediaElement>
. 但是,我似乎无法让它工作。
在 Visual Studio 中,我创建了一个新的 WPF 项目,然后我下载了NuGet 包。我添加了xmlns
一个播放器元素,并为该元素分配了一个源并启动了应用程序......但没有任何反应。什么都没有显示,没有错误。
<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>
下载文件并使用本地副本,通过将源更改为file://C:/Temp/File.mp4
,并没有帮助。
我觉得我一定错过了一些重要的东西,但是什么?