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