【问题标题】:Plugin.MediaManager.Forms is not working in xamarin uwpPlugin.MediaManager.Forms 在 xamarin uwp 中不起作用
【发布时间】:2021-04-05 05:06:29
【问题描述】:

Reference

我正在使用Plugin.MediaManager.Forms 播放音频。它在 android 和 ios 中运行良好。但在 Windows 中,该应用程序与 System.NotImplementedException. 中断。

版本详情:

Plugin.MediaManager.Forms:1.0.7

Xamarin 表单:4.8.0.1821

Visual Studio:16.8.3

Windows 目标版本:Windows 10 版本 1903(10.0; Build 18362)

Windows 最低版本:Windows 10 Fall Creators Update(10.0; Build 16299)

另外,我在功能下的 Package.appxmanifest 中添加了“背景媒体播放”、“互联网”、“音乐库”和“视频库”。

我还缺少什么?

【问题讨论】:

    标签: xamarin.forms uwp plugin.mediamanager.forms


    【解决方案1】:

    Plugin.MediaManager.Forms 在 xamarin uwp 中不起作用

    Plugin.MediaManager.Forms 看起来有错误,请尝试将 Plugin.MediaManager.Forms 版本降低到 0.9.6。并在 UWP 客户端项目中调用CrossMediaManager.Current.Init();,如下所示。它会起作用的。

     if (rootFrame == null)
     {
         // Create a Frame to act as the navigation context and navigate to the first page
         rootFrame = new Frame();
    
         rootFrame.NavigationFailed += OnNavigationFailed;
    
         Xamarin.Forms.Forms.Init(e);
         CrossMediaManager.Current.Init();
         ApplicationView.PreferredLaunchViewSize = new Size(600, 900); 
         ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
         
         if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
         {
             //TODO: Load state from previously suspended application
         }
    
         // Place the frame in the current Window
         Window.Current.Content = rootFrame;
     }
    

    【讨论】:

    • 版本降低是只针对windows还是针对所有项目?
    • 对所有项目都更好。
    【解决方案2】:

    我已经在 github 上看到了你的问题,现在看到了这个堆栈问题。 我在Pull Request 中解决了这个问题。 PR 合并后,您可以更新到最新版本。顺便说一句,您必须使用 UWP 10.0.18362.0(Version 1903) 分钟。

    目标版本从 uap 10.0.18362.0(版本 1903)降级到 10.0.17763(版本 1809),从版本 0.9.7 降级到 0.9.9。现在,您必须使用 v。 0.9.7.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-02
      • 2017-02-05
      • 2018-08-01
      • 2020-06-14
      • 2019-01-15
      • 2021-10-29
      • 1970-01-01
      • 2015-11-04
      相关资源
      最近更新 更多