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

Commit 7c44e90

Browse files
committed
Fix issues for publications after rebasing.
1 parent 8b5c13a commit 7c44e90

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed

source/agent/conference/stream.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ class ForwardStream extends Stream {
294294
}
295295
}
296296

297-
<<<<<<< HEAD
298297
update(info) {
299298
let updateTrack;
300299
let updateParameters;
@@ -306,18 +305,6 @@ class ForwardStream extends Stream {
306305
updateTrack = this.media.tracks.find(t => t.type === 'video');
307306
updateParameters = info.video ? info.video.parameters : null;
308307
}
309-
=======
310-
var forwardStreamInfo = {
311-
id,
312-
type: 'forward',
313-
media: result,
314-
// Indicates whether this is a data stream.
315-
data: data,
316-
info
317-
};
318-
return forwardStreamInfo;
319-
}
320-
>>>>>>> Stream info has data property.
321308

322309
if (updateParameters && updateParameters.resolution) {
323310
if (!updateTrack.parameters ||
@@ -343,7 +330,7 @@ class MixedStream extends Stream {
343330
audio: Object.assign({}, view.audio.format),
344331
video: Object.assign({}, view.video.format, view.video.parameters)
345332
};
346-
super(id, 'mixed', media, info);
333+
super(id, 'mixed', media, null, info);
347334
}
348335
}
349336

source/portal/client.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
var log = require('./logger').logger.getLogger('Client');
88
var ReqType = require('./versions/requestType');
99
var dataAdapter = require('./versions/portalDataAdapter');
10+
const { v4: uuid } = require('uuid');
1011

1112
var idPattern = /^[0-9a-zA-Z\-]+$/;
1213
function isValidIdString(str) {
@@ -61,6 +62,10 @@ var Client = function(clientId, sigConnection, portal, version) {
6162
}
6263
};
6364

65+
const uuidWithoutDash = function() {
66+
return uuid().replace(/-/g, '');
67+
};
68+
6469
const listenAt = (socket) => {
6570
socket.on('text', function(textReq, callback) {
6671
if(!that.inRoom){
@@ -81,15 +86,21 @@ var Client = function(clientId, sigConnection, portal, version) {
8186
}
8287

8388
//FIXME: move the id assignment to conference
84-
var stream_id = Math.round(Math.random() * 1000000000000000000) + '';
89+
var stream_id = uuidWithoutDash();
8590
var transportId;
8691
return adapter.translateReq(ReqType.Pub, pubReq)
8792
.then((req) => {
88-
req.type = 'webrtc';//FIXME: For backend compatibility with v3.4 clients.
89-
if (!req.transportId) {
90-
req.transportId = stream_id;
93+
if (req.transport && req.transport.type == 'quic') {
94+
req.type = 'quic';
95+
if (!req.transport.id) {
96+
req.transport.id = uuidWithoutDash();
97+
}
98+
transportId = req.transport.id;
99+
} else {
100+
req.type = 'webrtc'; //FIXME: For backend compatibility with v3.4 clients.
101+
req.transport = { type : 'webrtc', id : stream_id };
91102
}
92-
transportId = req.transportId;
103+
transportId = req.transport.id;
93104
return portal.publish(clientId, stream_id, req);
94105
}).then((result) => {
95106
safeCall(callback, 'ok', {id: stream_id, transportId});

source/portal/versions/requestFormatV1-2.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ const PublicationRequest = {
3939
properties: {
4040
'media': { $ref: '#/definitions/WebRTCMediaOptions' },
4141
'attributes': { type: 'object' },
42-
'transportId': { type: 'string' }
42+
'data': {type: 'boolean'},
43+
'transport': {
44+
type: 'object',
45+
properties: {
46+
'type': {type: 'string'},
47+
'id': {type: 'string'},
48+
},
49+
additionalProperties: false,
50+
},
4351
},
4452
additionalProperties: false,
4553
required: ['media']
@@ -48,7 +56,7 @@ const PublicationRequest = {
4856

4957
definitions: {
5058
'WebRTCMediaOptions': {
51-
type: 'object',
59+
type: ['object', 'null'],
5260
properties: {
5361
'tracks': {
5462
type: 'array',
@@ -75,7 +83,15 @@ const SubscriptionRequest = {
7583
type: 'object',
7684
properties: {
7785
'media': { $ref: '#/definitions/MediaSubOptions' },
78-
'transportId': { type: 'string' }
86+
'transport': {
87+
type: 'object',
88+
properties: {
89+
'type': {type: 'string'},
90+
'id': {type: 'string'},
91+
},
92+
additionalProperties: false,
93+
},
94+
'data': {type: 'boolean'}
7995
},
8096
additionalProperties: false,
8197
required: ['media']

0 commit comments

Comments
 (0)