@webex/media-helpers 3.0.0-beta.337 → 3.0.0-beta.339
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/dist/webrtc-core.js +0 -28
- package/dist/webrtc-core.js.map +1 -1
- package/package.json +4 -4
- package/src/webrtc-core.ts +2 -22
- package/test/unit/spec/webrtc-core.js +1 -1
package/dist/webrtc-core.js
CHANGED
|
@@ -131,20 +131,6 @@ var _LocalMicrophoneStream = /*#__PURE__*/function (_WcmeLocalMicrophoneS) {
|
|
|
131
131
|
this[LocalMicrophoneStreamEventNames.ServerMuted].emit(muted, reason);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
}, {
|
|
135
|
-
key: "toJSON",
|
|
136
|
-
value: function toJSON() {
|
|
137
|
-
var _this$inputTrack;
|
|
138
|
-
return {
|
|
139
|
-
id: this.id,
|
|
140
|
-
enabled: (_this$inputTrack = this.inputTrack) === null || _this$inputTrack === void 0 ? void 0 : _this$inputTrack.enabled,
|
|
141
|
-
label: this.label,
|
|
142
|
-
readyState: this.readyState,
|
|
143
|
-
numEnabledEffects: this.getEffects().filter(function (item) {
|
|
144
|
-
return item.isEnabled;
|
|
145
|
-
}).length
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
134
|
}]);
|
|
149
135
|
return _LocalMicrophoneStream;
|
|
150
136
|
}(_internalMediaCore.LocalMicrophoneStream);
|
|
@@ -203,20 +189,6 @@ var _LocalCameraStream = /*#__PURE__*/function (_WcmeLocalCameraStrea) {
|
|
|
203
189
|
this[LocalCameraStreamEventNames.ServerMuted].emit(muted, reason);
|
|
204
190
|
}
|
|
205
191
|
}
|
|
206
|
-
}, {
|
|
207
|
-
key: "toJSON",
|
|
208
|
-
value: function toJSON() {
|
|
209
|
-
var _this$inputTrack2;
|
|
210
|
-
return {
|
|
211
|
-
id: this.id,
|
|
212
|
-
enabled: (_this$inputTrack2 = this.inputTrack) === null || _this$inputTrack2 === void 0 ? void 0 : _this$inputTrack2.enabled,
|
|
213
|
-
label: this.label,
|
|
214
|
-
readyState: this.readyState,
|
|
215
|
-
numEnabledEffects: this.getEffects().filter(function (item) {
|
|
216
|
-
return item.isEnabled;
|
|
217
|
-
}).length
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
192
|
}]);
|
|
221
193
|
return _LocalCameraStream;
|
|
222
194
|
}(_internalMediaCore.LocalCameraStream);
|
package/dist/webrtc-core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LocalMicrophoneStreamEventNames","LocalCameraStreamEventNames","ServerMuted","_LocalMicrophoneStream","TypedEvent","allowed","unmuteAllowed","muted","isUnmuteAllowed","Error","reason","setMuted","emit","
|
|
1
|
+
{"version":3,"names":["LocalMicrophoneStreamEventNames","LocalCameraStreamEventNames","ServerMuted","_LocalMicrophoneStream","TypedEvent","allowed","unmuteAllowed","muted","isUnmuteAllowed","Error","reason","setMuted","emit","WcmeLocalMicrophoneStream","_LocalCameraStream","WcmeLocalCameraStream","createMicrophoneStream","constraints","wcmeCreateMicrophoneStream","LocalMicrophoneStream","createCameraStream","wcmeCreateCameraStream","LocalCameraStream","createDisplayStream","wcmeCreateDisplayStream","LocalDisplayStream","createDisplayStreamWithAudio","wcmeCreateDisplayStreamWithAudio","LocalSystemAudioStream","AddEvents"],"sources":["webrtc-core.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-misused-new */\n/* eslint-disable valid-jsdoc */\n/* eslint-disable require-jsdoc */\nimport {\n AudioDeviceConstraints,\n createCameraStream as wcmeCreateCameraStream,\n createDisplayStream as wcmeCreateDisplayStream,\n createDisplayStreamWithAudio as wcmeCreateDisplayStreamWithAudio,\n createMicrophoneStream as wcmeCreateMicrophoneStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalMicrophoneStream as WcmeLocalMicrophoneStream,\n LocalCameraStream as WcmeLocalCameraStream,\n VideoDeviceConstraints,\n} from '@webex/internal-media-core';\nimport {AddEvents, TypedEvent, WithEventsDummyType} from '@webex/ts-events';\n\nexport {\n getDevices,\n LocalStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalStreamEventNames,\n StreamEventNames,\n RemoteStream,\n type VideoContentHint,\n} from '@webex/internal-media-core';\n\nexport type ServerMuteReason =\n | 'remotelyMuted' // other user has remotely muted us\n | 'clientRequestFailed' // client called setMuted() but server request failed\n | 'localUnmuteRequired'; // server forced the client to be unmuted\n\n// these events are in addition to WCME events. This will be properly typed once webrtc-core event types inheritance is fixed\nexport enum LocalMicrophoneStreamEventNames {\n ServerMuted = 'muted:byServer',\n}\n\n// these events are in addition to WCME events. This will be properly typed once webrtc-core event types inheritance is fixed\nexport enum LocalCameraStreamEventNames {\n ServerMuted = 'muted:byServer',\n}\n\ninterface LocalMicrophoneStreamEvents {\n [LocalMicrophoneStreamEventNames.ServerMuted]: TypedEvent<\n (muted: boolean, reason: ServerMuteReason) => void\n >;\n}\n\ninterface LocalCameraStreamEvents {\n [LocalMicrophoneStreamEventNames.ServerMuted]: TypedEvent<\n (muted: boolean, reason: ServerMuteReason) => void\n >;\n}\n\nclass _LocalMicrophoneStream extends WcmeLocalMicrophoneStream {\n private unmuteAllowed = true;\n\n [LocalMicrophoneStreamEventNames.ServerMuted] = new TypedEvent<\n (muted: boolean, reason: ServerMuteReason) => void\n >();\n\n /**\n * @internal\n */\n setUnmuteAllowed(allowed: boolean) {\n this.unmuteAllowed = allowed;\n }\n\n /**\n * @returns true if user is allowed to unmute the track, false otherwise\n */\n isUnmuteAllowed() {\n return this.unmuteAllowed;\n }\n\n setMuted(muted: boolean): void {\n if (!muted) {\n if (!this.isUnmuteAllowed()) {\n throw new Error('Unmute is not allowed');\n }\n }\n\n return super.setMuted(muted);\n }\n\n /**\n * @internal\n */\n setServerMuted(muted: boolean, reason: ServerMuteReason) {\n if (muted !== this.muted) {\n this.setMuted(muted);\n this[LocalMicrophoneStreamEventNames.ServerMuted].emit(muted, reason);\n }\n }\n}\n\nclass _LocalCameraStream extends WcmeLocalCameraStream {\n private unmuteAllowed = true;\n\n [LocalCameraStreamEventNames.ServerMuted] = new TypedEvent<\n (muted: boolean, reason: ServerMuteReason) => void\n >();\n\n /**\n * @internal\n */\n setUnmuteAllowed(allowed: boolean) {\n this.unmuteAllowed = allowed;\n }\n\n /**\n * @returns true if user is allowed to unmute the track, false otherwise\n */\n isUnmuteAllowed() {\n return this.unmuteAllowed;\n }\n\n setMuted(muted: boolean): void {\n if (!muted) {\n if (!this.isUnmuteAllowed()) {\n throw new Error('Unmute is not allowed');\n }\n }\n\n return super.setMuted(muted);\n }\n\n /**\n * @internal\n */\n setServerMuted(muted: boolean, reason: ServerMuteReason) {\n if (muted !== this.muted) {\n this.setMuted(muted);\n this[LocalCameraStreamEventNames.ServerMuted].emit(muted, reason);\n }\n }\n}\n\nexport const createMicrophoneStream = (constraints?: AudioDeviceConstraints) =>\n wcmeCreateMicrophoneStream(LocalMicrophoneStream, constraints);\n\nexport const createCameraStream = (constraints?: VideoDeviceConstraints) =>\n wcmeCreateCameraStream(LocalCameraStream, constraints);\n\nexport const createDisplayStream = () => wcmeCreateDisplayStream(LocalDisplayStream);\n\nexport const createDisplayStreamWithAudio = () =>\n wcmeCreateDisplayStreamWithAudio(LocalDisplayStream, LocalSystemAudioStream);\n\nexport const LocalMicrophoneStream = AddEvents<\n typeof _LocalMicrophoneStream,\n LocalMicrophoneStreamEvents\n>(_LocalMicrophoneStream);\n\nexport type LocalMicrophoneStream = _LocalMicrophoneStream &\n WithEventsDummyType<LocalMicrophoneStreamEvents>;\n\nexport const LocalCameraStream = AddEvents<typeof _LocalCameraStream, LocalCameraStreamEvents>(\n _LocalCameraStream\n);\n\nexport type LocalCameraStream = _LocalCameraStream & WithEventsDummyType<LocalCameraStreamEvents>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAYA;AAA4E;AAAA;AAAA;AAgBjD;AAE3B;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yCAAsB,CAAC;AAAA;AAAC;AAExE,IAAMT,qBAAqB,GAAG,IAAAU,mBAAS,EAG5C1B,sBAAsB,CAAC;AAAC;AAKnB,IAAMmB,iBAAiB,GAAG,IAAAO,mBAAS,EACxCf,kBAAkB,CACnB;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/media-helpers",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.339",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=16"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@webex/internal-media-core": "2.2.
|
|
20
|
+
"@webex/internal-media-core": "2.2.4",
|
|
21
21
|
"@webex/ts-events": "^1.1.0",
|
|
22
22
|
"@webex/web-media-effects": "^2.15.6"
|
|
23
23
|
},
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
32
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
31
|
+
"@webex/test-helper-chai": "3.0.0-beta.339",
|
|
32
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.339",
|
|
33
33
|
"sinon": "^9.2.4"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/webrtc-core.ts
CHANGED
|
@@ -63,7 +63,7 @@ class _LocalMicrophoneStream extends WcmeLocalMicrophoneStream {
|
|
|
63
63
|
/**
|
|
64
64
|
* @internal
|
|
65
65
|
*/
|
|
66
|
-
setUnmuteAllowed(allowed) {
|
|
66
|
+
setUnmuteAllowed(allowed: boolean) {
|
|
67
67
|
this.unmuteAllowed = allowed;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -93,16 +93,6 @@ class _LocalMicrophoneStream extends WcmeLocalMicrophoneStream {
|
|
|
93
93
|
this[LocalMicrophoneStreamEventNames.ServerMuted].emit(muted, reason);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
toJSON() {
|
|
98
|
-
return {
|
|
99
|
-
id: this.id,
|
|
100
|
-
enabled: this.inputTrack?.enabled,
|
|
101
|
-
label: this.label,
|
|
102
|
-
readyState: this.readyState,
|
|
103
|
-
numEnabledEffects: this.getEffects().filter((item) => item.isEnabled).length,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
96
|
}
|
|
107
97
|
|
|
108
98
|
class _LocalCameraStream extends WcmeLocalCameraStream {
|
|
@@ -115,7 +105,7 @@ class _LocalCameraStream extends WcmeLocalCameraStream {
|
|
|
115
105
|
/**
|
|
116
106
|
* @internal
|
|
117
107
|
*/
|
|
118
|
-
setUnmuteAllowed(allowed) {
|
|
108
|
+
setUnmuteAllowed(allowed: boolean) {
|
|
119
109
|
this.unmuteAllowed = allowed;
|
|
120
110
|
}
|
|
121
111
|
|
|
@@ -145,16 +135,6 @@ class _LocalCameraStream extends WcmeLocalCameraStream {
|
|
|
145
135
|
this[LocalCameraStreamEventNames.ServerMuted].emit(muted, reason);
|
|
146
136
|
}
|
|
147
137
|
}
|
|
148
|
-
|
|
149
|
-
toJSON() {
|
|
150
|
-
return {
|
|
151
|
-
id: this.id,
|
|
152
|
-
enabled: this.inputTrack?.enabled,
|
|
153
|
-
label: this.label,
|
|
154
|
-
readyState: this.readyState,
|
|
155
|
-
numEnabledEffects: this.getEffects().filter((item) => item.isEnabled).length,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
138
|
}
|
|
159
139
|
|
|
160
140
|
export const createMicrophoneStream = (constraints?: AudioDeviceConstraints) =>
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createMicrophoneStream,
|
|
12
12
|
createDisplayStream,
|
|
13
13
|
createDisplayStreamWithAudio,
|
|
14
|
-
} from '
|
|
14
|
+
} from '@webex/media-helpers';
|
|
15
15
|
import * as wcmestreams from '@webex/internal-media-core';
|
|
16
16
|
|
|
17
17
|
describe('media-helpers', () => {
|