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
OOO until March 20
Closed: Aug 2017
EstimatedDays: ----
NextAction: 2017-07-24
OS: ----
Pri: 3
Type: Launch-OWP
Launch-Accessibility: ----
Launch-Legal: ----
Launch-M-Approved: ----
Launch-M-Target: ----
Launch-Privacy: ----
Launch-Security: ----
Launch-Status: ----
Launch-Test: ----
Launch-UI: ----
Product-Review: ----

issue 674593

Show other hotlists

Hotlists containing this issue:

Sign in to add a comment

Deprecate and Remove RTCPeerConnection#getStreamById

Project Member Reported by, Mar 3 2017 Back to list

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:
Oops, CC'd on wrong issue.
Components: -Blink>WebRTC Blink>WebRTC>PeerConnection
Status: Assigned

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)
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.
Labels: -Type-Bug OWP-Standards-No M-60 OWP-Type-Deprecation Type-Launch-OWP
Description: Show this description
Description: Show this description
Description: Show this description
NextAction: 2017-07-24
Deprecated, setting date to actually remove for M-62.
The NextAction date has arrived: 2017-07-24
Project Member

Comment 19 by, Aug 4 2017

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}

Status: Fixed

Sign in to add a comment