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

Commit 2e81905

Browse files
committed
Upgrade conference protocol version to 1.1.
1 parent 120f9ae commit 2e81905

File tree

4 files changed

+36
-31
lines changed

4 files changed

+36
-31
lines changed

docs/mdfiles/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Change Log
22
==========
33
# 4.3
44
* The type of `conferenceClient.publish` method's option is changed from `AudioEncodingParameters` and `VideoEncodingParameters` to `RTCRtpSendParameters`.
5+
* `audio` and `video` of `PublicationSettings` is changed from `AudioPublicationSettings` and `VideoPublicationSettings` to `AudioPublicationSettings` array and `VideoPublicationSettings` array.
56

67
# 4.0.2
78
* Fix a compatibility issue for Chrome 69 beta.

src/sdk/base/publication.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class AudioPublicationSettings {
3434
*/
3535
export class VideoPublicationSettings {
3636
// eslint-disable-next-line require-jsdoc
37-
constructor(codec, resolution, frameRate, bitrate, keyFrameInterval) {
37+
constructor(codec, resolution, frameRate, bitrate, keyFrameInterval, rid) {
3838
/**
3939
* @member {?Owt.Base.VideoCodecParameters} codec
4040
* @instance
@@ -67,6 +67,13 @@ export class VideoPublicationSettings {
6767
* @memberof Owt.Base.VideoPublicationSettings
6868
*/
6969
this.keyFrameInterval=keyFrameInterval;
70+
/**
71+
* @member {?number} rid
72+
* @instance
73+
* @classDesc Restriction identifier to identify the RTP Streams within an RTP session.
74+
* @memberof Owt.Base.VideoPublicationSettings
75+
*/
76+
this.rid=rid;
7077
}
7178
}
7279

@@ -80,13 +87,13 @@ export class PublicationSettings {
8087
// eslint-disable-next-line require-jsdoc
8188
constructor(audio, video) {
8289
/**
83-
* @member {Owt.Base.AudioPublicationSettings} audio
90+
* @member {Owt.Base.AudioPublicationSettings[]} audio
8491
* @instance
8592
* @memberof Owt.Base.PublicationSettings
8693
*/
8794
this.audio=audio;
8895
/**
89-
* @member {Owt.Base.VideoPublicationSettings} video
96+
* @member {Owt.Base.VideoPublicationSettings[]} video
9097
* @instance
9198
* @memberof Owt.Base.PublicationSettings
9299
*/

src/sdk/conference/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const SignalingState = {
2929
CONNECTED: 3,
3030
};
3131

32-
const protocolVersion = '1.0';
32+
const protocolVersion = '1.1';
3333

3434
/* eslint-disable valid-jsdoc */
3535
/**

src/sdk/conference/streamutils.js

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,41 +47,38 @@ function sortResolutions(x, y) {
4747
* @private
4848
*/
4949
export function convertToPublicationSettings(mediaInfo) {
50-
let audio;
51-
let audioCodec;
52-
let video;
53-
let videoCodec;
54-
let resolution;
55-
let framerate;
56-
let bitrate;
57-
let keyFrameInterval;
50+
let audio = [],
51+
video = [];
52+
let audioCodec, videoCodec, resolution, framerate, bitrate, keyFrameInterval,
53+
rid;
5854
if (mediaInfo.audio) {
5955
if (mediaInfo.audio.format) {
6056
audioCodec = new CodecModule.AudioCodecParameters(
61-
mediaInfo.audio.format.codec, mediaInfo.audio.format.channelNum,
62-
mediaInfo.audio.format.sampleRate
63-
);
57+
mediaInfo.audio.format.codec, mediaInfo.audio.format.channelNum,
58+
mediaInfo.audio.format.sampleRate);
6459
}
65-
audio = new PublicationModule.AudioPublicationSettings(audioCodec);
60+
audio.push(new PublicationModule.AudioPublicationSettings(audioCodec));
6661
}
6762
if (mediaInfo.video) {
68-
if (mediaInfo.video.format) {
69-
videoCodec = new CodecModule.VideoCodecParameters(
70-
mediaInfo.video.format.codec, mediaInfo.video.format.profile);
71-
}
72-
if (mediaInfo.video.parameters) {
73-
if (mediaInfo.video.parameters.resolution) {
74-
resolution = new MediaFormatModule.Resolution(
75-
mediaInfo.video.parameters.resolution.width,
76-
mediaInfo.video.parameters.resolution.height);
63+
for (const videoInfo of mediaInfo.video.original) {
64+
if (videoInfo.format) {
65+
videoCodec = new CodecModule.VideoCodecParameters(
66+
videoInfo.format.codec, videoInfo.format.profile);
67+
}
68+
if (videoInfo.parameters) {
69+
if (videoInfo.parameters.resolution) {
70+
resolution = new MediaFormatModule.Resolution(
71+
videoInfo.parameters.resolution.width,
72+
videoInfo.parameters.resolution.height);
73+
}
74+
framerate = videoInfo.parameters.framerate;
75+
bitrate = videoInfo.parameters.bitrate * 1000;
76+
keyFrameInterval = videoInfo.parameters.keyFrameInterval;
77+
rid = videoInfo.parameters.simulcastRid;
7778
}
78-
framerate = mediaInfo.video.parameters.framerate;
79-
bitrate = mediaInfo.video.parameters.bitrate * 1000;
80-
keyFrameInterval = mediaInfo.video.parameters.keyFrameInterval;
79+
video.push(new PublicationModule.VideoPublicationSettings(
80+
videoCodec, resolution, framerate, bitrate, keyFrameInterval, rid));
8181
}
82-
video = new PublicationModule.VideoPublicationSettings(videoCodec,
83-
resolution, framerate, bitrate, keyFrameInterval
84-
);
8582
}
8683
return new PublicationModule.PublicationSettings(audio, video);
8784
}

0 commit comments

Comments
 (0)