{"action":"created","comment":{"url":"https://api.github.com/repos/webrtc/adapter/pulls/comments/180105774","pull_request_review_id":110468135,"id":180105774,"diff_hunk":"@@ -191,6 +191,65 @@ module.exports = {\n     }\n   },\n \n+  shimSenderGetStats: function(window) {\n+    if (!(typeof window === 'object' && window.RTCPeerConnection)) {\n+      return;\n+    }\n+    if (window.RTCRtpSender && 'getStats' in window.RTCRtpSender.prototype) {\n+      return;\n+    }\n+    var origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n+    if (origGetSenders) {\n+      window.RTCPeerConnection.prototype.getSenders = function() {\n+        var pc = this;\n+        var senders = origGetSenders.apply(pc, []);\n+        senders.forEach(function(sender) {\n+          sender._pc = pc;\n+        });\n+        return senders;\n+      };\n+    }\n+\n+    var origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n+    if (origAddTrack) {\n+      window.RTCPeerConnection.prototype.addTrack = function() {\n+        var sender = origAddTrack.apply(this, arguments);\n+        sender._pc = this;\n+        return sender;\n+      };\n+    }\n+    window.RTCRtpSender.prototype.getStats = function() {\n+      return this._pc.getStats();","path":"src/js/chrome/chrome_shim.js","position":32,"original_position":32,"commit_id":"0de1bdef6fbf1fa8555db50c464d3a25204af28d","original_commit_id":"0de1bdef6fbf1fa8555db50c464d3a25204af28d","user":{"login":"henbos","id":11347890,"avatar_url":"https://avatars2.githubusercontent.com/u/11347890?v=4","gravatar_id":"","url":"https://api.github.com/users/henbos","html_url":"https://github.com/henbos","followers_url":"https://api.github.com/users/henbos/followers","following_url":"https://api.github.com/users/henbos/following{/other_user}","gists_url":"https://api.github.com/users/henbos/gists{/gist_id}","starred_url":"https://api.github.com/users/henbos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henbos/subscriptions","organizations_url":"https://api.github.com/users/henbos/orgs","repos_url":"https://api.github.com/users/henbos/repos","events_url":"https://api.github.com/users/henbos/events{/privacy}","received_events_url":"https://api.github.com/users/henbos/received_events","type":"User","site_admin":false},"body":"sender/receiver.getStats() is not the same as pc.getStats().\r\n\r\nRunning this...\r\nhttps://jsfiddle.net/8aLysna5/19/\r\nhttps://jsfiddle.net/8aLysna5/20/\r\nIt seems that Firefox (52.6.0) does not implement sender/receiver.getStats(), and the selector version that they do implement, pc.getStats(track), DOES filter out unrelated outboundrtp streams.\r\n\r\nIf Firefox's sender/receiver getStats() was the same as pc.getStats() then this might make sense, but it doesn't seem to be the case and Chrome is shipping proper support in M67.","created_at":"2018-04-09T14:07:26Z","updated_at":"2018-04-09T14:07:27Z","html_url":"https://github.com/webrtc/adapter/pull/809#discussion_r180105774","pull_request_url":"https://api.github.com/repos/webrtc/adapter/pulls/809","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/comments/180105774"},"html":{"href":"https://github.com/webrtc/adapter/pull/809#discussion_r180105774"},"pull_request":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/809"}}},"pull_request":{"url":"https://api.github.com/repos/webrtc/adapter/pulls/809","id":180319061,"html_url":"https://github.com/webrtc/adapter/pull/809","diff_url":"https://github.com/webrtc/adapter/pull/809.diff","patch_url":"https://github.com/webrtc/adapter/pull/809.patch","issue_url":"https://api.github.com/repos/webrtc/adapter/issues/809","number":809,"state":"open","locked":false,"title":"chrome: add naive shim for sender/receiver getStats","user":{"login":"fippo","id":289731,"avatar_url":"https://avatars1.githubusercontent.com/u/289731?v=4","gravatar_id":"","url":"https://api.github.com/users/fippo","html_url":"https://github.com/fippo","followers_url":"https://api.github.com/users/fippo/followers","following_url":"https://api.github.com/users/fippo/following{/other_user}","gists_url":"https://api.github.com/users/fippo/gists{/gist_id}","starred_url":"https://api.github.com/users/fippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fippo/subscriptions","organizations_url":"https://api.github.com/users/fippo/orgs","repos_url":"https://api.github.com/users/fippo/repos","events_url":"https://api.github.com/users/fippo/events{/privacy}","received_events_url":"https://api.github.com/users/fippo/received_events","type":"User","site_admin":false},"body":"adds a naive shim for sender/receiver getStats which returns\r\nthe full, unfilterered peerconnection stats","created_at":"2018-04-09T13:58:11Z","updated_at":"2018-04-09T14:07:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f91f42018450f5051f77d43bfc108713fd287f6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":173972098,"url":"https://api.github.com/repos/webrtc/adapter/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/webrtc/adapter/pulls/809/commits","review_comments_url":"https://api.github.com/repos/webrtc/adapter/pulls/809/comments","review_comment_url":"https://api.github.com/repos/webrtc/adapter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webrtc/adapter/issues/809/comments","statuses_url":"https://api.github.com/repos/webrtc/adapter/statuses/0de1bdef6fbf1fa8555db50c464d3a25204af28d","head":{"label":"fippo:sender-receiver-stats","ref":"sender-receiver-stats","sha":"0de1bdef6fbf1fa8555db50c464d3a25204af28d","user":{"login":"fippo","id":289731,"avatar_url":"https://avatars1.githubusercontent.com/u/289731?v=4","gravatar_id":"","url":"https://api.github.com/users/fippo","html_url":"https://github.com/fippo","followers_url":"https://api.github.com/users/fippo/followers","following_url":"https://api.github.com/users/fippo/following{/other_user}","gists_url":"https://api.github.com/users/fippo/gists{/gist_id}","starred_url":"https://api.github.com/users/fippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fippo/subscriptions","organizations_url":"https://api.github.com/users/fippo/orgs","repos_url":"https://api.github.com/users/fippo/repos","events_url":"https://api.github.com/users/fippo/events{/privacy}","received_events_url":"https://api.github.com/users/fippo/received_events","type":"User","site_admin":false},"repo":{"id":30330866,"name":"adapter","full_name":"fippo/adapter","owner":{"login":"fippo","id":289731,"avatar_url":"https://avatars1.githubusercontent.com/u/289731?v=4","gravatar_id":"","url":"https://api.github.com/users/fippo","html_url":"https://github.com/fippo","followers_url":"https://api.github.com/users/fippo/followers","following_url":"https://api.github.com/users/fippo/following{/other_user}","gists_url":"https://api.github.com/users/fippo/gists{/gist_id}","starred_url":"https://api.github.com/users/fippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fippo/subscriptions","organizations_url":"https://api.github.com/users/fippo/orgs","repos_url":"https://api.github.com/users/fippo/repos","events_url":"https://api.github.com/users/fippo/events{/privacy}","received_events_url":"https://api.github.com/users/fippo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fippo/adapter","description":"working copy of webrtc/adapter. File issues for Edge stuff here","fork":true,"url":"https://api.github.com/repos/fippo/adapter","forks_url":"https://api.github.com/repos/fippo/adapter/forks","keys_url":"https://api.github.com/repos/fippo/adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fippo/adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fippo/adapter/teams","hooks_url":"https://api.github.com/repos/fippo/adapter/hooks","issue_events_url":"https://api.github.com/repos/fippo/adapter/issues/events{/number}","events_url":"https://api.github.com/repos/fippo/adapter/events","assignees_url":"https://api.github.com/repos/fippo/adapter/assignees{/user}","branches_url":"https://api.github.com/repos/fippo/adapter/branches{/branch}","tags_url":"https://api.github.com/repos/fippo/adapter/tags","blobs_url":"https://api.github.com/repos/fippo/adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fippo/adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fippo/adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/fippo/adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fippo/adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/fippo/adapter/languages","stargazers_url":"https://api.github.com/repos/fippo/adapter/stargazers","contributors_url":"https://api.github.com/repos/fippo/adapter/contributors","subscribers_url":"https://api.github.com/repos/fippo/adapter/subscribers","subscription_url":"https://api.github.com/repos/fippo/adapter/subscription","commits_url":"https://api.github.com/repos/fippo/adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/fippo/adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/fippo/adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/fippo/adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/fippo/adapter/contents/{+path}","compare_url":"https://api.github.com/repos/fippo/adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fippo/adapter/merges","archive_url":"https://api.github.com/repos/fippo/adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fippo/adapter/downloads","issues_url":"https://api.github.com/repos/fippo/adapter/issues{/number}","pulls_url":"https://api.github.com/repos/fippo/adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/fippo/adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/fippo/adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fippo/adapter/labels{/name}","releases_url":"https://api.github.com/repos/fippo/adapter/releases{/id}","deployments_url":"https://api.github.com/repos/fippo/adapter/deployments","created_at":"2015-02-05T01:20:35Z","updated_at":"2018-03-31T16:07:11Z","pushed_at":"2018-04-09T13:56:09Z","git_url":"git://github.com/fippo/adapter.git","ssh_url":"git@github.com:fippo/adapter.git","clone_url":"https://github.com/fippo/adapter.git","svn_url":"https://github.com/fippo/adapter","homepage":"","size":5187,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":3,"open_issues":8,"watchers":1,"default_branch":"master"}},"base":{"label":"webrtc:master","ref":"master","sha":"62d9c75efe4dbafdba290f769c48bc4eb4d83a74","user":{"login":"webrtc","id":10526312,"avatar_url":"https://avatars2.githubusercontent.com/u/10526312?v=4","gravatar_id":"","url":"https://api.github.com/users/webrtc","html_url":"https://github.com/webrtc","followers_url":"https://api.github.com/users/webrtc/followers","following_url":"https://api.github.com/users/webrtc/following{/other_user}","gists_url":"https://api.github.com/users/webrtc/gists{/gist_id}","starred_url":"https://api.github.com/users/webrtc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webrtc/subscriptions","organizations_url":"https://api.github.com/users/webrtc/orgs","repos_url":"https://api.github.com/users/webrtc/repos","events_url":"https://api.github.com/users/webrtc/events{/privacy}","received_events_url":"https://api.github.com/users/webrtc/received_events","type":"Organization","site_admin":false},"repo":{"id":30027163,"name":"adapter","full_name":"webrtc/adapter","owner":{"login":"webrtc","id":10526312,"avatar_url":"https://avatars2.githubusercontent.com/u/10526312?v=4","gravatar_id":"","url":"https://api.github.com/users/webrtc","html_url":"https://github.com/webrtc","followers_url":"https://api.github.com/users/webrtc/followers","following_url":"https://api.github.com/users/webrtc/following{/other_user}","gists_url":"https://api.github.com/users/webrtc/gists{/gist_id}","starred_url":"https://api.github.com/users/webrtc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webrtc/subscriptions","organizations_url":"https://api.github.com/users/webrtc/orgs","repos_url":"https://api.github.com/users/webrtc/repos","events_url":"https://api.github.com/users/webrtc/events{/privacy}","received_events_url":"https://api.github.com/users/webrtc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webrtc/adapter","description":"Shim to insulate apps from spec changes and prefix differences. Latest adapter.js release:","fork":false,"url":"https://api.github.com/repos/webrtc/adapter","forks_url":"https://api.github.com/repos/webrtc/adapter/forks","keys_url":"https://api.github.com/repos/webrtc/adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webrtc/adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webrtc/adapter/teams","hooks_url":"https://api.github.com/repos/webrtc/adapter/hooks","issue_events_url":"https://api.github.com/repos/webrtc/adapter/issues/events{/number}","events_url":"https://api.github.com/repos/webrtc/adapter/events","assignees_url":"https://api.github.com/repos/webrtc/adapter/assignees{/user}","branches_url":"https://api.github.com/repos/webrtc/adapter/branches{/branch}","tags_url":"https://api.github.com/repos/webrtc/adapter/tags","blobs_url":"https://api.github.com/repos/webrtc/adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webrtc/adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webrtc/adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/webrtc/adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webrtc/adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/webrtc/adapter/languages","stargazers_url":"https://api.github.com/repos/webrtc/adapter/stargazers","contributors_url":"https://api.github.com/repos/webrtc/adapter/contributors","subscribers_url":"https://api.github.com/repos/webrtc/adapter/subscribers","subscription_url":"https://api.github.com/repos/webrtc/adapter/subscription","commits_url":"https://api.github.com/repos/webrtc/adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/webrtc/adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/webrtc/adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/webrtc/adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/webrtc/adapter/contents/{+path}","compare_url":"https://api.github.com/repos/webrtc/adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webrtc/adapter/merges","archive_url":"https://api.github.com/repos/webrtc/adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webrtc/adapter/downloads","issues_url":"https://api.github.com/repos/webrtc/adapter/issues{/number}","pulls_url":"https://api.github.com/repos/webrtc/adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/webrtc/adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/webrtc/adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webrtc/adapter/labels{/name}","releases_url":"https://api.github.com/repos/webrtc/adapter/releases{/id}","deployments_url":"https://api.github.com/repos/webrtc/adapter/deployments","created_at":"2015-01-29T15:41:40Z","updated_at":"2018-04-09T12:42:11Z","pushed_at":"2018-04-09T13:58:12Z","git_url":"git://github.com/webrtc/adapter.git","ssh_url":"git@github.com:webrtc/adapter.git","clone_url":"https://github.com/webrtc/adapter.git","svn_url":"https://github.com/webrtc/adapter","homepage":"https://webrtc.github.io/adapter/adapter-latest.js","size":5381,"stargazers_count":1406,"watchers_count":1406,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":340,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":340,"open_issues":9,"watchers":1406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/809"},"html":{"href":"https://github.com/webrtc/adapter/pull/809"},"issue":{"href":"https://api.github.com/repos/webrtc/adapter/issues/809"},"comments":{"href":"https://api.github.com/repos/webrtc/adapter/issues/809/comments"},"review_comments":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/809/comments"},"review_comment":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/809/commits"},"statuses":{"href":"https://api.github.com/repos/webrtc/adapter/statuses/0de1bdef6fbf1fa8555db50c464d3a25204af28d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"henbos"}}