C# Windows 10上的MediaPlayer XAML错误';Windows.Media.Streaming.Adaptive.AdaptiveMediaSource';没有注册
我尝试在Windows10应用程序中播放HLS url时出错,是否有人遇到过与我相同的问题 调用CreateFromUriAsync时出现的错误:C# Windows 10上的MediaPlayer XAML错误';Windows.Media.Streaming.Adaptive.AdaptiveMediaSource';没有注册,c#,xaml,media-player,windows-10,http-live-streaming,C#,Xaml,Media Player,Windows 10,Http Live Streaming,我尝试在Windows10应用程序中播放HLS url时出错,是否有人遇到过与我相同的问题 调用CreateFromUriAsync时出现的错误: Requested Windows Runtime type 'Windows.Media.Streaming.Adaptive.AdaptiveMediaSource' is not registered. 我引用了Microsoft HLS SDK for WIndows 正如您所看到的,我的代码非常简单: private async Tas
Requested Windows Runtime type 'Windows.Media.Streaming.Adaptive.AdaptiveMediaSource' is not registered.
我引用了Microsoft HLS SDK for WIndows
正如您所看到的,我的代码非常简单:
private async Task GetVideoById(string videoId)
{
try
{
var hlsUri = new Uri("http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8");
var hlsSource = await AdaptiveMediaSource.CreateFromUriAsync(hlsUri);
if (hlsSource.Status == AdaptiveMediaSourceCreationStatus.Success)
{
DmPlayer.SetMediaStreamSource(hlsSource.MediaSource);
}
}
catch (Exception ex)
{
var error = ex;
}
}
我的XAML:
<playerFramework:MediaPlayer x:Name="DmPlayer"
Grid.Row="0"
MinWidth="400"
MinHeight="200"
MaxHeight="400"
HorizontalAlignment="Center"
VerticalAlignment="Center"
AutoPlay="True"
IsFullScreenEnabled="True"
IsFullScreenVisible="True"
IsPlayPauseVisible="True"
IsTimeElapsedVisible="True"
IsTimeRemainingVisible="True"
IsVolumeVisible="False"
SeekWhileScrubbing="True"
Stretch="Uniform"
d:LayoutRounding="Auto">
<playerFramework:MediaPlayer.RenderTransform>
<CompositeTransform x:Name="PlayerTransform" />
</playerFramework:MediaPlayer.RenderTransform>
<playerFramework:MediaPlayer.Plugins>
</playerFramework:MediaPlayer.Plugins>
</playerFramework:MediaPlayer>
编辑:
Cmd>systeminfo:
主机名:DESKTOP-7T9I942
操作系统名称:Microsoft Windows 10 Pro N
操作系统版本:10.0.10586 N/A版本10586该问题与我的版本有关。。。
我在一台运行Windows10Build10240的笔记本电脑和另一台运行Windows10Build10569的笔记本电脑上试过这段代码,我没有遇到任何问题。这是在我执行Windows 10阈值2更新之后发生的,因此我建议不要执行该更新。我在我的团队中测试了您的代码,它运行良好。你试过微软吗?虽然它不使用播放器框架,但它也使用了
AdaptiveMediaSource
。我正在运行Windows 10 Build 10586,你呢?您是否安装了Microsoft最新更新?