W3C home > Mailing lists > Public > public-webrtc@w3.org > July 2017

[webrtc-pc] Transceiver kind definition is circular.

From: jan-ivar via GitHub <sysbot+gh@w3.org>
Date: Mon, 10 Jul 2017 15:38:38 +0000
To: public-webrtc@w3.org
Message-ID: <issues.opened-241756559-1499701116-sysbot+gh@w3.org>
jan-ivar has just created a new issue for https://github.com/w3c/webrtc-pc:

== Transceiver kind definition is circular. ==
@fippo asked: "so i can determine the kind of an RTCRtpSender by looking at `sender.track.kind`, right? - now... what if I called `sender.replaceTrack(null)`?"

Interestingly, the [replaceTrack algorithm](http://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-replacetrack) says: *"If `withTrack` is non-null and `withTrack.kind` differs from the [transceiver kind](http://w3c.github.io/webrtc-pc/#dfn-transceiver-kind) of transceiver, return a promise rejected with a newly created `TypeError`."*

Encouraging, except [transceiver kind](http://w3c.github.io/webrtc-pc/#dfn-transceiver-kind) is defined as: *"The* ***transceiver kind*** *of an RTCRtpTransceiver is defined by the kind of the associated RTCRtpReceiver 's MediaStreamTrack object."*

A circular definition.

We should fix transceiver kind to be an internal slot, so the kind information is not lost, to outlaw:
```js
let sender = addTrack(stream.getVideoTracks()[0], stream);
await sender.replaceTrack(null);
await sender. replaceTrack(stream.getAudioTracks()[0], stream); // circumvents TypeError

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1472 using your GitHub account
Received on Monday, 10 July 2017 15:38:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:51 UTC