Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit ba9a985

Browse files
authored
Add stream attributes info (#905)
1 parent d72c987 commit ba9a985

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

source/agent/conference/conference.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ var Conference = function (rpcClient, selfRpcId) {
10011001
transportId: pubInfo.transport.id,
10021002
tracks: pubInfo.media.tracks,
10031003
legacy: pubInfo.legacy,
1004+
attributes: pubInfo.attributes,
10041005
data: pubInfo.data
10051006
};
10061007
return rtcPubInfo;

source/agent/conference/rtcController.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,14 @@ class Track {
6565

6666
class Operation {
6767

68-
constructor(id, transport, direction, tracks, legacy) {
68+
constructor(id, transport, direction, tracks, legacy, attributes) {
6969
this.id = id;
7070
this.transport = transport;
7171
this.transportId = transport.id;
7272
this.direction = direction;
7373
this.tracks = tracks.map(t => new Track(this, t));
7474
this.legacy = legacy;
75+
this.attributes = attributes;
7576
this.promise = Promise.resolve();
7677
}
7778

@@ -265,9 +266,9 @@ class RtcController extends EventEmitter {
265266

266267
// tracks = [ {mid, type, formatPreference, from} ]
267268
// Return Promise
268-
initiate(ownerId, sessionId, direction, origin, {transportId, tracks, legacy}) {
269+
initiate(ownerId, sessionId, direction, origin, {transportId, tracks, legacy, attributes}) {
269270
log.debug(`initiate, ownerId:${ownerId}, sessionId:${sessionId}, origin:${origin}, ` +
270-
`transportId:${transportId}, tracks:${JSON.stringify(tracks)}, legacy:${legacy}`);
271+
`transportId:${transportId}, tracks:${JSON.stringify(tracks)}, legacy:${legacy}, attributes:${attributes}`);
271272

272273
return this._createTransportIfNeeded(ownerId, sessionId, origin, transportId)
273274
.then(transport => {
@@ -281,7 +282,7 @@ class RtcController extends EventEmitter {
281282
log.debug(`operation exists:${sessionId}`);
282283
return Promise.reject(`operation exists:${sessionId}`);
283284
}
284-
const op = new Operation(sessionId, transport, direction, tracks, legacy);
285+
const op = new Operation(sessionId, transport, direction, tracks, legacy, attributes);
285286
this.operations.set(sessionId, op);
286287
// Return promise for this operation
287288
const options = {transportId, tracks, controller: this.roomRpcId, owner: ownerId};

0 commit comments

Comments
 (0)