@webex/plugin-meetings 2.14.1 → 2.14.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "2.14.1",
3
+ "version": "2.14.2",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -24,19 +24,19 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@babel/runtime-corejs2": "^7.14.8",
27
- "@webex/webex-core": "2.14.1",
28
- "@webex/internal-plugin-mercury": "2.14.1",
29
- "@webex/internal-plugin-conversation": "2.14.1",
27
+ "@webex/webex-core": "2.14.2",
28
+ "@webex/internal-plugin-mercury": "2.14.2",
29
+ "@webex/internal-plugin-conversation": "2.14.2",
30
30
  "webrtc-adapter": "^7.7.0",
31
31
  "lodash": "^4.17.21",
32
32
  "uuid": "^3.3.2",
33
33
  "global": "^4.4.0",
34
34
  "ip-anonymize": "^0.1.0",
35
- "@webex/common": "2.14.1",
35
+ "@webex/common": "2.14.2",
36
36
  "bowser": "^2.11.0",
37
37
  "sdp-transform": "^2.12.0",
38
38
  "readable-stream": "^3.6.0",
39
- "@webex/common-timers": "2.14.1",
39
+ "@webex/common-timers": "2.14.2",
40
40
  "btoa": "^1.2.1",
41
41
  "@webex/internal-media-core": "^0.0.6-beta",
42
42
  "javascript-state-machine": "^3.1.0",
package/src/constants.js CHANGED
@@ -637,6 +637,7 @@ export const LOCUS = {
637
637
  export const LOCUSINFO = {
638
638
  EVENTS: {
639
639
  CONTROLS_RECORDING_UPDATED: 'CONTROLS_RECORDING_UPDATED',
640
+ CONTROLS_MEETING_TRANSCRIBE_UPDATED: 'CONTROLS_MEETING_TRANSCRIBE_UPDATED',
640
641
  CONTROLS_MEETING_CONTAINER_UPDATED: 'CONTROLS_MEETING_CONTAINER_UPDATED',
641
642
  SELF_UNADMITTED_GUEST: 'SELF_UNADMITTED_GUEST',
642
643
  SELF_ADMITTED_GUEST: 'SELF_ADMITTED_GUEST',
@@ -35,6 +35,13 @@ ControlsUtils.parse = (controls) => {
35
35
  };
36
36
  }
37
37
 
38
+ if (controls && controls.transcribe) {
39
+ parsedControls.transcribe = {
40
+ transcribing: controls.transcribe.transcribing,
41
+ caption: controls.transcribe.caption
42
+ };
43
+ }
44
+
38
45
  return parsedControls;
39
46
  };
40
47
 
@@ -63,6 +70,10 @@ ControlsUtils.getControls = (oldControls, newControls) => {
63
70
  hasMeetingContainerChanged: current?.meetingContainer &&
64
71
  !isEqual(previous?.meetingContainer?.meetingContainerUrl,
65
72
  current?.meetingContainer?.meetingContainerUrl),
73
+
74
+ hasTranscribeChanged: current?.transcribe &&
75
+ !isEqual(previous?.transcribe?.transcribing, current?.transcribe?.transcribing) && // upon first join, previous?.record?.recording = undefined; thus, never going to be equal and will always return true
76
+ (previous?.transcribe?.transcribing || current?.transcribe?.transcribing), // therefore, condition added to prevent false firings of #meeting:recording:stopped upon first joining a meeting
66
77
  }
67
78
  };
68
79
  };
@@ -618,6 +618,7 @@ export default class LocusInfo extends EventsScope {
618
618
  hasRecordingChanged,
619
619
  hasRecordingPausedChanged,
620
620
  hasMeetingContainerChanged,
621
+ hasTranscribeChanged
621
622
  },
622
623
  current
623
624
  } = ControlsUtils.getControls(this.controls, controls);
@@ -667,6 +668,21 @@ export default class LocusInfo extends EventsScope {
667
668
  );
668
669
  }
669
670
 
671
+ if (hasTranscribeChanged) {
672
+ const {transcribing, caption} = current.transcribe;
673
+
674
+ this.emitScoped(
675
+ {
676
+ file: 'locus-info',
677
+ function: 'updateControls'
678
+ },
679
+ LOCUSINFO.EVENTS.CONTROLS_MEETING_TRANSCRIBE_UPDATED,
680
+ {
681
+ transcribing, caption
682
+ }
683
+ );
684
+ }
685
+
670
686
  this.controls = controls;
671
687
  }
672
688
  }
@@ -1593,6 +1593,24 @@ export default class Meeting extends StatelessWebexPlugin {
1593
1593
  {meetingContainerUrl}
1594
1594
  );
1595
1595
  });
1596
+
1597
+ this.locusInfo.on(LOCUSINFO.EVENTS.CONTROLS_MEETING_TRANSCRIBE_UPDATED,
1598
+ ({caption, transcribing}) => {
1599
+ if (transcribing && this.transcription && this.config.receiveTranscription) {
1600
+ this.receiveTranscription();
1601
+ }
1602
+ else if (!transcribing && this.transcription) {
1603
+ Trigger.trigger(
1604
+ this,
1605
+ {
1606
+ file: 'meeting/index',
1607
+ function: 'setupLocusControlsListener'
1608
+ },
1609
+ EVENT_TRIGGERS.MEETING_STOPPED_RECEIVING_TRANSCRIPTION,
1610
+ {caption, transcribing}
1611
+ );
1612
+ }
1613
+ });
1596
1614
  }
1597
1615
 
1598
1616
  /**
@@ -3397,7 +3415,7 @@ export default class Meeting extends StatelessWebexPlugin {
3397
3415
  * @throws TranscriptionNotSupportedError
3398
3416
  */
3399
3417
  isTranscriptionSupported() {
3400
- if (this.policy?.WEBEX_ASSISTANT_STATUS_ACTIVE) {
3418
+ if (this.locusInfo.controls.transcribe?.transcribing) {
3401
3419
  return true;
3402
3420
  }
3403
3421
 
@@ -255,6 +255,40 @@ describe('plugin-meetings', () => {
255
255
  });
256
256
  });
257
257
 
258
+ it('should update the transcript state', () => {
259
+ locusInfo.emitScoped = sinon.stub();
260
+ locusInfo.controls = {
261
+ lock: {},
262
+ meetingFull: {},
263
+ record: {
264
+ recording: false,
265
+ paused: true,
266
+ meta: {
267
+ lastModified: 'TODAY',
268
+ modifiedBy: 'George Kittle'
269
+ }
270
+ },
271
+ shareControl: {},
272
+ transcribe: {
273
+ transcribing: false,
274
+ caption: false
275
+ }
276
+ };
277
+ newControls.transcribe.transcribing = true;
278
+ newControls.transcribe.caption = true;
279
+
280
+ locusInfo.updateControls(newControls);
281
+
282
+ assert.calledWith(locusInfo.emitScoped, {
283
+ file: 'locus-info',
284
+ function: 'updateControls'
285
+ },
286
+ LOCUSINFO.EVENTS.CONTROLS_MEETING_TRANSCRIBE_UPDATED,
287
+ {
288
+ transcribing: true, caption: true
289
+ });
290
+ });
291
+
258
292
  it('should update the meetingContainerURL from null', () => {
259
293
  locusInfo.controls = {
260
294
  meetingContainer: {meetingContainerUrl: null},
@@ -724,16 +724,12 @@ describe('plugin-meetings', () => {
724
724
  });
725
725
  describe('#isTranscriptionSupported', () => {
726
726
  it('should return false if the feature is not supported for the meeting', () => {
727
- meeting.policy = {
728
- WEBEX_ASSISTANT_STATUS_INACTIVE: true
729
- };
727
+ meeting.locusInfo.controls = {transcribe: {transcribing: false}};
730
728
 
731
729
  assert.equal(meeting.isTranscriptionSupported(), false);
732
730
  });
733
731
  it('should return true if webex assitant is enabled', () => {
734
- meeting.policy = {
735
- WEBEX_ASSISTANT_STATUS_ACTIVE: true
736
- };
732
+ meeting.locusInfo.controls = {transcribe: {transcribing: true}};
737
733
 
738
734
  assert.equal(meeting.isTranscriptionSupported(), true);
739
735
  });