[dart:html] Add track event to RTCPeerConnection

trackEvents and onTrack were not being generated by the event
generation and should be added to the allowlist.

Change-Id: I5bc6bcc17c56b26d7fc43e69e4867532ab1b80a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151043
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This commit is contained in:
Srujan Gaddam 2020-06-12 00:42:36 +00:00 committed by commit-bot@chromium.org
parent c607eb9637
commit 5af38092e3
4 changed files with 36 additions and 0 deletions

View file

@ -26792,6 +26792,15 @@ class RtcPeerConnection extends EventTarget {
static const EventStreamProvider<Event> signalingStateChangeEvent =
const EventStreamProvider<Event>('signalingstatechange');
/**
* Static factory designed to expose `track` events to event
* handlers that are not necessarily instances of [RtcPeerConnection].
*
* See [EventStreamProvider] for usage information.
*/
static const EventStreamProvider<RtcTrackEvent> trackEvent =
const EventStreamProvider<RtcTrackEvent>('track');
String get iceConnectionState native;
String get iceGatheringState native;
@ -26923,6 +26932,9 @@ class RtcPeerConnection extends EventTarget {
/// Stream of `signalingstatechange` events handled by this [RtcPeerConnection].
Stream<Event> get onSignalingStateChange =>
signalingStateChangeEvent.forTarget(this);
/// Stream of `track` events handled by this [RtcPeerConnection].
Stream<RtcTrackEvent> get onTrack => trackEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a

View file

@ -26837,6 +26837,15 @@ class RtcPeerConnection extends EventTarget {
static const EventStreamProvider<Event> signalingStateChangeEvent =
const EventStreamProvider<Event>('signalingstatechange');
/**
* Static factory designed to expose `track` events to event
* handlers that are not necessarily instances of [RtcPeerConnection].
*
* See [EventStreamProvider] for usage information.
*/
static const EventStreamProvider<RtcTrackEvent> trackEvent =
const EventStreamProvider<RtcTrackEvent>('track');
String get iceConnectionState native;
String get iceGatheringState native;
@ -26968,6 +26977,9 @@ class RtcPeerConnection extends EventTarget {
/// Stream of `signalingstatechange` events handled by this [RtcPeerConnection].
Stream<Event> get onSignalingStateChange =>
signalingStateChangeEvent.forTarget(this);
/// Stream of `track` events handled by this [RtcPeerConnection].
Stream<RtcTrackEvent> get onTrack => trackEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a

View file

@ -2837,6 +2837,9 @@
"onsignalingstatechange": [
"/// Stream of `signalingstatechange` events handled by this [RtcPeerConnection]."
],
"ontrack": [
"/// Stream of `track` events handled by this [RtcPeerConnection]."
],
"removestreamEvent": [
"/**",
" * Static factory designed to expose `removestream` events to event",
@ -2852,6 +2855,14 @@
" *",
" * See [EventStreamProvider] for usage information.",
" */"
],
"trackEvent": [
"/**",
" * Static factory designed to expose `track` events to event",
" * handlers that are not necessarily instances of [RtcPeerConnection].",
" *",
" * See [EventStreamProvider] for usage information.",
" */"
]
}
},

View file

@ -210,6 +210,7 @@ _html_event_types = monitored.Dict(
'RTCPeerConnection.removestream': ('removeStream', 'MediaStreamEvent'),
'RTCPeerConnection.signalingstatechange':
('signalingStateChange', 'Event'),
'RTCPeerConnection.track': ('track', 'RtcTrackEvent'),
'ScriptProcessorNode.audioprocess':
('audioProcess', 'AudioProcessingEvent'),
'ServiceWorkerGlobalScope.activate': ('activate', 'Event'),