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