[UWP]如何在桌面Windows 10上本地测试系统媒体传输控制? [英] [UWP]How to test System Media Transport Controls locally on desktop Windows 10 ?

查看:72
本文介绍了[UWP]如何在桌面Windows 10上本地测试系统媒体传输控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在桌面Windows 10上本地测试系统媒体传输控制?

How to test System Media Transport Controls locally on desktop Windows 10 ?

我想在桌面上测试它。

I want to test it on my Desktop.

哪里可以在Widnows 10上找到系统媒体传输控件模拟?

Where I can find System Media Transport Controls analog on Widnows 10 ?

推荐答案

您好SmartWhy,

Hi SmartWhy,

您是否使用  系统媒体传输控制样本到那个?

Do you use the System media transport controls sample to the that?

如果是,样本使用  MediaPlayerElement播放音乐文件。

If so, the sample use the MediaPlayerElement to play the music file.

如果您使用MediaElement播放媒体,则必须手动控制SMTC。

有关详细信息,请参阅  系统媒体传输控制的手动控制

For more info, see Manual control of the System Media Transport Controls.

有一个官方样本可以手动控制SMTC,请在此链接中查看:  https://github.com/Microsoft/Windows-universal-samples/tree/6370138b150ca8a34ff86de376ab6408c5587f5d/Samples/BackgroundMediaPlayback

There is an official sample that manually control the SMTC, please refer it in this link: https://github.com/Microsoft/Windows-universal-samples/tree/6370138b150ca8a34ff86de376ab6408c5587f5d/Samples/BackgroundMediaPlayback.

在示例中,它定义了PlayerViewModel类来做到这一点。当我们指向任务栏上的AppIcon时,我们可以点击系统媒体传输控件的按钮。

In the sample, it define the PlayerViewModel class to do that. And we can click the Button of System Media Transport Controls when we point on the AppIcon on the taskbar.

从Windows 10,版本1607开始,使用MediaPlayer的UWP应用程序默认情况下,播放媒体的类自动与系统媒体传输控制(SMTC)集成。对于大多数情况,这是与SMTC交互的推荐方式。
有关自定义SMTC与MediaPlayer的默认集成的详细信息,请参阅 
与系统媒体传输集成
控制

最诚挚的问候,

Jayden Gu

Jayden Gu


这篇关于[UWP]如何在桌面Windows 10上本地测试系统媒体传输控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆