Bug 184911 - RTCRtpSender.replaceTrack(null) ends current track
Summary: RTCRtpSender.replaceTrack(null) ends current track
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-24 02:47 PDT by seppe
Modified: 2018-06-19 01:03 PDT (History)
9 users (show)

See Also:


Attachments
Patch (13.98 KB, patch)
2018-06-18 02:28 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-sierra-wk2 (2.79 MB, application/zip)
2018-06-18 03:41 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews124 for ios-simulator-wk2 (2.24 MB, application/zip)
2018-06-18 04:14 PDT, EWS Watchlist
no flags Details
Patch (17.44 KB, patch)
2018-06-18 05:56 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ltilve-gtk-wk2-ews for gtk-wk2 (2.84 MB, application/zip)
2018-06-18 18:14 PDT, Igalia-pontevedra EWS
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description seppe 2018-04-24 02:47:18 PDT
According to the spec, adding and then removing a track from a RTCPeerConnection can be done as follows:

let pc = new RTCPeerConnection();
let sender = pc.addTrack(track, stream);

// Negotiate,...

sender.replaceTrack(null);



This works fine on Chrome and Firefox. On Safari however, the call to replaceTrack() stops the track entirely, setting readyState to "ended" (but interestingly, not calling the onended callback). This makes it impossible to use this method to remove a track that is still used elsewhere. This is problematic, especially since pc.removeTrack(track) is buggy as well: https://bugs.webkit.org/show_bug.cgi?id=174327


This example should demonstrate the issue: https://jsfiddle.net/vt55wx9u/4/.
Comment 1 Radar WebKit Bug Importer 2018-06-03 15:09:44 PDT
<rdar://problem/40758138>
Comment 2 youenn fablet 2018-06-18 02:28:53 PDT
Created attachment 342919 [details]
Patch
Comment 3 EWS Watchlist 2018-06-18 03:41:30 PDT
Comment on attachment 342919 [details]
Patch

Attachment 342919 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/8229141

New failing tests:
imported/w3c/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.html
Comment 4 EWS Watchlist 2018-06-18 03:41:32 PDT
Created attachment 342920 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 5 EWS Watchlist 2018-06-18 04:14:10 PDT
Comment on attachment 342919 [details]
Patch

Attachment 342919 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/8229193

New failing tests:
imported/w3c/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.html
Comment 6 EWS Watchlist 2018-06-18 04:14:11 PDT
Created attachment 342923 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.4
Comment 7 youenn fablet 2018-06-18 05:56:48 PDT
Created attachment 342927 [details]
Patch
Comment 8 Igalia-pontevedra EWS 2018-06-18 18:14:27 PDT
Comment on attachment 342927 [details]
Patch

Attachment 342927 [details] did not pass gtk-wk2-ews (gtk-wk2):
Output: http://webkit-queues.webkit.org/results/8238825

New failing tests:
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
Comment 9 Igalia-pontevedra EWS 2018-06-18 18:14:31 PDT
Created attachment 342999 [details]
Archive of layout-test-results from ltilve-gtk-wk2-ews for gtk-wk2

The attached test failures were seen while running run-webkit-tests on the gtk-wk2-ews.
Bot: ltilve-gtk-wk2-ews  Port: gtk-wk2  Platform: Linux-4.16.0-0.bpo.1-amd64-x86_64-with-debian-9.4
Comment 10 youenn fablet 2018-06-18 23:54:12 PDT
Comment on attachment 342927 [details]
Patch

gtk error is unrelated
Comment 11 WebKit Commit Bot 2018-06-19 00:20:57 PDT
Comment on attachment 342927 [details]
Patch

Clearing flags on attachment: 342927

Committed r232956: <https://trac.webkit.org/changeset/232956>
Comment 12 WebKit Commit Bot 2018-06-19 00:20:59 PDT
All reviewed patches have been landed.  Closing bug.