PlayToReceiver.CurrentTimeChangeRequested 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生於播放的時間位置已變更時。
// Register
event_token CurrentTimeChangeRequested(TypedEventHandler<PlayToReceiver, CurrentTimeChangeRequestedEventArgs const&> const& handler) const;
// Revoke with event_token
void CurrentTimeChangeRequested(event_token const* cookie) const;
// Revoke with event_revoker
PlayToReceiver::CurrentTimeChangeRequested_revoker CurrentTimeChangeRequested(auto_revoke_t, TypedEventHandler<PlayToReceiver, CurrentTimeChangeRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<PlayToReceiver,CurrentTimeChangeRequestedEventArgs> CurrentTimeChangeRequested;
function onCurrentTimeChangeRequested(eventArgs) { /* Your code */ }
playToReceiver.addEventListener("currenttimechangerequested", onCurrentTimeChangeRequested);
playToReceiver.removeEventListener("currenttimechangerequested", onCurrentTimeChangeRequested);
- or -
playToReceiver.oncurrenttimechangerequested = onCurrentTimeChangeRequested;
Public Custom Event CurrentTimeChangeRequested As TypedEventHandler(Of PlayToReceiver, CurrentTimeChangeRequestedEventArgs)
事件類型
備註
如需建立軟體播放收件者的範例,請參閱 媒體傳播。
async void receiver_CurrentTimeChangeRequested(
Windows.Media.PlayTo.PlayToReceiver sender,
Windows.Media.PlayTo.CurrentTimeChangeRequestedEventArgs args)
{
await dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
VideoPlayer.Position = args.Time;
receiver.NotifySeeking();
seeking = true;
});
}
Async Sub receiver_CurrentTimeChangeRequested(
sender As Windows.Media.PlayTo.PlayToReceiver,
args As Windows.Media.PlayTo.CurrentTimeChangeRequestedEventArgs)
Await Dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal,
Sub()
VideoPlayer.Position = args.Time
receiver.NotifySeeking()
seeking = True
End Sub)
End Sub