【问题标题】:SystemMediaTransportControl GetForCurrentView() fails in audio background task on Desktop Device Family (UWP C#SystemMediaTransportControl GetForCurrentView() 在桌面设备系列上的音频后台任务中失败(UWP C#
【发布时间】:2015-06-14 12:48:42
【问题描述】:

我正在尝试将我的 C# WP 8.1 背景音频任务带到 UWP 并且一切正常,除了尝试使用 Windows.Media.Playback.SystemMediaTransportControls.GetForCurrentView() 获取 UVC 在桌面设备上引发当前异常:“无法找到与此 MediaPlaybackControl 实例关联的适当视图。请确保已初始化视图”。 它只是一种尚未融合的行为,还是我需要通过桌面类设备上的应用程序来控制和更新 UVC?

【问题讨论】:

    标签: c# windows-10 background-task


    【解决方案1】:

    Windows 10 中有一个 API 更改。看来您应该使用 BackgroundMediaPlayer.Current.SystemMediaTransportControls。这还没有在文档中。您可以在 Windows 10 示例存储库中找到它:https://github.com/Microsoft/Windows-universal-samples/tree/master/backgroundaudio

    【讨论】:

    猜你喜欢
    • 2017-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-25
    • 1970-01-01
    相关资源
    最近更新 更多