{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/webrtc-pc/issues/1920","repository_url":"https://api.github.com/repos/w3c/webrtc-pc","labels_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/1920/labels{/name}","comments_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/1920/comments","events_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/1920/events","html_url":"https://github.com/w3c/webrtc-pc/issues/1920","id":336908734,"node_id":"MDU6SXNzdWUzMzY5MDg3MzQ=","number":1920,"title":"Unable to figure out which receivers are \"active\".","user":{"login":"henbos","id":11347890,"node_id":"MDQ6VXNlcjExMzQ3ODkw","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},"labels":[{"id":124889633,"node_id":"MDU6TGFiZWwxMjQ4ODk2MzM=","url":"https://api.github.com/repos/w3c/webrtc-pc/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"henbos","id":11347890,"node_id":"MDQ6VXNlcjExMzQ3ODkw","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},"assignees":[{"login":"henbos","id":11347890,"node_id":"MDQ6VXNlcjExMzQ3ODkw","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}],"milestone":null,"comments":7,"created_at":"2018-06-29T08:25:52Z","updated_at":"2018-07-05T12:32:11Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Based on discussions at #1890, we are unable to figure out which receivers are \"active\" or not after setRemoteDescription().\r\n```\r\n1. const offer = await caller.createOffer();\r\n2. await caller.setLocalDescription(offer);\r\n3. await callee.setRemoteDescription(offer);\r\n4. const answer = await callee.createAnswer();\r\n5. await callee.setLocalDescription(answer);\r\n6. await caller.setRemoteDescription(answer);\r\n```\r\nThe recever's currentDirection is updated at step 5 (half-way through the answer). Likely the application would like to know at 3 when the ontrack events fire.\r\n\r\nToday the application is forced to piece together from ontrack and other events what the state of the receivers really are. It's confusing having a pc with a set of receivers and not be able to figure out what their state are without wiring up events and listening to history.\r\n\r\nWe no longer support getRemoteStreams() but it should be possible to do the equivalent, i.e. \"get active receivers\"."},"comment":{"url":"https://api.github.com/repos/w3c/webrtc-pc/issues/comments/402706696","html_url":"https://github.com/w3c/webrtc-pc/issues/1920#issuecomment-402706696","issue_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/1920","id":402706696,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjcwNjY5Ng==","user":{"login":"henbos","id":11347890,"node_id":"MDQ6VXNlcjExMzQ3ODkw","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},"created_at":"2018-07-05T12:32:11Z","updated_at":"2018-07-05T12:32:11Z","author_association":"CONTRIBUTOR","body":"To summarize:\r\n- [[Direction]] is whatever we want to negotiate. This does not work for either offerer or answerer because the notion of \"active\" implies some negotiation has taken place.\r\n- [[CurrentDirection]] is defined as _the last applied answer_. This works for the offerer, but not the answerer until answerer does SLD(answer). The notion of \"active\" includes the \"ontrack\"-transceivers, but SLD(answer) happens after \"ontrack\".\r\n- [[FiredDirection]] is defined as the last applied SDP direction, regardless if it is an offer or answer. This works for the answerer, but for the offerer this would include non-\"ontrack\"-transceivers that have not been confirmed by the remote endpoint yet.\r\n\r\nThis gets trickier. For early media, a receiver might become \"active\" either by applying a remote description, or by early media arriving to unmute the track.\r\n\r\n**Proposal**\r\n\r\nI think if _any_ of the following is true the receiver is \"active\":\r\n- `transceiver.currentDirection == 'sendrecv' || transceiver.currentDirection == 'recvonly'`: This covers any case where answer has been applied (such as when we are in a stable state, or when we have setLocalDescription(answer) and rejected transceivers that were previously offered by the remote endpoint).\r\n- `transceiver.receiver.track.muted == false`: This covers case where media has arrived, even if answer has not been applied yet, such as when receiving _early media_ from the answerer to the offerer.\r\n- `pc.signalingState == 'have-remote-offer' && (transceiver.[[FiredDirection]] == 'sendrecv' || transceiver.[[FiredDirection]] == 'recvonly')`: This covers \"ontrack\"-transceivers that were fired by setRemoteDescription(offer), but whose currentDirection does not reflect this because we have not done setLocalDescription(answer) yet.\r\n\r\nWe should add:\r\n```\r\npartial interface RTCRtpReceiver {\r\n    readonly attribute boolean isActive;\r\n}\r\n```\r\nThat is defined as any of the above criteria being true. This is not applicable to ORTC since it is dependent on RTCPeerConnection and the state of SDP offer/answer."}}
{"actor":{"display_login":"henbos"}}