New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 3 users

Issue metadata

Status: Fixed
Closed: Aug 2017
EstimatedDays: ----
NextAction: 2017-07-24
OS: ----
Pri: 3
Type: Launch-OWP
Launch-Accessibility: ----
Launch-Exp-Leadership: ----
Launch-Leadership: ----
Launch-Legal: ----
Launch-M-Approved: ----
Launch-M-Target: ----
Launch-Privacy: ----
Launch-Security: ----
Launch-Test: ----
Launch-UI: ----

issue 674593

Show other hotlists

Hotlists containing this issue:

Sign in to add a comment

Issue 698163: Deprecate and Remove RTCPeerConnection#getStreamById

Reported by, Mar 3 2017 Project Member

Issue description

Supported in: Chrome, Edge 15 with "Enable WebRTC 1.0" checked (not Firefox or Safari)
Standard: Removed in

WebKit has it in their IDL, but RTCPeerConnection isn't enabled in Safari:

Use counter:

Intent to Deprecate and Remove:

Comment 1 by, Mar 3 2017


Comment 2 by, Mar 3 2017

Oops, CC'd on wrong issue.

Comment 3 by, Mar 6 2017

Components: -Blink>WebRTC Blink>WebRTC>PeerConnection
Status: Assigned (was: Untriaged)

Comment 4 by, Mar 9 2017


Comment 5 by, Apr 14 2017

Usage is very low:

Attaching the 31 results from this query:
SELECT * FROM [httparchive:har.2017_03_15_chrome_requests_bodies]
WHERE body CONTAINS "RTCPeerConnection" AND body CONTAINS ".getStreamById";

It looks like most are defining a new getStreamById method and not using the built-in one, but to remove we should look through all of them to make sure.

Comment 6 by, Apr 14 2017

22.9 MB Download

Comment 7 by, Apr 14 2017

Description: Show this description

Comment 8 by, Apr 14 2017

I've analyzed the results in #6.

12 of them were in JsSIP, which for a while included rtcninja.js which wrapped getStreamById and added some logging:

10 were OpenTok.js,, which defines a getStreamById method that calls into a plugin of some sort.

2 were from, describing and not using the API. uses getStreamById() only if available, and otherwise falls back to iterating getLocalStreams().

In the remaining 6 cases, getStreamById was defined and used by the script itself, not related to the RTCPeerConnection bits of the script.

I will send an Intent to Deprecate and Remove.

Comment 9 by, Apr 14 2017

Summary: Deprecate and Remove RTCPeerConnection#getStreamById (was: Standardize or remove RTCPeerConnection#getStreamById)

Comment 10 by, Apr 14 2017

This is a polyfill for getStreamById for anyone that needs it after removal:

RTCPeerConnection.prototype.getStreamById = function(id) {
  try {
    var localStreams = this.getLocalStreams();
    var remoteStreams = this.getRemoteStreams();
    var i;
    for (i = 0; i < localStreams.length; i++) {
     if (localStreams[i].id == id)
       return localStreams[i];
    for (i = 0; i < remoteStreams.length; i++) {
     if (remoteStreams[i].id == id)
       return remoteStreams[i];
  } catch(e) {}
  return null;

Tested with appController.call_.pcClient_.pc_.getStreamById(...) on, and intentionally old-school to not depend on any new JavaScript features.

Comment 11 by, Apr 14 2017

Labels: -Type-Bug OWP-Standards-No M-60 OWP-Type-Deprecation Type-Launch-OWP

Comment 12 by, Apr 14 2017

Description: Show this description

Comment 13 by, Apr 14 2017

Description: Show this description

Comment 14 by, Apr 14 2017

Description: Show this description

Comment 15 by, Apr 17 2017


Comment 17 by, Apr 17 2017

NextAction: 2017-07-24
Deprecated, setting date to actually remove for M-62.

Comment 18 by, Jul 24 2017

The NextAction date has arrived: 2017-07-24

Comment 19 by, Aug 4 2017

Project Member
The following revision refers to this bug:

commit 48a0ca6d697c2a43d8ff67069f016daa108458fd
Author: Philip J├Ągenstedt <>
Date: Fri Aug 04 11:59:13 2017

Remove RTCPeerConnection#getStreamById

Intent to Deprecate and Remove:

Because this is also supported in Edge 15 and exists in WebKit's IDL,
add an historical.html test covering this and other non-standard
features that existed or still exist in Blink, but are no longer in the
spec, annotated here:

Bug:  698163 
Change-Id: If8eac7005a652c000d34f12c48bd04194e1e215e
Commit-Queue: Philip J├Ągenstedt <>
Reviewed-by: Guido Urdaneta <>
Cr-Commit-Position: refs/heads/master@{#491997}

Comment 20 by, Aug 4 2017

Status: Fixed (was: Assigned)

Sign in to add a comment