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