gpt4 book ai didi

c# - C#UWP MediaPlayer在模拟器上崩溃

转载 作者:行者123 更新时间:2023-12-03 15:58:41 25 4
gpt4 key购买 nike

我是UWP的新手,我尝试实例化MediaPlayer类。在本地计算机上,它可以正常工作,但在移动仿真器上会引发下一个异常:

An exception of type 'System.Runtime.InteropServices.COMException' occurred in project.exe but was not handled in user code

Additional information: ClassFactory cannot supply requested class (Exception from HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE))



enter image description here

堆栈跟踪:

  • at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
  • at Windows.Media.Playback.MediaPlayer..ctor()
  • at Project.Services.PlaybackServiceFactory.Create(PlayerArgument arg)
  • at Project.ViewModels.PlayerViewModel..ctor(PlayerArgument arg)
  • at Project.MainPage.d__3.MoveNext()


使用MediaPlayer的所有uwp示例也会崩溃。以前工作正常,可能出什么问题了?我很乐意提供任何帮助,谢谢。

UPD:10.0.10586仿真器版本的实际问题

最佳答案

MediaPlayer constructor可从“通用发行版本10.0.14393.0”中获得。因此,请在14393仿真器或磨碎机中运行您的项目。

你可以dynamically detect features with API contracts (10 by 10)

The Universal Windows Platform (UWP) allows you to write your app once and target multiple device families, while also taking advantage of new APIs introduced on later versions of the OS as well as using unique APIs only present on certain device families.

关于c# - C#UWP MediaPlayer在模拟器上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41658041/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com