Skip to content

Commit 5af3809

Browse files
srujzscommit-bot@chromium.org
authored andcommitted
[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 <[email protected]> Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Srujan Gaddam <[email protected]>
1 parent c607eb9 commit 5af3809

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

sdk/lib/html/dart2js/html_dart2js.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26792,6 +26792,15 @@ class RtcPeerConnection extends EventTarget {
2679226792
static const EventStreamProvider<Event> signalingStateChangeEvent =
2679326793
const EventStreamProvider<Event>('signalingstatechange');
2679426794

26795+
/**
26796+
* Static factory designed to expose `track` events to event
26797+
* handlers that are not necessarily instances of [RtcPeerConnection].
26798+
*
26799+
* See [EventStreamProvider] for usage information.
26800+
*/
26801+
static const EventStreamProvider<RtcTrackEvent> trackEvent =
26802+
const EventStreamProvider<RtcTrackEvent>('track');
26803+
2679526804
String get iceConnectionState native;
2679626805

2679726806
String get iceGatheringState native;
@@ -26923,6 +26932,9 @@ class RtcPeerConnection extends EventTarget {
2692326932
/// Stream of `signalingstatechange` events handled by this [RtcPeerConnection].
2692426933
Stream<Event> get onSignalingStateChange =>
2692526934
signalingStateChangeEvent.forTarget(this);
26935+
26936+
/// Stream of `track` events handled by this [RtcPeerConnection].
26937+
Stream<RtcTrackEvent> get onTrack => trackEvent.forTarget(this);
2692626938
}
2692726939
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2692826940
// for details. All rights reserved. Use of this source code is governed by a

sdk_nnbd/lib/html/dart2js/html_dart2js.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26837,6 +26837,15 @@ class RtcPeerConnection extends EventTarget {
2683726837
static const EventStreamProvider<Event> signalingStateChangeEvent =
2683826838
const EventStreamProvider<Event>('signalingstatechange');
2683926839

26840+
/**
26841+
* Static factory designed to expose `track` events to event
26842+
* handlers that are not necessarily instances of [RtcPeerConnection].
26843+
*
26844+
* See [EventStreamProvider] for usage information.
26845+
*/
26846+
static const EventStreamProvider<RtcTrackEvent> trackEvent =
26847+
const EventStreamProvider<RtcTrackEvent>('track');
26848+
2684026849
String get iceConnectionState native;
2684126850

2684226851
String get iceGatheringState native;
@@ -26968,6 +26977,9 @@ class RtcPeerConnection extends EventTarget {
2696826977
/// Stream of `signalingstatechange` events handled by this [RtcPeerConnection].
2696926978
Stream<Event> get onSignalingStateChange =>
2697026979
signalingStateChangeEvent.forTarget(this);
26980+
26981+
/// Stream of `track` events handled by this [RtcPeerConnection].
26982+
Stream<RtcTrackEvent> get onTrack => trackEvent.forTarget(this);
2697126983
}
2697226984
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2697326985
// for details. All rights reserved. Use of this source code is governed by a

tools/dom/docs/docs.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,6 +2837,9 @@
28372837
"onsignalingstatechange": [
28382838
"/// Stream of `signalingstatechange` events handled by this [RtcPeerConnection]."
28392839
],
2840+
"ontrack": [
2841+
"/// Stream of `track` events handled by this [RtcPeerConnection]."
2842+
],
28402843
"removestreamEvent": [
28412844
"/**",
28422845
" * Static factory designed to expose `removestream` events to event",
@@ -2852,6 +2855,14 @@
28522855
" *",
28532856
" * See [EventStreamProvider] for usage information.",
28542857
" */"
2858+
],
2859+
"trackEvent": [
2860+
"/**",
2861+
" * Static factory designed to expose `track` events to event",
2862+
" * handlers that are not necessarily instances of [RtcPeerConnection].",
2863+
" *",
2864+
" * See [EventStreamProvider] for usage information.",
2865+
" */"
28552866
]
28562867
}
28572868
},

tools/dom/scripts/htmleventgenerator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
'RTCPeerConnection.removestream': ('removeStream', 'MediaStreamEvent'),
211211
'RTCPeerConnection.signalingstatechange':
212212
('signalingStateChange', 'Event'),
213+
'RTCPeerConnection.track': ('track', 'RtcTrackEvent'),
213214
'ScriptProcessorNode.audioprocess':
214215
('audioProcess', 'AudioProcessingEvent'),
215216
'ServiceWorkerGlobalScope.activate': ('activate', 'Event'),

0 commit comments

Comments
 (0)