@webex/media-helpers 3.0.0-next.11 → 3.0.0-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/webrtc-core.js +2 -2
- package/package.json +5 -5
- package/src/webrtc-core.ts +2 -2
- package/test/unit/spec/webrtc-core.js +10 -9
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ const effect = new VirtualBackgroundEffect({
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
// add the effect on the input camera stream.
|
|
54
|
-
await cameraStream.addEffect(
|
|
54
|
+
await cameraStream.addEffect(effect);
|
|
55
55
|
|
|
56
56
|
//enable the effect once it is added to the stream
|
|
57
57
|
await effect.enable()
|
|
@@ -79,7 +79,7 @@ const effect = new NoiseReductionEffect({
|
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
// add the effect on microphone stream.
|
|
82
|
-
await microphoneStream.addEffect(
|
|
82
|
+
await microphoneStream.addEffect(effect);
|
|
83
83
|
|
|
84
84
|
//enable the effect once it is added to the track
|
|
85
85
|
await effect.enable()
|
package/dist/webrtc-core.js
CHANGED
|
@@ -104,7 +104,7 @@ class _LocalMicrophoneStream extends _internalMediaCore.LocalMicrophoneStream {
|
|
|
104
104
|
enabled: this.inputTrack?.enabled,
|
|
105
105
|
label: this.label,
|
|
106
106
|
readyState: this.readyState,
|
|
107
|
-
numEnabledEffects: this.
|
|
107
|
+
numEnabledEffects: this.getEffects().filter(item => item.isEnabled).length
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -149,7 +149,7 @@ class _LocalCameraStream extends _internalMediaCore.LocalCameraStream {
|
|
|
149
149
|
enabled: this.inputTrack?.enabled,
|
|
150
150
|
label: this.label,
|
|
151
151
|
readyState: this.readyState,
|
|
152
|
-
numEnabledEffects: this.
|
|
152
|
+
numEnabledEffects: this.getEffects().filter(item => item.isEnabled).length
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
}
|
package/package.json
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"deploy:npm": "yarn npm publish"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@webex/internal-media-core": "2.2.
|
|
26
|
+
"@webex/internal-media-core": "2.2.3",
|
|
27
27
|
"@webex/ts-events": "^1.1.0",
|
|
28
|
-
"@webex/web-media-effects": "^2.
|
|
28
|
+
"@webex/web-media-effects": "^2.15.6"
|
|
29
29
|
},
|
|
30
30
|
"browserify": {
|
|
31
31
|
"transform": [
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@webex/eslint-config-legacy": "^0.0.0",
|
|
40
40
|
"@webex/jest-config-legacy": "^0.0.0",
|
|
41
41
|
"@webex/legacy-tools": "^0.0.0",
|
|
42
|
-
"@webex/test-helper-chai": "^2.60.0-next.
|
|
43
|
-
"@webex/test-helper-mock-webex": "^2.60.0-next.
|
|
42
|
+
"@webex/test-helper-chai": "^2.60.0-next.3",
|
|
43
|
+
"@webex/test-helper-mock-webex": "^2.60.0-next.3",
|
|
44
44
|
"eslint": "^8.24.0",
|
|
45
45
|
"sinon": "^9.2.4"
|
|
46
46
|
},
|
|
47
|
-
"version": "3.0.0-next.
|
|
47
|
+
"version": "3.0.0-next.13"
|
|
48
48
|
}
|
package/src/webrtc-core.ts
CHANGED
|
@@ -100,7 +100,7 @@ class _LocalMicrophoneStream extends WcmeLocalMicrophoneStream {
|
|
|
100
100
|
enabled: this.inputTrack?.enabled,
|
|
101
101
|
label: this.label,
|
|
102
102
|
readyState: this.readyState,
|
|
103
|
-
numEnabledEffects: this.
|
|
103
|
+
numEnabledEffects: this.getEffects().filter((item) => item.isEnabled).length,
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -152,7 +152,7 @@ class _LocalCameraStream extends WcmeLocalCameraStream {
|
|
|
152
152
|
enabled: this.inputTrack?.enabled,
|
|
153
153
|
label: this.label,
|
|
154
154
|
readyState: this.readyState,
|
|
155
|
-
numEnabledEffects: this.
|
|
155
|
+
numEnabledEffects: this.getEffects().filter((item) => item.isEnabled).length,
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -41,6 +41,7 @@ describe('media-helpers', () => {
|
|
|
41
41
|
label: 'fake track',
|
|
42
42
|
id: 'fake track id',
|
|
43
43
|
enabled: true,
|
|
44
|
+
muted: false,
|
|
44
45
|
addEventListener: sinon.stub(),
|
|
45
46
|
},
|
|
46
47
|
]),
|
|
@@ -73,22 +74,22 @@ describe('media-helpers', () => {
|
|
|
73
74
|
|
|
74
75
|
it('returns a reasonable length string from JSON.stringify()', () => {
|
|
75
76
|
assert.isBelow(JSON.stringify(stream).length, 200);
|
|
76
|
-
})
|
|
77
|
+
});
|
|
77
78
|
|
|
78
79
|
describe('#setServerMuted', () => {
|
|
79
80
|
afterEach(() => {
|
|
80
81
|
sinon.restore();
|
|
81
82
|
});
|
|
82
83
|
|
|
83
|
-
const checkSetServerMuted =
|
|
84
|
-
|
|
84
|
+
const checkSetServerMuted = (startMute, setMute, expectedCalled) => {
|
|
85
|
+
stream.setMuted(startMute);
|
|
85
86
|
|
|
86
87
|
assert.equal(stream.muted, startMute);
|
|
87
88
|
|
|
88
89
|
const handler = sinon.fake();
|
|
89
90
|
stream.on(event.ServerMuted, handler);
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
stream.setServerMuted(setMute, 'remotelyMuted');
|
|
92
93
|
|
|
93
94
|
assert.equal(stream.muted, setMute);
|
|
94
95
|
if (expectedCalled) {
|
|
@@ -99,19 +100,19 @@ describe('media-helpers', () => {
|
|
|
99
100
|
};
|
|
100
101
|
|
|
101
102
|
it('tests true to false', async () => {
|
|
102
|
-
|
|
103
|
+
checkSetServerMuted(true, false, true);
|
|
103
104
|
});
|
|
104
105
|
|
|
105
106
|
it('tests false to true', async () => {
|
|
106
|
-
|
|
107
|
+
checkSetServerMuted(false, true, true);
|
|
107
108
|
});
|
|
108
109
|
|
|
109
110
|
it('tests true to true', async () => {
|
|
110
|
-
|
|
111
|
+
checkSetServerMuted(true, true, false);
|
|
111
112
|
});
|
|
112
113
|
|
|
113
114
|
it('tests false to false', async () => {
|
|
114
|
-
|
|
115
|
+
checkSetServerMuted(false, false, false);
|
|
115
116
|
});
|
|
116
117
|
});
|
|
117
118
|
|
|
@@ -137,7 +138,7 @@ describe('media-helpers', () => {
|
|
|
137
138
|
assert.calledOnceWithExactly(spy, LocalDisplayStream);
|
|
138
139
|
});
|
|
139
140
|
});
|
|
140
|
-
|
|
141
|
+
|
|
141
142
|
describe('createDisplayStreamWithAudio', () => {
|
|
142
143
|
it('checks createDisplayStreamWithAudio', async () => {
|
|
143
144
|
const spy = sinon.stub(wcmestreams, 'createDisplayStreamWithAudio').returns('something');
|