mediasfu-angular 2.1.5 → 2.2.0

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.
@@ -182,6 +182,10 @@ export type MediasfuWebinarOptions = {
182
182
  * @input {CreateMediaSFURoomOptions | JoinMediaSFURoomOptions} noUIPreJoinOptions - Options for the prejoin page without UI.
183
183
  * @input {JoinRoomOnMediaSFUType} joinMediaSFURoom - Function to join a room on MediaSFU.
184
184
  * @input {CreateRoomOnMediaSFUType} createMediaSFURoom - Function to create a room on MediaSFU.
185
+ * @input {any} customVideoCard - Custom component to replace the default VideoCard component.
186
+ * @input {any} customAudioCard - Custom component to replace the default AudioCard component.
187
+ * @input {any} customMiniCard - Custom component to replace the default MiniCard component.
188
+ * @input {any} customMainComponent - Custom component that provides complete control over the main UI, bypassing default MediaSFU styling.
185
189
  *
186
190
  * @property {string} title - The title of the component, defaults to "MediaSFU-Webinar".
187
191
  *
@@ -206,13 +210,17 @@ export type MediasfuWebinarOptions = {
206
210
  * [useLocalUIMode]="true"
207
211
  * [seedData]="seedDataObject"
208
212
  * [useSeed]="true"
209
- * [imgSrc]="https://example.com/logo.png">
213
+ * [imgSrc]="'https://example.com/logo.png'"
210
214
  * [sourceParameters]="{ source: 'camera', width: 640, height: 480 }"
211
215
  * [updateSourceParameters]="updateSourceParameters"
212
216
  * [returnUI]="true"
213
217
  * [noUIPreJoinOptions]="{ roomName: 'room1', userName: 'user1' }"
214
218
  * [joinMediaSFURoom]="joinMediaSFURoom"
215
- * [createMediaSFURoom]="createMediaSFURoom">
219
+ * [createMediaSFURoom]="createMediaSFURoom"
220
+ * [customVideoCard]="CustomVideoCardComponent"
221
+ * [customAudioCard]="CustomAudioCardComponent"
222
+ * [customMiniCard]="CustomMiniCardComponent"
223
+ * [customMainComponent]="CustomMainComponent">
216
224
  * </app-mediasfu-webinar>
217
225
  * ```
218
226
  */
@@ -357,6 +365,10 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
357
365
  noUIPreJoinOptions?: CreateMediaSFURoomOptions | JoinMediaSFURoomOptions;
358
366
  joinMediaSFURoom?: JoinRoomOnMediaSFUType;
359
367
  createMediaSFURoom?: CreateRoomOnMediaSFUType;
368
+ customVideoCard: any;
369
+ customAudioCard: any;
370
+ customMiniCard: any;
371
+ customMainComponent: any;
360
372
  title: string;
361
373
  private mainHeightWidthSubscription;
362
374
  private validatedSubscription;
@@ -1768,6 +1780,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
1768
1780
  updateSocket: (value: Socket) => void;
1769
1781
  updateLocalSocket: (value: Socket | null) => void;
1770
1782
  updateValidated: (value: boolean) => void;
1783
+ customVideoCard: any;
1784
+ customAudioCard: any;
1785
+ customMiniCard: any;
1771
1786
  showAlert: ({ message, type, duration, }: {
1772
1787
  message: string;
1773
1788
  type: "success" | "danger";
@@ -2489,6 +2504,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
2489
2504
  updateSocket: (value: Socket) => void;
2490
2505
  updateLocalSocket: (value: Socket | null) => void;
2491
2506
  updateValidated: (value: boolean) => void;
2507
+ customVideoCard: any;
2508
+ customAudioCard: any;
2509
+ customMiniCard: any;
2492
2510
  showAlert: ({ message, type, duration, }: {
2493
2511
  message: string;
2494
2512
  type: "success" | "danger";
@@ -3213,6 +3231,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
3213
3231
  updateSocket: (value: Socket) => void;
3214
3232
  updateLocalSocket: (value: Socket | null) => void;
3215
3233
  updateValidated: (value: boolean) => void;
3234
+ customVideoCard: any;
3235
+ customAudioCard: any;
3236
+ customMiniCard: any;
3216
3237
  showAlert: ({ message, type, duration, }: {
3217
3238
  message: string;
3218
3239
  type: "success" | "danger";
@@ -3934,6 +3955,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
3934
3955
  updateSocket: (value: Socket) => void;
3935
3956
  updateLocalSocket: (value: Socket | null) => void;
3936
3957
  updateValidated: (value: boolean) => void;
3958
+ customVideoCard: any;
3959
+ customAudioCard: any;
3960
+ customMiniCard: any;
3937
3961
  showAlert: ({ message, type, duration, }: {
3938
3962
  message: string;
3939
3963
  type: "success" | "danger";
@@ -4658,6 +4682,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
4658
4682
  updateSocket: (value: Socket) => void;
4659
4683
  updateLocalSocket: (value: Socket | null) => void;
4660
4684
  updateValidated: (value: boolean) => void;
4685
+ customVideoCard: any;
4686
+ customAudioCard: any;
4687
+ customMiniCard: any;
4661
4688
  showAlert: ({ message, type, duration, }: {
4662
4689
  message: string;
4663
4690
  type: "success" | "danger";
@@ -5379,6 +5406,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
5379
5406
  updateSocket: (value: Socket) => void;
5380
5407
  updateLocalSocket: (value: Socket | null) => void;
5381
5408
  updateValidated: (value: boolean) => void;
5409
+ customVideoCard: any;
5410
+ customAudioCard: any;
5411
+ customMiniCard: any;
5382
5412
  showAlert: ({ message, type, duration, }: {
5383
5413
  message: string;
5384
5414
  type: "success" | "danger";
@@ -6194,6 +6224,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
6194
6224
  updateSocket: (value: Socket) => void;
6195
6225
  updateLocalSocket: (value: Socket | null) => void;
6196
6226
  updateValidated: (value: boolean) => void;
6227
+ customVideoCard: any;
6228
+ customAudioCard: any;
6229
+ customMiniCard: any;
6197
6230
  showAlert: ({ message, type, duration, }: {
6198
6231
  message: string;
6199
6232
  type: "success" | "danger";
@@ -6915,6 +6948,9 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
6915
6948
  updateSocket: (value: Socket) => void;
6916
6949
  updateLocalSocket: (value: Socket | null) => void;
6917
6950
  updateValidated: (value: boolean) => void;
6951
+ customVideoCard: any;
6952
+ customAudioCard: any;
6953
+ customMiniCard: any;
6918
6954
  showAlert: ({ message, type, duration, }: {
6919
6955
  message: string;
6920
6956
  type: "success" | "danger";
@@ -7019,5 +7055,5 @@ export declare class MediasfuWebinar implements OnInit, OnDestroy {
7019
7055
  })[];
7020
7056
  connect_Socket(apiUserName: string, token: string, skipSockets?: boolean): Promise<Socket | null>;
7021
7057
  static ɵfac: i0.ɵɵFactoryDeclaration<MediasfuWebinar, never>;
7022
- static ɵcmp: i0.ɵɵComponentDeclaration<MediasfuWebinar, "app-mediasfu-webinar", never, { "PrejoinPage": { "alias": "PrejoinPage"; "required": false; }; "localLink": { "alias": "localLink"; "required": false; }; "connectMediaSFU": { "alias": "connectMediaSFU"; "required": false; }; "credentials": { "alias": "credentials"; "required": false; }; "useLocalUIMode": { "alias": "useLocalUIMode"; "required": false; }; "seedData": { "alias": "seedData"; "required": false; }; "useSeed": { "alias": "useSeed"; "required": false; }; "imgSrc": { "alias": "imgSrc"; "required": false; }; "sourceParameters": { "alias": "sourceParameters"; "required": false; }; "updateSourceParameters": { "alias": "updateSourceParameters"; "required": false; }; "returnUI": { "alias": "returnUI"; "required": false; }; "noUIPreJoinOptions": { "alias": "noUIPreJoinOptions"; "required": false; }; "joinMediaSFURoom": { "alias": "joinMediaSFURoom"; "required": false; }; "createMediaSFURoom": { "alias": "createMediaSFURoom"; "required": false; }; }, {}, never, never, true, never>;
7058
+ static ɵcmp: i0.ɵɵComponentDeclaration<MediasfuWebinar, "app-mediasfu-webinar", never, { "PrejoinPage": { "alias": "PrejoinPage"; "required": false; }; "localLink": { "alias": "localLink"; "required": false; }; "connectMediaSFU": { "alias": "connectMediaSFU"; "required": false; }; "credentials": { "alias": "credentials"; "required": false; }; "useLocalUIMode": { "alias": "useLocalUIMode"; "required": false; }; "seedData": { "alias": "seedData"; "required": false; }; "useSeed": { "alias": "useSeed"; "required": false; }; "imgSrc": { "alias": "imgSrc"; "required": false; }; "sourceParameters": { "alias": "sourceParameters"; "required": false; }; "updateSourceParameters": { "alias": "updateSourceParameters"; "required": false; }; "returnUI": { "alias": "returnUI"; "required": false; }; "noUIPreJoinOptions": { "alias": "noUIPreJoinOptions"; "required": false; }; "joinMediaSFURoom": { "alias": "joinMediaSFURoom"; "required": false; }; "createMediaSFURoom": { "alias": "createMediaSFURoom"; "required": false; }; "customVideoCard": { "alias": "customVideoCard"; "required": false; }; "customAudioCard": { "alias": "customAudioCard"; "required": false; }; "customMiniCard": { "alias": "customMiniCard"; "required": false; }; "customMainComponent": { "alias": "customMainComponent"; "required": false; }; }, {}, never, never, true, never>;
7023
7059
  }
@@ -12,6 +12,9 @@ export interface AddVideosGridParameters extends UpdateMiniCardsGridParameters,
12
12
  forceFullDisplay: boolean;
13
13
  otherGridStreams: CustomMediaComponent[][];
14
14
  updateOtherGridStreams: (otherGridStreams: CustomMediaComponent[][]) => void;
15
+ customVideoCard?: any;
16
+ customAudioCard?: any;
17
+ customMiniCard?: any;
15
18
  updateMiniCardsGrid: UpdateMiniCardsGridType;
16
19
  getUpdatedAllParams: () => AddVideosGridParameters;
17
20
  [key: string]: any;
@@ -37,6 +37,9 @@ export interface PrepopulateUserMediaParameters extends AudioCardParameters {
37
37
  updateScreenForceFullDisplay: (force: boolean) => void;
38
38
  updateUpdateMainWindow: (update: boolean) => void;
39
39
  updateMainGridStream: (components: CustomMediaComponent[]) => void;
40
+ customVideoCard?: any;
41
+ customAudioCard?: any;
42
+ customMiniCard?: any;
40
43
  getUpdatedAllParams: () => PrepopulateUserMediaParameters;
41
44
  [key: string]: any;
42
45
  }
@@ -30,6 +30,7 @@ export interface StreamSuccessVideoParameters extends CreateSendTransportParamet
30
30
  keepBackground: boolean;
31
31
  appliedBackground: boolean;
32
32
  videoProducer: Producer | null;
33
+ updateTransportCreated: (created: boolean) => void;
33
34
  updateTransportCreatedVideo: (created: boolean) => void;
34
35
  updateVideoAlreadyOn: (videoOn: boolean) => void;
35
36
  updateVideoAction: (videoAction: boolean) => void;
@@ -87,6 +88,7 @@ export type StreamSuccessVideoType = (options: StreamSuccessVideoOptions) => Pro
87
88
  * @param {boolean} options.parameters.videoAlreadyOn - Indicates if the video is already on.
88
89
  * @param {Function} options.parameters.showAlert - Function to show alert messages.
89
90
  * @param {Function} options.parameters.updateParticipants - Function to update the participants list.
91
+ * @param {Function} options.parameters.updateTransportCreated - Function to update the transport creation state.
90
92
  * @param {Function} options.parameters.updateTransportCreatedVideo - Function to update the transport creation state.
91
93
  * @param {Function} options.parameters.updateVideoAlreadyOn - Function to update the video status.
92
94
  * @param {Function} options.parameters.updateVideoAction - Function to update the video action state.
@@ -5,7 +5,8 @@ import * as i0 from "@angular/core";
5
5
  *
6
6
  * This method sends a POST request to the MediaSFU API to create a new room.
7
7
  * It validates the provided credentials and dynamically constructs the API endpoint,
8
- * supporting the Community Edition via a custom `localLink`.
8
+ * supporting the Community Edition via a custom `localLink`. The method includes
9
+ * a 30-second protection mechanism to prevent duplicate room creation requests.
9
10
  *
10
11
  * @param {object} options - Configuration options for creating the room.
11
12
  * @param {CreateMediaSFURoomOptions | JoinMediaSFURoomOptions} options.payload -
@@ -28,12 +29,12 @@ import * as i0 from "@angular/core";
28
29
  * const response = await createRoomOnMediaSFU.createRoomOnMediaSFU({
29
30
  * payload: {
30
31
  * action: 'create',
31
- * duration: 120, // Duration in minutes
32
- * capacity: 20, // Max participants
32
+ * duration: 60, // Duration in minutes
33
+ * capacity: 10, // Max participants
33
34
  * userName: 'hostUser',
34
35
  * scheduledDate: Date.now() + 3600000, // One hour from now
35
36
  * secureCode: 'secure123', // Optional
36
- * eventType: 'webinar', // Optional
37
+ * eventType: 'conference', // Optional
37
38
  * },
38
39
  * apiUserName: 'yourAPIUSERNAME',
39
40
  * apiKey: 'yourAPIKEY',
@@ -53,7 +54,8 @@ export declare class CreateRoomOnMediaSFU {
53
54
  *
54
55
  * This method sends a POST request to the MediaSFU API to create a new room.
55
56
  * It validates the provided credentials and dynamically constructs the API endpoint,
56
- * supporting the Community Edition via a custom `localLink`.
57
+ * supporting the Community Edition via a custom `localLink`. The method includes
58
+ * a 30-second protection mechanism to prevent duplicate room creation requests.
57
59
  *
58
60
  * @param {object} options - Configuration options for creating the room.
59
61
  * @param {CreateMediaSFURoomOptions | JoinMediaSFURoomOptions} options.payload -
@@ -76,12 +78,12 @@ export declare class CreateRoomOnMediaSFU {
76
78
  * const response = await createRoomOnMediaSFU.createRoomOnMediaSFU({
77
79
  * payload: {
78
80
  * action: 'create',
79
- * duration: 120, // Duration in minutes
80
- * capacity: 20, // Max participants
81
+ * duration: 60, // Duration in minutes
82
+ * capacity: 10, // Max participants
81
83
  * userName: 'hostUser',
82
84
  * scheduledDate: Date.now() + 3600000, // One hour from now
83
85
  * secureCode: 'secure123', // Optional
84
- * eventType: 'webinar', // Optional
86
+ * eventType: 'conference', // Optional
85
87
  * },
86
88
  * apiUserName: 'yourAPIUSERNAME',
87
89
  * apiKey: 'yourAPIKEY',
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Custom Component Injection Service
3
+ * Manages custom component injection and rendering for MediaSFU Angular components
4
+ */
5
+ import { Injector, ComponentRef, ViewContainerRef, Type } from '@angular/core';
6
+ import { CustomComponent, CustomComponentType, CustomComponentFunction, CustomComponentParameters, CustomComponentContext } from '../@types/custom-component.types';
7
+ import * as i0 from "@angular/core";
8
+ export declare class CustomComponentInjectionService {
9
+ private defaultConfig;
10
+ constructor();
11
+ /**
12
+ * Creates an injector with custom parameters for component injection
13
+ * @param parameters Custom parameters to inject
14
+ * @param parentInjector Parent injector to inherit from
15
+ * @returns New injector with custom parameters
16
+ */
17
+ createCustomInjector(parameters: CustomComponentParameters, parentInjector?: Injector): Injector;
18
+ /**
19
+ * Checks if a component is a custom Angular component
20
+ */
21
+ isCustomComponent<T>(comp: CustomComponentType<T>): comp is CustomComponent<T>;
22
+ /**
23
+ * Checks if a component is a function-based component
24
+ */
25
+ isFunctionComponent(comp: CustomComponentType): comp is CustomComponentFunction;
26
+ /**
27
+ * Checks if a component is an HTML element
28
+ */
29
+ isHTMLElement(comp: CustomComponentType): comp is HTMLElement;
30
+ /**
31
+ * Safely gets the outerHTML of an HTMLElement component
32
+ * @param comp Component that could be HTMLElement or CustomComponent
33
+ * @returns outerHTML string or empty string if not HTMLElement
34
+ */
35
+ getHtmlElementOuterHTML<T>(comp: CustomComponentType<T>): string;
36
+ /**
37
+ * Renders a custom component in the specified container
38
+ * @param customComponent The custom component to render
39
+ * @param container ViewContainerRef where the component should be rendered
40
+ * @param context Component context with parameters and configuration
41
+ * @returns ComponentRef or HTMLElement reference
42
+ */
43
+ renderCustomComponent<T>(customComponent: CustomComponentType<T>, container: ViewContainerRef, context: CustomComponentContext): ComponentRef<T> | HTMLElement | null;
44
+ /**
45
+ * Creates a component object with injector for dynamic component rendering
46
+ * @param componentType Component type
47
+ * @param parameters Parameters to inject
48
+ * @param parentInjector Parent injector
49
+ * @returns Component object with injector
50
+ */
51
+ createComponentWithInjector<T>(componentType: Type<T>, parameters?: CustomComponentParameters, parentInjector?: Injector): CustomComponent<T>;
52
+ /**
53
+ * Validates if a custom component can be rendered
54
+ * @param customComponent Component to validate
55
+ * @returns boolean indicating if component is valid
56
+ */
57
+ validateCustomComponent<T>(customComponent: CustomComponentType<T>): boolean;
58
+ /**
59
+ * Merges custom component options with defaults
60
+ * @param customOptions Custom component options
61
+ * @param defaultOptions Default component options
62
+ * @returns Merged options
63
+ */
64
+ mergeComponentOptions<T>(customOptions: Partial<T>, defaultOptions: T): T;
65
+ /**
66
+ * Destroys a custom component and cleans up resources
67
+ * @param componentRef Component reference to destroy
68
+ */
69
+ destroyCustomComponent<T>(componentRef: ComponentRef<T> | HTMLElement | null): void;
70
+ /**
71
+ * Helper method to resolve component from custom or default
72
+ * This is useful for the pattern: customComponent || defaultComponent
73
+ * @param customComponent Custom component (can be undefined)
74
+ * @param defaultComponent Default fallback component
75
+ * @returns The resolved component
76
+ */
77
+ resolveComponent<T>(customComponent: CustomComponentType<T> | undefined, defaultComponent: CustomComponentType<T>): CustomComponentType<T>;
78
+ /**
79
+ * Checks if we should use custom main component (for template restructuring)
80
+ * @param customMainComponent Custom main component
81
+ * @returns boolean indicating if custom main component should be used
82
+ */
83
+ shouldUseCustomMainComponent<T>(customMainComponent: CustomComponentType<T> | undefined): boolean;
84
+ static ɵfac: i0.ɵɵFactoryDeclaration<CustomComponentInjectionService, never>;
85
+ static ɵprov: i0.ɵɵInjectableDeclaration<CustomComponentInjectionService>;
86
+ }
@@ -51,6 +51,7 @@ export * from './lib/methods/polls-methods/launch-poll.service';
51
51
  export * from './lib/methods/background-methods/launch-background.service';
52
52
  export * from './lib/methods/breakout-room-methods/launch-breakout-rooms.service';
53
53
  export * from './lib/methods/whiteboard-methods/launch-configure-whiteboard.service';
54
+ export * from './lib/services/custom-component-injection.service';
54
55
  export * from './lib/sockets/socket-manager.service';
55
56
  export * from './lib/producer-client/producer-client-emits/join-room-client.service';
56
57
  export * from './lib/producer-client/producer-client-emits/update-room-parameters-client.service';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasfu-angular",
3
- "version": "2.1.5",
3
+ "version": "2.2.0",
4
4
  "author": "MediaSFU",
5
5
  "license": "MIT",
6
6
  "description": "MediaSFU Prebuilt Angular SDK",
@@ -14,26 +14,26 @@
14
14
  "email": "info@mediasfu.com"
15
15
  },
16
16
  "peerDependencies": {
17
- "@angular/animations": "^19.0.1",
18
- "@angular/common": "^19.0.1",
19
- "@angular/compiler": "^19.0.1",
20
- "@angular/core": "^19.0.1",
21
- "@angular/forms": "^19.0.1",
22
- "@angular/platform-browser": "^19.0.1",
23
- "@angular/platform-browser-dynamic": "^19.0.1",
24
- "@angular/router": "^19.0.1",
17
+ "@angular/animations": "^19.2.15",
18
+ "@angular/common": "^19.2.15",
19
+ "@angular/compiler": "^19.2.15",
20
+ "@angular/core": "^19.2.15",
21
+ "@angular/forms": "^19.2.15",
22
+ "@angular/platform-browser": "^19.2.15",
23
+ "@angular/platform-browser-dynamic": "^19.2.15",
24
+ "@angular/router": "^19.2.15",
25
25
  "@fortawesome/angular-fontawesome": "^1.0.0",
26
- "@fortawesome/fontawesome-svg-core": "^6.7.1",
27
- "@fortawesome/free-brands-svg-icons": "^6.7.1",
28
- "@fortawesome/free-solid-svg-icons": "^6.7.1",
26
+ "@fortawesome/fontawesome-svg-core": "^6.7.2",
27
+ "@fortawesome/free-brands-svg-icons": "^6.7.2",
28
+ "@fortawesome/free-solid-svg-icons": "^6.7.2",
29
29
  "@mediapipe/selfie_segmentation": "^0.1.1675465747",
30
30
  "@zxing/ngx-scanner": "^19.0.0",
31
- "bootstrap": "^5.3.3",
32
- "ngx-cookie-service": "^19.0.0",
31
+ "bootstrap": "^5.3.8",
32
+ "ngx-cookie-service": "^19.1.2",
33
33
  "rxjs": "~7.8.0",
34
34
  "zone.js": "~0.15.0",
35
35
  "mediasoup-client": "3.7.17",
36
- "socket.io-client": "^4.3.2"
36
+ "socket.io-client": "^4.8.1"
37
37
  },
38
38
  "dependencies": {
39
39
  "tslib": "^2.3.0"