PlayToReceiver.VolumeChangeRequested 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当源音频或视频的音量已更改时发生。
// Register
event_token VolumeChangeRequested(TypedEventHandler<PlayToReceiver, VolumeChangeRequestedEventArgs const&> const& handler) const;
// Revoke with event_token
void VolumeChangeRequested(event_token const* cookie) const;
// Revoke with event_revoker
PlayToReceiver::VolumeChangeRequested_revoker VolumeChangeRequested(auto_revoke_t, TypedEventHandler<PlayToReceiver, VolumeChangeRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<PlayToReceiver,VolumeChangeRequestedEventArgs> VolumeChangeRequested;
function onVolumeChangeRequested(eventArgs) { /* Your code */ }
playToReceiver.addEventListener("volumechangerequested", onVolumeChangeRequested);
playToReceiver.removeEventListener("volumechangerequested", onVolumeChangeRequested);
- or -
playToReceiver.onvolumechangerequested = onVolumeChangeRequested;
Public Custom Event VolumeChangeRequested As TypedEventHandler(Of PlayToReceiver, VolumeChangeRequestedEventArgs)
事件类型
注解
有关创建软件“播放到”接收器的示例,请参阅 媒体强制转换。
async void receiver_VolumeChangeRequested(
Windows.Media.PlayTo.PlayToReceiver sender,
Windows.Media.PlayTo.VolumeChangeRequestedEventArgs args)
{
await dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
VideoPlayer.Volume = args.Volume;
});
}
Async Sub receiver_VolumeChangeRequested(
sender As Windows.Media.PlayTo.PlayToReceiver,
args As Windows.Media.PlayTo.VolumeChangeRequestedEventArgs)
Await Dispatcher.RunAsync(
Windows.UI.Core.CoreDispatcherPriority.Normal,
Sub()
VideoPlayer.Volume = args.Volume
End Sub)
End Sub