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

Commit 26fff84

Browse files
authored
Merge branch 'master' into set-sdp
2 parents fe6a2b9 + 4d1cc1f commit 26fff84

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

src/sdk/conference/channel.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,9 +1099,10 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
10991099
}
11001100
// Only check the first one.
11011101
const param = obj[0];
1102-
return param.codecPayloadType || param.dtx || param.active ||
1103-
param.ptime || param.maxFramerate || param.scaleResolutionDownBy ||
1104-
param.rid;
1102+
return !!(
1103+
param.codecPayloadType || param.dtx || param.active || param.ptime ||
1104+
param.maxFramerate || param.scaleResolutionDownBy || param.rid ||
1105+
param.scalabilityMode);
11051106
}
11061107

11071108
_isOwtEncodingParameters(obj) {

test/unit/resources/scripts/conference.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'use strict';
66

77
import {ConferenceClient} from '../../../../src/sdk/conference/client.js';
8+
import {ConferencePeerConnectionChannel} from '../../../../src/sdk/conference/channel.js';
89
import * as StreamModule from '../../../../src/sdk/base/stream.js';
910
import * as EventModule from '../../../../src/sdk/base/event.js'
1011

@@ -49,3 +50,52 @@ describe('Unit tests for ConferenceClient', function() {
4950
});
5051
});
5152
});
53+
54+
describe('Unit tests for ConferencePeerConnectionChannel.', () => {
55+
describe('Tests for codecs.', () => {
56+
it('Correctly detect the type of publishOptions elements.', () => {
57+
// For each element in paramters, [object to be tested, is
58+
// RTCRtpEncodingParameters, is OwtEncodingParameters].
59+
const parameters = [
60+
[[{scalabilityMode: 'L3T3'}], true, false],
61+
[
62+
[
63+
{rid: 'q', active: true, scaleResolutionDownBy: 4.0},
64+
{rid: 'h', active: true, scaleResolutionDownBy: 2.0},
65+
{rid: 'f', active: true}
66+
],
67+
true, false
68+
],
69+
[true, false, false],
70+
[
71+
[
72+
{
73+
codec: {
74+
name: 'h264',
75+
},
76+
},
77+
{
78+
codec: {
79+
name: 'vp9',
80+
},
81+
},
82+
{
83+
codec: {
84+
name: 'vp8',
85+
},
86+
}
87+
],
88+
false, true
89+
]
90+
];
91+
const channel = new ConferencePeerConnectionChannel();
92+
for (const [p, isRtpEncodingParameters, isOwtEncodingParameters] of
93+
parameters) {
94+
expect(channel._isRtpEncodingParameters(p))
95+
.to.equal(isRtpEncodingParameters);
96+
expect(channel._isOwtEncodingParameters(p))
97+
.to.equal(isOwtEncodingParameters);
98+
}
99+
});
100+
});
101+
});

0 commit comments

Comments
 (0)