@webex/plugin-meetings 3.0.0-beta.144 → 3.0.0-beta.146

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.
@@ -1,3 +1,5 @@
1
+ import {ANNOTATION_POLICY} from './constants';
2
+
1
3
  /**
2
4
  * Type for an StrokeData Object
3
5
  */
@@ -23,6 +25,13 @@ type CommandRequestBody = {
23
25
  shareInstanceId: string;
24
26
  receivers?: any[];
25
27
  };
28
+ /**
29
+ * Type for an annotation Object include annotation version and privilege
30
+ */
31
+ type AnnotationInfo = {
32
+ version: string;
33
+ policy: ANNOTATION_POLICY;
34
+ };
26
35
 
27
36
  interface IAnnotationChannel {
28
37
  // === below is for presenter
@@ -40,4 +49,4 @@ interface IAnnotationChannel {
40
49
  locusUrlUpdate: (locusUrl: string) => void;
41
50
  }
42
51
 
43
- export type {StrokeData, RequestData, CommandRequestBody, IAnnotationChannel};
52
+ export type {StrokeData, RequestData, CommandRequestBody, IAnnotationChannel, AnnotationInfo};
@@ -12,11 +12,11 @@ export const ANNOTATION_STATUS = {
12
12
  RUNNING_ANNOTATION: 'RUNNING_ANNOTATION',
13
13
  };
14
14
 
15
- export const ANNOTATION_POLICY = {
16
- ANYONE_CAN_ANNOTATE: 'AnyoneCanAnnotate',
17
- APPROVAL: 'Approval',
18
- ANNOTATION_NOT_ALLOWED: 'AnnotationNotAllowed',
19
- };
15
+ export enum ANNOTATION_POLICY {
16
+ ANYONE_CAN_ANNOTATE = 'AnyoneCanAnnotate',
17
+ APPROVAL = 'Approval',
18
+ ANNOTATION_NOT_ALLOWED = 'AnnotationNotAllowed',
19
+ }
20
20
 
21
21
  export const ANNOTATION_REQUEST_TYPE = {
22
22
  ANNOTATION_MESSAGE: 'annotation_message',
package/src/constants.ts CHANGED
@@ -842,6 +842,7 @@ export const DISPLAY_HINTS = {
842
842
 
843
843
  // breakout session
844
844
  BREAKOUT_MANAGEMENT: 'BREAKOUT_MANAGEMENT',
845
+ BROADCAST_MESSAGE_TO_BREAKOUT: 'BROADCAST_MESSAGE_TO_BREAKOUT',
845
846
  UCF_SUPPRESS_BREAKOUTS_SUPPORT: 'UCF_SUPPRESS_BREAKOUTS_SUPPORT',
846
847
  DISABLE_ASK_FOR_HELP: 'DISABLE_ASK_FOR_HELP',
847
848
  DISABLE_BREAKOUT_PREASSIGNMENTS: 'DISABLE_BREAKOUT_PREASSIGNMENTS',
@@ -42,6 +42,7 @@ interface IInMeetingActions {
42
42
  waitingForOthersToJoin?: boolean;
43
43
  canSendReactions?: boolean;
44
44
  canManageBreakout?: boolean;
45
+ canBroadcastMessageToBreakout?: boolean;
45
46
  canAdmitLobbyToBreakout?: boolean;
46
47
  isBreakoutPreassignmentsEnabled?: boolean;
47
48
  canUserAskForHelp?: boolean;
@@ -143,6 +144,8 @@ export default class InMeetingActions implements IInMeetingActions {
143
144
 
144
145
  canManageBreakout = null;
145
146
 
147
+ canBroadcastMessageToBreakout = null;
148
+
146
149
  canAdmitLobbyToBreakout = null;
147
150
 
148
151
  isBreakoutPreassignmentsEnabled = null;
@@ -235,6 +238,7 @@ export default class InMeetingActions implements IInMeetingActions {
235
238
  waitingForOthersToJoin: this.waitingForOthersToJoin,
236
239
  canSendReactions: this.canSendReactions,
237
240
  canManageBreakout: this.canManageBreakout,
241
+ canBroadcastMessageToBreakout: this.canBroadcastMessageToBreakout,
238
242
  canAdmitLobbyToBreakout: this.canAdmitLobbyToBreakout,
239
243
  isBreakoutPreassignmentsEnabled: this.isBreakoutPreassignmentsEnabled,
240
244
  canUserAskForHelp: this.canUserAskForHelp,
@@ -124,6 +124,7 @@ import RecordingController from '../recording-controller';
124
124
  import ControlsOptionsManager from '../controls-options-manager';
125
125
  import PermissionError from '../common/errors/permission';
126
126
  import {LocusMediaRequest} from './locusMediaRequest';
127
+ import {AnnotationInfo} from '../annotation/annotation.types';
127
128
 
128
129
  const {isBrowser} = BrowserDetection();
129
130
 
@@ -537,6 +538,7 @@ export default class Meeting extends StatelessWebexPlugin {
537
538
  roles: any[];
538
539
  environment: string;
539
540
  namespace = MEETINGS;
541
+ annotationInfo: AnnotationInfo;
540
542
 
541
543
  /**
542
544
  * @param {Object} attrs
@@ -2588,6 +2590,9 @@ export default class Meeting extends StatelessWebexPlugin {
2588
2590
  payload.info.userDisplayHints
2589
2591
  ),
2590
2592
  canManageBreakout: MeetingUtil.canManageBreakout(payload.info.userDisplayHints),
2593
+ canBroadcastMessageToBreakout: MeetingUtil.canBroadcastMessageToBreakout(
2594
+ payload.info.userDisplayHints
2595
+ ),
2591
2596
  canAdmitLobbyToBreakout: MeetingUtil.canAdmitLobbyToBreakout(
2592
2597
  payload.info.userDisplayHints
2593
2598
  ),
@@ -6580,6 +6585,7 @@ export default class Meeting extends StatelessWebexPlugin {
6580
6585
  deviceUrl: this.deviceUrl,
6581
6586
  uri: content.url,
6582
6587
  resourceUrl: this.resourceUrl,
6588
+ annotationInfo: this.annotationInfo,
6583
6589
  })
6584
6590
  .then(() => {
6585
6591
  this.isSharing = true;
@@ -7697,13 +7703,14 @@ export default class Meeting extends StatelessWebexPlugin {
7697
7703
  audio?: LocalTrack; // todo: for now screen share audio is not supported (will be done in SPARK-399690)
7698
7704
  video?: LocalDisplayTrack;
7699
7705
  };
7706
+ annotationInfo?: AnnotationInfo;
7700
7707
  }): Promise<void> {
7701
7708
  this.checkMediaConnection();
7702
7709
 
7703
7710
  if (!this.isMultistream) {
7704
7711
  throw new Error('publishTracks() only supported with multistream');
7705
7712
  }
7706
-
7713
+ this.annotationInfo = tracks.annotationInfo;
7707
7714
  if (tracks.screenShare?.video) {
7708
7715
  const oldTrack = this.mediaProperties.shareTrack;
7709
7716
  const localDisplayTrack = tracks.screenShare?.video;
@@ -29,6 +29,7 @@ import {
29
29
  } from '../constants';
30
30
  import {SendReactionOptions, ToggleReactionsOptions} from './request.type';
31
31
  import MeetingUtil from './util';
32
+ import {AnnotationInfo} from '../annotation/annotation.types';
32
33
 
33
34
  /**
34
35
  * @class MeetingRequest
@@ -630,7 +631,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
630
631
  deviceUrl: string;
631
632
  resourceId: string;
632
633
  uri: string;
633
- annotation: any;
634
+ annotationInfo: AnnotationInfo;
634
635
  }
635
636
  | any
636
637
  ) {
@@ -664,8 +665,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
664
665
  if (options?.resourceToken) {
665
666
  body.resourceToken = options?.resourceToken;
666
667
  }
667
- if (options?.annotation) {
668
- body.annotation = options?.annotation;
668
+ if (options?.annotationInfo) {
669
+ body.annotation = options?.annotationInfo;
669
670
  }
670
671
 
671
672
  // @ts-ignore
@@ -365,6 +365,8 @@ const MeetingUtil = {
365
365
  displayHints.includes(DISPLAY_HINTS.LEAVE_END_MEETING),
366
366
 
367
367
  canManageBreakout: (displayHints) => displayHints.includes(DISPLAY_HINTS.BREAKOUT_MANAGEMENT),
368
+ canBroadcastMessageToBreakout: (displayHints) =>
369
+ displayHints.includes(DISPLAY_HINTS.BROADCAST_MESSAGE_TO_BREAKOUT),
368
370
 
369
371
  isSuppressBreakoutSupport: (displayHints) =>
370
372
  displayHints.includes(DISPLAY_HINTS.UCF_SUPPRESS_BREAKOUTS_SUPPORT),
@@ -38,6 +38,7 @@ describe('plugin-meetings', () => {
38
38
  waitingForOthersToJoin: null,
39
39
  canSendReactions: null,
40
40
  canManageBreakout: null,
41
+ canBroadcastMessageToBreakout: null,
41
42
  canAdmitLobbyToBreakout: null,
42
43
  canUserAskForHelp: null,
43
44
  canUserRenameSelfAndObserved: null,
@@ -108,6 +109,7 @@ describe('plugin-meetings', () => {
108
109
  'waitingForOthersToJoin',
109
110
  'canSendReactions',
110
111
  'canManageBreakout',
112
+ 'canBroadcastMessageToBreakout',
111
113
  'canAdmitLobbyToBreakout',
112
114
  'canUserAskForHelp',
113
115
  'canUserRenameSelfAndObserved',
@@ -86,6 +86,7 @@ import {
86
86
  MeetingInfoV2PasswordError,
87
87
  MeetingInfoV2PolicyError,
88
88
  } from '../../../../src/meeting-info/meeting-info-v2';
89
+ import {ANNOTATION_POLICY} from "../../../../src/annotation/constants";
89
90
 
90
91
  const {getBrowserName, getOSVersion} = BrowserDetection();
91
92
 
@@ -4130,6 +4131,14 @@ describe('plugin-meetings', () => {
4130
4131
  checkScreenShareVideoPublished(videoShareTrack);
4131
4132
  });
4132
4133
  });
4134
+ it('creates instance and publishes with annotation info', async () => {
4135
+ const annotationInfo = {
4136
+ version: '1',
4137
+ policy: ANNOTATION_POLICY.APPROVAL,
4138
+ };
4139
+ await meeting.publishTracks({annotationInfo});
4140
+ assert.equal(meeting.annotationInfo, annotationInfo);
4141
+ });
4133
4142
 
4134
4143
  describe('unpublishTracks', () => {
4135
4144
  beforeEach(async () => {
@@ -560,13 +560,13 @@ describe('plugin-meetings', () => {
560
560
  const deviceUrl = 'deviceUrl';
561
561
  const locusUrl = 'locusUrl';
562
562
  meetingsRequest.config.meetings.deviceType = 'deviceType';
563
-
563
+
564
564
  await meetingsRequest.declineMeeting({
565
565
  locusUrl,
566
566
  deviceUrl,
567
567
  reason
568
568
  });
569
-
569
+
570
570
  const expectedBody = {
571
571
  device: {
572
572
  deviceType: 'deviceType',
@@ -574,7 +574,7 @@ describe('plugin-meetings', () => {
574
574
  },
575
575
  reason,
576
576
  };
577
-
577
+
578
578
  checkRequest({
579
579
  method: 'PUT',
580
580
  uri: `${locusUrl}/participant/decline`,
@@ -606,7 +606,7 @@ describe('plugin-meetings', () => {
606
606
  resourceId: 'resourceId',
607
607
  resourceUrl: 'resourceUrl',
608
608
  uri: 'optionsUrl',
609
- annotation:{
609
+ annotationInfo:{
610
610
  version: '1',
611
611
  policy: 'Approval',
612
612
  },
@@ -590,6 +590,13 @@ describe('plugin-meetings', () => {
590
590
  });
591
591
  });
592
592
 
593
+ describe('canBroadcastMessageToBreakout', () => {
594
+ it('works as expected', () => {
595
+ assert.deepEqual(MeetingUtil.canBroadcastMessageToBreakout(['BROADCAST_MESSAGE_TO_BREAKOUT']), true);
596
+ assert.deepEqual(MeetingUtil.canBroadcastMessageToBreakout([]), false);
597
+ });
598
+ });
599
+
593
600
  describe('isSuppressBreakoutSupport', () => {
594
601
  it('works as expected', () => {
595
602
  assert.deepEqual(