PlayToReceiver.PlaybackRateChangeRequested 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当音频或视频播放的速率更改时发生。
// Register
event_token PlaybackRateChangeRequested(TypedEventHandler<PlayToReceiver, PlaybackRateChangeRequestedEventArgs const&> const& handler) const;
// Revoke with event_token
void PlaybackRateChangeRequested(event_token const* cookie) const;
// Revoke with event_revoker
PlayToReceiver::PlaybackRateChangeRequested_revoker PlaybackRateChangeRequested(auto_revoke_t, TypedEventHandler<PlayToReceiver, PlaybackRateChangeRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<PlayToReceiver,PlaybackRateChangeRequestedEventArgs> PlaybackRateChangeRequested;
function onPlaybackRateChangeRequested(eventArgs) { /* Your code */ }
playToReceiver.addEventListener("playbackratechangerequested", onPlaybackRateChangeRequested);
playToReceiver.removeEventListener("playbackratechangerequested", onPlaybackRateChangeRequested);
- or -
playToReceiver.onplaybackratechangerequested = onPlaybackRateChangeRequested;
Public Custom Event PlaybackRateChangeRequested As TypedEventHandler(Of PlayToReceiver, PlaybackRateChangeRequestedEventArgs)
事件类型
注解
有关创建软件“播放到”接收器的示例,请参阅 媒体转换。
async void receiver_PlaybackRateChangeRequested(
Windows.Media.PlayTo.PlayToReceiver sender,
Windows.Media.PlayTo.PlaybackRateChangeRequestedEventArgs args)
{
await dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
VideoPlayer.PlaybackRate = args.Rate;
});
}
Async Sub receiver_PlaybackRateChangeRequested(
sender As Windows.Media.PlayTo.PlayToReceiver,
args As Windows.Media.PlayTo.PlaybackRateChangeRequestedEventArgs)
Await Dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal,
Sub()
VideoPlayer.PlaybackRate = args.Rate
End Sub)
End Sub