@webex/widgets 1.22.2 → 1.22.3
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/webexWidgets.esm.js +141 -102
- package/dist/webexWidgets.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/webexWidgets.esm.js
CHANGED
@@ -12704,7 +12704,113 @@ performance.now || performance.mozNow || performance.msNow || performance.oNow |
|
|
12704
12704
|
return new Date().getTime();
|
12705
12705
|
}; // generate timestamp or delta
|
12706
12706
|
|
12707
|
+
/**
|
12708
|
+
* Custom rxjs operator for chaining dependent observables.
|
12709
|
+
* Usage:
|
12710
|
+
```js
|
12711
|
+
obs.pipe(
|
12712
|
+
chainWith((lastMessage) => createDependentObservable(lastMessage),
|
12713
|
+
);
|
12714
|
+
```
|
12715
|
+
*
|
12716
|
+
* @param {function(lastMessage): Observable} createDependentObservable Function that is passed the last message emitted by the source observable and returns a new observable
|
12717
|
+
* @returns {Observable} observable
|
12718
|
+
*/
|
12719
|
+
|
12720
|
+
|
12721
|
+
function chainWith(createDependentObservable) {
|
12722
|
+
return source => new Observable(subscriber => {
|
12723
|
+
let lastValue;
|
12724
|
+
let subscription;
|
12725
|
+
subscription = source.subscribe(value => {
|
12726
|
+
subscriber.next(value);
|
12727
|
+
lastValue = value;
|
12728
|
+
}, error => subscriber.error(error), () => {
|
12729
|
+
subscription = createDependentObservable(lastValue).subscribe(value => subscriber.next(value), error => subscriber.error(error), () => subscriber.complete());
|
12730
|
+
});
|
12731
|
+
return () => {
|
12732
|
+
if (subscription) {
|
12733
|
+
subscription.unsubscribe();
|
12734
|
+
}
|
12735
|
+
};
|
12736
|
+
});
|
12737
|
+
}
|
12738
|
+
/**
|
12739
|
+
* Custom rxjs operator that works like combineLatest, but emits even if some of the source observables haven't emitted yet.
|
12740
|
+
* Usage:
|
12741
|
+
```js
|
12742
|
+
combineLatestImmediate(obs1, obs2, ...);
|
12743
|
+
```
|
12744
|
+
*
|
12745
|
+
* @param {ObservableInput} [observables] An array of input Observables to combine with each other.
|
12746
|
+
* @returns {Observable} Observable that emits arrays containing the last emitted value from each of the observables defined above.
|
12747
|
+
*/
|
12748
|
+
|
12749
|
+
|
12750
|
+
function combineLatestImmediate() {
|
12751
|
+
for (var _len = arguments.length, observables = new Array(_len), _key = 0; _key < _len; _key++) {
|
12752
|
+
observables[_key] = arguments[_key];
|
12753
|
+
}
|
12754
|
+
|
12755
|
+
return combineLatest(observables.map(obs => obs.pipe(startWith(undefined))));
|
12756
|
+
}
|
12757
|
+
/**
|
12758
|
+
* Helper function for deep merge on objects.
|
12759
|
+
*
|
12760
|
+
* @param {object} dest - The destination object.
|
12761
|
+
* @param {object} src - The source object.
|
12762
|
+
*/
|
12763
|
+
|
12764
|
+
|
12765
|
+
function deepMerge(dest, src) {
|
12766
|
+
const result = dest;
|
12767
|
+
|
12768
|
+
for (const [key, val] of Object.entries(src || {})) {
|
12769
|
+
if (val && val.constructor === Object) {
|
12770
|
+
deepMerge(result[key], val);
|
12771
|
+
} else {
|
12772
|
+
result[key] = val;
|
12773
|
+
}
|
12774
|
+
}
|
12775
|
+
}
|
12776
|
+
/**
|
12777
|
+
* Safe JSON stringifier that:
|
12778
|
+
* - replaces circular references with the text [circular-reference]
|
12779
|
+
* - catches any JSON.stringify error and returns [error-stringifying:<ERROR-MESSAGE>]
|
12780
|
+
*
|
12781
|
+
* @param {any} data Data to be stringified
|
12782
|
+
* @param {function} [replacer] JSON.stringify() replacer parameter
|
12783
|
+
* @param {string|number} [space] JSON.stringify() space parameter
|
12784
|
+
* @returns {string} The string result
|
12785
|
+
*/
|
12786
|
+
|
12787
|
+
|
12788
|
+
function safeJsonStringify(data, replacer, space) {
|
12789
|
+
const seen = new WeakSet();
|
12790
|
+
let str;
|
12791
|
+
|
12792
|
+
try {
|
12793
|
+
str = JSON.stringify(data, (key, value) => {
|
12794
|
+
let replaced = replacer ? replacer(key, value) : value;
|
12795
|
+
|
12796
|
+
if (typeof replaced === 'object' && replaced !== null) {
|
12797
|
+
if (seen.has(replaced)) {
|
12798
|
+
replaced = '[circular-reference]';
|
12799
|
+
} else {
|
12800
|
+
seen.add(replaced);
|
12801
|
+
}
|
12802
|
+
}
|
12803
|
+
|
12804
|
+
return replaced;
|
12805
|
+
}, space);
|
12806
|
+
} catch (error) {
|
12807
|
+
str = `[error-stringifying:${error.message}]`;
|
12808
|
+
}
|
12809
|
+
|
12810
|
+
return str;
|
12811
|
+
}
|
12707
12812
|
|
12813
|
+
const isSpeakerSupported = !!document.createElement('audio').setSinkId;
|
12708
12814
|
const logFormat = format.printf(_ref => {
|
12709
12815
|
let {
|
12710
12816
|
timestamp,
|
@@ -12718,7 +12824,7 @@ const logFormat = format.printf(_ref => {
|
|
12718
12824
|
let msgString = message;
|
12719
12825
|
|
12720
12826
|
if (Array.isArray(message)) {
|
12721
|
-
msgString = message.map(item => typeof item === 'string' && item ||
|
12827
|
+
msgString = message.map(item => typeof item === 'string' && item || safeJsonStringify(item, (key, value) => value instanceof MediaStream && `MediaStream([${value.getTracks().map(track => track.kind)}])` || value, 2)).join(' ');
|
12722
12828
|
}
|
12723
12829
|
|
12724
12830
|
return `${timestamp} ${level} ${resourceType} ${resourceID} ${action} ${msgString} ${error ? ` ${error.stack || error}` : ''}`;
|
@@ -13396,77 +13502,6 @@ class ShareControl extends MeetingControl {
|
|
13396
13502
|
}
|
13397
13503
|
|
13398
13504
|
}
|
13399
|
-
/**
|
13400
|
-
* Custom rxjs operator for chaining dependent observables.
|
13401
|
-
* Usage:
|
13402
|
-
```js
|
13403
|
-
obs.pipe(
|
13404
|
-
chainWith((lastMessage) => createDependentObservable(lastMessage),
|
13405
|
-
);
|
13406
|
-
```
|
13407
|
-
*
|
13408
|
-
* @param {function(lastMessage): Observable} createDependentObservable Function that is passed the last message emitted by the source observable and returns a new observable
|
13409
|
-
* @returns {Observable} observable
|
13410
|
-
*/
|
13411
|
-
|
13412
|
-
|
13413
|
-
function chainWith(createDependentObservable) {
|
13414
|
-
return source => new Observable(subscriber => {
|
13415
|
-
let lastValue;
|
13416
|
-
let subscription;
|
13417
|
-
subscription = source.subscribe(value => {
|
13418
|
-
subscriber.next(value);
|
13419
|
-
lastValue = value;
|
13420
|
-
}, error => subscriber.error(error), () => {
|
13421
|
-
subscription = createDependentObservable(lastValue).subscribe(value => subscriber.next(value), error => subscriber.error(error), () => subscriber.complete());
|
13422
|
-
});
|
13423
|
-
return () => {
|
13424
|
-
if (subscription) {
|
13425
|
-
subscription.unsubscribe();
|
13426
|
-
}
|
13427
|
-
};
|
13428
|
-
});
|
13429
|
-
}
|
13430
|
-
/**
|
13431
|
-
* Custom rxjs operator that works like combineLatest, but emits even if some of the source observables haven't emitted yet.
|
13432
|
-
* Usage:
|
13433
|
-
```js
|
13434
|
-
combineLatestImmediate(obs1, obs2, ...);
|
13435
|
-
```
|
13436
|
-
*
|
13437
|
-
* @param {ObservableInput} [observables] An array of input Observables to combine with each other.
|
13438
|
-
* @returns {Observable} Observable that emits arrays containing the last emitted value from each of the observables defined above.
|
13439
|
-
*/
|
13440
|
-
|
13441
|
-
|
13442
|
-
function combineLatestImmediate() {
|
13443
|
-
for (var _len = arguments.length, observables = new Array(_len), _key = 0; _key < _len; _key++) {
|
13444
|
-
observables[_key] = arguments[_key];
|
13445
|
-
}
|
13446
|
-
|
13447
|
-
return combineLatest(observables.map(obs => obs.pipe(startWith(undefined))));
|
13448
|
-
}
|
13449
|
-
/**
|
13450
|
-
* Helper function for deep merge on objects.
|
13451
|
-
*
|
13452
|
-
* @param {object} dest - The destination object.
|
13453
|
-
* @param {object} src - The source object.
|
13454
|
-
*/
|
13455
|
-
|
13456
|
-
|
13457
|
-
function deepMerge(dest, src) {
|
13458
|
-
const result = dest;
|
13459
|
-
|
13460
|
-
for (const [key, val] of Object.entries(src || {})) {
|
13461
|
-
if (val && val.constructor === Object) {
|
13462
|
-
deepMerge(result[key], val);
|
13463
|
-
} else {
|
13464
|
-
result[key] = val;
|
13465
|
-
}
|
13466
|
-
}
|
13467
|
-
}
|
13468
|
-
|
13469
|
-
const isSpeakerSupported = !!document.createElement('audio').setSinkId;
|
13470
13505
|
/**
|
13471
13506
|
* Display options of a meeting control.
|
13472
13507
|
*
|
@@ -13474,6 +13509,7 @@ const isSpeakerSupported = !!document.createElement('audio').setSinkId;
|
|
13474
13509
|
* @see {@link https://github.com/webex/component-adapter-interfaces/blob/master/src/MeetingsAdapter.js#L58}
|
13475
13510
|
*/
|
13476
13511
|
|
13512
|
+
|
13477
13513
|
class SwitchCameraControl extends MeetingControl {
|
13478
13514
|
/**
|
13479
13515
|
* Calls the action of the switch camera control.
|
@@ -13500,7 +13536,7 @@ class SwitchCameraControl extends MeetingControl {
|
|
13500
13536
|
meetingID
|
13501
13537
|
}]);
|
13502
13538
|
const cameraID$ = this.adapter.getMeeting(meetingID).pipe(map(meeting => meeting.cameraID), distinctUntilChanged());
|
13503
|
-
const options$ =
|
13539
|
+
const options$ = this.adapter.getAvailableDevices(meetingID, 'videoinput').pipe(map(availableCameras => availableCameras.map(camera => ({
|
13504
13540
|
value: camera.deviceId,
|
13505
13541
|
label: camera.label
|
13506
13542
|
}))));
|
@@ -13553,7 +13589,7 @@ class SwitchMicrophoneControl extends MeetingControl {
|
|
13553
13589
|
meetingID
|
13554
13590
|
}]);
|
13555
13591
|
const microphoneID$ = this.adapter.getMeeting(meetingID).pipe(map(meeting => meeting.microphoneID), distinctUntilChanged());
|
13556
|
-
const options$ =
|
13592
|
+
const options$ = this.adapter.getAvailableDevices(meetingID, 'audioinput').pipe(map(availableMicrophones => availableMicrophones.map(microphone => ({
|
13557
13593
|
value: microphone.deviceId,
|
13558
13594
|
label: microphone.label
|
13559
13595
|
}))));
|
@@ -13606,7 +13642,7 @@ class SwitchSpeakerControl extends MeetingControl {
|
|
13606
13642
|
meetingID
|
13607
13643
|
}]);
|
13608
13644
|
const speakerID$ = this.adapter.getMeeting(meetingID).pipe(map(meeting => meeting.speakerID), distinctUntilChanged());
|
13609
|
-
const options$ =
|
13645
|
+
const options$ = this.adapter.getAvailableDevices(meetingID, 'audiooutput').pipe(map(availableSpeakers => availableSpeakers.map(speaker => ({
|
13610
13646
|
value: speaker.deviceId,
|
13611
13647
|
label: speaker.label
|
13612
13648
|
}))), map(options => [{
|
@@ -13930,7 +13966,7 @@ class MeetingsSDKAdapter extends d {
|
|
13930
13966
|
}
|
13931
13967
|
}, 2000);
|
13932
13968
|
const [localStream] = await sdkMeeting.getMediaStreams(mediaDirection, audioVideo);
|
13933
|
-
const availableDevices = await
|
13969
|
+
const availableDevices = await navigator.mediaDevices.enumerateDevices();
|
13934
13970
|
const [{
|
13935
13971
|
label: deviceLabel
|
13936
13972
|
}] = localStream.getTracks();
|
@@ -13962,10 +13998,7 @@ class MeetingsSDKAdapter extends d {
|
|
13962
13998
|
if (!ignored) {
|
13963
13999
|
let perm;
|
13964
14000
|
const ee = error.error;
|
13965
|
-
logger.error('MEETING', ID, 'getStream()',
|
13966
|
-
mediaDirection,
|
13967
|
-
audioVideo
|
13968
|
-
}], ee);
|
14001
|
+
logger.error('MEETING', ID, 'getStream()', 'Unable to retrieve local media stream', ee || error);
|
13969
14002
|
|
13970
14003
|
if (ee instanceof DOMException) {
|
13971
14004
|
if (ee.name === 'NotAllowedError') {
|
@@ -14019,35 +14052,38 @@ class MeetingsSDKAdapter extends d {
|
|
14019
14052
|
});
|
14020
14053
|
}
|
14021
14054
|
/**
|
14022
|
-
*
|
14055
|
+
* Emits available media devices.
|
14056
|
+
* If the user did no grant access to media (browser and OS), the returned observable
|
14057
|
+
* will emit an empty array.
|
14023
14058
|
*
|
14024
|
-
* @param {string} ID
|
14025
|
-
* @param {'videoinput'|'audioinput'|'audiooutput'}
|
14059
|
+
* @param {string} ID Id of the meeting
|
14060
|
+
* @param {'videoinput'|'audioinput'|'audiooutput'} type String specifying the device type.
|
14026
14061
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/kind|MDN}
|
14027
|
-
* @returns {MediaDeviceInfo[]}
|
14062
|
+
* @returns {Observable<MediaDeviceInfo[]>} Observable that emits arrays containing media devices.
|
14028
14063
|
* @private
|
14029
14064
|
*/
|
14030
|
-
// eslint-disable-next-line class-methods-use-this
|
14031
14065
|
|
14032
14066
|
|
14033
|
-
|
14067
|
+
getAvailableDevices(ID, type) {
|
14034
14068
|
logger.debug('MEETING', ID, 'getAvailableDevices()', ['called with', {
|
14035
14069
|
ID,
|
14036
14070
|
type
|
14037
14071
|
}]);
|
14038
|
-
let devices;
|
14039
14072
|
|
14040
|
-
|
14041
|
-
|
14042
|
-
|
14043
|
-
|
14044
|
-
|
14045
|
-
|
14046
|
-
|
14047
|
-
|
14073
|
+
const getDevices = async () => {
|
14074
|
+
let devices = [];
|
14075
|
+
|
14076
|
+
try {
|
14077
|
+
devices = await this.fetchMeeting(ID).getDevices();
|
14078
|
+
devices = devices.filter(device => !type || device.kind === type && device.deviceId);
|
14079
|
+
} catch (error) {
|
14080
|
+
logger.error('MEETING', ID, 'getAvailableDevices()', 'Unable to retrieve devices', error);
|
14081
|
+
}
|
14082
|
+
|
14083
|
+
return devices;
|
14084
|
+
};
|
14048
14085
|
|
14049
|
-
logger.debug('MEETING', ID, 'getAvailabelDevices()', ['
|
14050
|
-
return devices;
|
14086
|
+
return this.getMeeting(ID).pipe(map(meeting => type !== 'videoinput' && type !== 'audioinput' || type === 'videoinput' && meeting.localVideo.permission === 'ALLOWED' || type === 'audioinput' && meeting.localAudio.permission === 'ALLOWED'), distinctUntilChanged(), concatMap(allowed => from(allowed ? getDevices() : [[]])), tap(devices => logger.debug('MEETING', ID, 'getAvailabelDevices()', ['emitting', devices])));
|
14051
14087
|
}
|
14052
14088
|
/**
|
14053
14089
|
* Update the meeting object with media attached based on a given event type.
|
@@ -14111,21 +14147,24 @@ class MeetingsSDKAdapter extends d {
|
|
14111
14147
|
|
14112
14148
|
case MEDIA_TYPE_REMOTE_SHARE:
|
14113
14149
|
this.meetings[ID] = { ...meeting,
|
14114
|
-
remoteShareStream: stream
|
14150
|
+
remoteShareStream: stream,
|
14151
|
+
remoteShare: meeting.remoteSharing ? stream : null
|
14115
14152
|
};
|
14116
14153
|
break;
|
14117
14154
|
|
14118
14155
|
case EVENT_REMOTE_SHARE_START:
|
14119
14156
|
// Only activate the remote stream when get get the start notification
|
14120
14157
|
this.meetings[ID] = { ...meeting,
|
14121
|
-
remoteShare: meeting.remoteShareStream
|
14158
|
+
remoteShare: meeting.remoteShareStream || null,
|
14159
|
+
remoteSharing: true
|
14122
14160
|
};
|
14123
14161
|
break;
|
14124
14162
|
|
14125
14163
|
case EVENT_REMOTE_SHARE_STOP:
|
14126
14164
|
// Remove remote share on stop event
|
14127
14165
|
this.meetings[ID] = { ...meeting,
|
14128
|
-
remoteShare: null
|
14166
|
+
remoteShare: null,
|
14167
|
+
remoteSharing: false
|
14129
14168
|
};
|
14130
14169
|
break;
|
14131
14170
|
}
|
@@ -15529,7 +15568,7 @@ var defineProperty = defineProperty$1;
|
|
15529
15568
|
})(constants);
|
15530
15569
|
|
15531
15570
|
var name = "@webex/sdk-component-adapter";
|
15532
|
-
var version = "1.
|
15571
|
+
var version = "1.97.1";
|
15533
15572
|
const LOG_ARGS$1 = ['SDK-MEMBERSHIPS', `${name}-${version}`]; // max parameter value must be greater than 0 and less than or equal to 1000
|
15534
15573
|
|
15535
15574
|
const MAX_MEMBERSHIPS = 1000; // TODO: Figure out how to import JS Doc definitions and remove duplication.
|
@@ -16571,7 +16610,7 @@ var WebexMeetings = si(ai(WebexMeetingsWidget), function (props) {
|
|
16571
16610
|
},
|
16572
16611
|
config: {
|
16573
16612
|
appName: appName,
|
16574
|
-
appVersion: "1.22.
|
16613
|
+
appVersion: "1.22.2"
|
16575
16614
|
}
|
16576
16615
|
});
|
16577
16616
|
return new WebexSDKAdapter(webex);
|