PlayToReceiver.PlayRequested 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生於音訊或視訊播放開始時。
// Register
event_token PlayRequested(TypedEventHandler<PlayToReceiver, IInspectable const&> const& handler) const;
// Revoke with event_token
void PlayRequested(event_token const* cookie) const;
// Revoke with event_revoker
PlayToReceiver::PlayRequested_revoker PlayRequested(auto_revoke_t, TypedEventHandler<PlayToReceiver, IInspectable const&> const& handler) const;
public event TypedEventHandler<PlayToReceiver,object> PlayRequested;
function onPlayRequested(eventArgs) { /* Your code */ }
playToReceiver.addEventListener("playrequested", onPlayRequested);
playToReceiver.removeEventListener("playrequested", onPlayRequested);
- or -
playToReceiver.onplayrequested = onPlayRequested;
Public Custom Event PlayRequested As TypedEventHandler(Of PlayToReceiver, Object)
事件類型
TypedEventHandler<PlayToReceiver,IInspectable>
備註
如需建立軟體播放收件者的範例,請參閱 媒體傳播。
async void receiver_PlayRequested(
Windows.Media.PlayTo.PlayToReceiver sender,
object args)
{
await dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
VideoPlayer.Play();
});
}
Async Sub receiver_PlayRequested(
sender As Windows.Media.PlayTo.PlayToReceiver,
args As Object)
Await Dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal,
Sub()
VideoPlayer.Play()
End Sub)
End Sub