如何在 UWP 中添加 mediaplayerelements 控件
How to add mediaplayerelements controls in UWP
如何在 MediaPlayerElement
上启用 play、pause 等基本按钮控件或 [=13] 等高级功能=]快进 ?
MediaPlayerElement 已经具备 Pause/Play、Stop、 的所有基本控件FastForward 等你只需要设置 AreTransportControlsEnabled = true 并且你将在你的 mediaplayerelement 上拥有所有基本控件。
<MediaPlayerElement x:Name="mediaPlayer"
Source="ms-appx:///Media/video1.mp4"
AreTransportControlsEnabled="True" />
并启用 FastForward 之类的按钮,您可以像这样在 MediaTransportControls 上明确启用它们:
<MediaPlayerElement x:Name="mediaElement1" Source="ms-appx:///Assets/audio.wma"
AreTransportControlsEnabled="True">
<MediaPlayerElement.TransportControls>
<MediaTransportControls IsZoomButtonVisible="False"
IsFastForwardButtonVisible="True"
IsPlaybackRateButtonVisible="True" IsPlaybackRateEnabled="True"/>
</MediaPlayerElement.TransportControls>
</MediaPlayerElement>
you can notice apart from fastforward button there are many other buttons to enable advanced features as well like playbackrate button and zoombutton.
如何在 MediaPlayerElement
上启用 play、pause 等基本按钮控件或 [=13] 等高级功能=]快进 ?
MediaPlayerElement 已经具备 Pause/Play、Stop、 的所有基本控件FastForward 等你只需要设置 AreTransportControlsEnabled = true 并且你将在你的 mediaplayerelement 上拥有所有基本控件。
<MediaPlayerElement x:Name="mediaPlayer"
Source="ms-appx:///Media/video1.mp4"
AreTransportControlsEnabled="True" />
并启用 FastForward 之类的按钮,您可以像这样在 MediaTransportControls 上明确启用它们:
<MediaPlayerElement x:Name="mediaElement1" Source="ms-appx:///Assets/audio.wma"
AreTransportControlsEnabled="True">
<MediaPlayerElement.TransportControls>
<MediaTransportControls IsZoomButtonVisible="False"
IsFastForwardButtonVisible="True"
IsPlaybackRateButtonVisible="True" IsPlaybackRateEnabled="True"/>
</MediaPlayerElement.TransportControls>
</MediaPlayerElement>
you can notice apart from fastforward button there are many other buttons to enable advanced features as well like playbackrate button and zoombutton.