Project: chromium Issues People Development process History Sign in
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
Status: Fixed
Owner:
Closed: Aug 4
Cc:
Components:
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: ----

Blocking:
issue 674593


Show other hotlists

Hotlists containing this issue:
Non-Standard-IDL


Sign in to add a comment
Deprecate and Remove RTCPeerConnection#getStreamById
Project Member Reported by foolip@chromium.org, Mar 3 2017 Back to list
Test: https://jsbin.com/bivatuv/edit?html,output
Supported in: Chrome, Edge 15 with "Enable WebRTC 1.0" checked (not Firefox or Safari)
Standard: Removed in https://github.com/w3c/webrtc-pc/pull/18

WebKit has it in their IDL, but RTCPeerConnection isn't enabled in Safari:
https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

Use counter: https://www.chromestatus.com/metrics/feature/timeline/popularity/1645

Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/m4DNZbLMkRo/9fzhqNwqBQAJ
 
Cc: pea...@gmail.com
Cc: -pea...@gmail.com
Oops, CC'd on wrong issue.
Components: -Blink>WebRTC Blink>WebRTC>PeerConnection
Owner: guidou@chromium.org
Status: Assigned
Cc: foolip@chromium.org
Usage is very low:
https://www.chromestatus.com/metrics/feature/timeline/popularity/1645

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.
results-20170414-123255.json
22.9 MB Download
Description: Show this description
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:
https://github.com/eface2face/rtcninja.js/blob/dc4fff27105a83126193e29c1c63d9cf0c54f099/lib/RTCPeerConnection.js#L301
https://github.com/versatica/JsSIP/pull/408

10 were OpenTok.js, https://static.opentok.com/v2/js/opentok.js, which defines a getStreamById method that calls into a plugin of some sort.

2 were from devdocs.io, describing and not using the API.

http://www.cubeslam.com/ 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.
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 https://appr.tc, 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
Cc: -foolip@chromium.org guidou@chromium.org
Owner: foolip@chromium.org
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 bugdroid1@chromium.org, Aug 4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48a0ca6d697c2a43d8ff67069f016daa108458fd

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

Remove RTCPeerConnection#getStreamById

Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/m4DNZbLMkRo/9fzhqNwqBQAJ

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:
https://chromium.googlesource.com/chromium/src/+/e70c6e15ba896a2e88d0dc05f1a20fb3d4befabf

Bug:  698163 
TBR: timvolodine@chromium.org
Change-Id: If8eac7005a652c000d34f12c48bd04194e1e215e
Reviewed-on: https://chromium-review.googlesource.com/597668
Commit-Queue: Philip J├Ągenstedt <foolip@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491997}
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt
[add] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/LayoutTests/external/wpt/webrtc/historical-expected.txt
[add] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/LayoutTests/external/wpt/webrtc/historical.html
[delete] https://crrev.com/3fcca5f0cd8bdd3ebe7901a06df917a72be75453/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-AddRemoveStream-expected.txt
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-AddRemoveStream.html
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl
[modify] https://crrev.com/48a0ca6d697c2a43d8ff67069f016daa108458fd/third_party/WebKit/public/platform/web_feature.mojom

Status: Fixed
Sign in to add a comment