mediasfu-angular 2.0.2 → 2.1.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.
@@ -1,5 +1,6 @@
1
1
  import { OnInit, OnDestroy, Injector, ElementRef } from '@angular/core';
2
2
  import { ReUpdateInterType, UpdateParticipantAudioDecibelsType, ReUpdateInterParameters, Participant } from '../../../@types/types';
3
+ import { Consumer } from 'mediasoup-client/lib/types';
3
4
  import * as i0 from "@angular/core";
4
5
  export interface MiniAudioPlayerParameters extends ReUpdateInterParameters {
5
6
  breakOutRoomStarted: boolean;
@@ -12,6 +13,7 @@ export interface MiniAudioPlayerParameters extends ReUpdateInterParameters {
12
13
  }
13
14
  export interface MiniAudioPlayerOptions {
14
15
  stream: MediaStream | null;
16
+ consumer: Consumer | null;
15
17
  remoteProducerId: string;
16
18
  parameters: MiniAudioPlayerParameters;
17
19
  MiniAudioComponent?: any;
@@ -27,12 +29,14 @@ export type MiniAudioPlayerType = (options: MiniAudioPlayerOptions) => HTMLEleme
27
29
  * ```html
28
30
  * <app-mini-audio-player
29
31
  * [stream]="audioStream"
32
+ * [consumer]="audioConsumer"
30
33
  * [remoteProducerId]="producerId"
31
34
  * [parameters]="audioPlayerParameters">
32
35
  * </app-mini-audio-player>
33
36
  * ```
34
37
  *
35
38
  * @param {MediaStream} [stream] - The audio stream from the participant.
39
+ * @param {Consumer} [consumer] - The audio consumer for the participant.
36
40
  * @param {string} [remoteProducerId] - Unique ID for the remote producer of the audio stream.
37
41
  * @param {MiniAudioPlayerParameters} [parameters] - Configuration object with various parameters and utility functions for audio management.
38
42
  * @param {Component} [MiniAudioComponent] - Optional audio visualization component injected into the `MiniAudioPlayer`.
@@ -41,7 +45,7 @@ export type MiniAudioPlayerType = (options: MiniAudioPlayerOptions) => HTMLEleme
41
45
  * @returns {HTMLElement} The created audio player element.
42
46
  *
43
47
  * @remarks
44
- * The `MiniAudioPlayer` leverages the `AudioContext` API to process audio data, analyze frequency, and manage audio levels.
48
+ * The `MiniAudioPlayer` processes audio data and manage audio levels.
45
49
  * It supports a dynamic breakout room feature that restricts audio visibility to limited participants, updates decibel levels for individual participants, and adjusts the waveforms based on audio activity.
46
50
  *
47
51
  * Key functionalities include:
@@ -50,7 +54,6 @@ export type MiniAudioPlayerType = (options: MiniAudioPlayerOptions) => HTMLEleme
50
54
  * - Injecting configuration and parameter dependencies dynamically through `Injector`.
51
55
  *
52
56
  * @dependencies
53
- * - `AudioContext`: Web API for processing and analyzing audio data.
54
57
  * - `setInterval` for periodic volume level checks (auto-clears on component destruction).
55
58
  * - `ReUpdateInterType` and `UpdateParticipantAudioDecibelsType` for dynamic participant audio decibel management.
56
59
  *
@@ -68,6 +71,7 @@ export type MiniAudioPlayerType = (options: MiniAudioPlayerOptions) => HTMLEleme
68
71
  * // Initialize component with required inputs
69
72
  * <app-mini-audio-player
70
73
  * [stream]="audioStream"
74
+ * [consumer]="audioConsumer"
71
75
  * [remoteProducerId]="participantId"
72
76
  * [parameters]="audioPlayerParameters"
73
77
  * ></app-mini-audio-player>
@@ -76,6 +80,7 @@ export type MiniAudioPlayerType = (options: MiniAudioPlayerOptions) => HTMLEleme
76
80
  export declare class MiniAudioPlayer implements OnInit, OnDestroy {
77
81
  private injector;
78
82
  stream: MediaStream | null;
83
+ consumer: Consumer | null;
79
84
  remoteProducerId: string;
80
85
  parameters: MiniAudioPlayerParameters;
81
86
  MiniAudioComponent: any;
@@ -83,19 +88,18 @@ export declare class MiniAudioPlayer implements OnInit, OnDestroy {
83
88
  audioElement: ElementRef<HTMLAudioElement>;
84
89
  showWaveModal: boolean;
85
90
  isMuted: boolean;
86
- audioContext: AudioContext;
87
91
  intervalId: any;
88
92
  autoWaveCheck: boolean;
89
93
  private previousShowWaveModal;
90
94
  private previousIsMuted;
91
95
  private injectorCache;
92
96
  private cachedMiniAudioProps;
93
- constructor(injector: Injector, injectedStream: MediaStream | null, injectedRemoteProducerId: string, injectedParameters: MiniAudioPlayerParameters, injectedMiniAudioComponent: any, injectedMiniAudioProps: Record<string, any>);
97
+ constructor(injector: Injector, injectedStream: MediaStream | null, consumer: Consumer, injectedRemoteProducerId: string, injectedParameters: MiniAudioPlayerParameters, injectedMiniAudioComponent: any, injectedMiniAudioProps: Record<string, any>);
94
98
  ngOnInit(): void;
95
99
  ngOnDestroy(): void;
96
100
  setupAudioProcessing(): void;
97
101
  createInjector(inputs: any): Injector;
98
102
  getMiniAudioProps(): any;
99
- static ɵfac: i0.ɵɵFactoryDeclaration<MiniAudioPlayer, [null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
100
- static ɵcmp: i0.ɵɵComponentDeclaration<MiniAudioPlayer, "app-mini-audio-player", never, { "stream": { "alias": "stream"; "required": false; }; "remoteProducerId": { "alias": "remoteProducerId"; "required": false; }; "parameters": { "alias": "parameters"; "required": false; }; "MiniAudioComponent": { "alias": "MiniAudioComponent"; "required": false; }; "miniAudioProps": { "alias": "miniAudioProps"; "required": false; }; }, {}, never, never, true, never>;
103
+ static ɵfac: i0.ɵɵFactoryDeclaration<MiniAudioPlayer, [null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
104
+ static ɵcmp: i0.ɵɵComponentDeclaration<MiniAudioPlayer, "app-mini-audio-player", never, { "stream": { "alias": "stream"; "required": false; }; "consumer": { "alias": "consumer"; "required": false; }; "remoteProducerId": { "alias": "remoteProducerId"; "required": false; }; "parameters": { "alias": "parameters"; "required": false; }; "MiniAudioComponent": { "alias": "MiniAudioComponent"; "required": false; }; "miniAudioProps": { "alias": "miniAudioProps"; "required": false; }; }, {}, never, never, true, never>;
101
105
  }
@@ -2,7 +2,7 @@ import { Socket } from 'socket.io-client';
2
2
  import { ValidateAlphanumeric } from '../../methods/utils/validate-alphanumeric.service';
3
3
  import { ResponseJoinLocalRoom, PreJoinPageParameters } from '../../@types/types';
4
4
  import { CheckLimitsAndMakeRequest } from '../../methods/utils/check-limits-and-make-request.service';
5
- import { JoinRoomOnMediaSFU } from '../../methods/utils/join-room-on-media-sfu.service';
5
+ import { JoinRoomOnMediaSFU, JoinRoomOnMediaSFUType } from '../../methods/utils/join-room-on-media-sfu.service';
6
6
  import * as i0 from "@angular/core";
7
7
  export interface JoinLocalRoomOptions {
8
8
  socket: Socket;
@@ -13,6 +13,8 @@ export interface JoinLocalRoomOptions {
13
13
  apiUserName: string;
14
14
  parameters: PreJoinPageParameters;
15
15
  checkConnect?: boolean;
16
+ joinMediaSFURoom?: JoinRoomOnMediaSFUType;
17
+ localLink?: string;
16
18
  }
17
19
  export type JoinLocalRoomType = (options: JoinLocalRoomOptions) => Promise<ResponseJoinLocalRoom>;
18
20
  export interface CheckMediasfuURLOptions {
@@ -22,6 +24,8 @@ export interface CheckMediasfuURLOptions {
22
24
  islevel: string;
23
25
  socket: Socket;
24
26
  parameters: PreJoinPageParameters;
27
+ joinMediaSFURoom?: JoinRoomOnMediaSFUType;
28
+ localLink?: string;
25
29
  }
26
30
  export type CheckMediasfuURLType = (options: CheckMediasfuURLOptions) => Promise<void>;
27
31
  /**
@@ -34,6 +38,8 @@ export type CheckMediasfuURLType = (options: CheckMediasfuURLOptions) => Promise
34
38
  * @param {string} options.islevel - The level of the user.
35
39
  * @param {Socket} options.socket - The socket instance to use for communication.
36
40
  * @param {PreJoinPageParameters} options.parameters - Additional parameters for pre-join page actions.
41
+ * @param {JoinRoomOnMediaSFUType} options.joinMediaSFURoom - The function to join a room on MediaSFU.
42
+ * @param {string} options.localLink - The local link to use for Community Edition.
37
43
  *
38
44
  * @returns {Promise<void>} A promise that resolves when the actions are complete.
39
45
  *
@@ -53,6 +59,8 @@ export type CheckMediasfuURLType = (options: CheckMediasfuURLOptions) => Promise
53
59
  * parameters: {
54
60
  * someParameter: "value",
55
61
  * },
62
+ * joinMediaSFURoom: joinRoomOnMediaSFU,
63
+ * localLink: "https://socketserver.example.com",
56
64
  * };
57
65
  *
58
66
  * try {
@@ -78,6 +86,8 @@ export declare class JoinLocalRoom {
78
86
  * @param {string} options.islevel - The level of the user.
79
87
  * @param {Socket} options.socket - The socket instance to use for communication.
80
88
  * @param {PreJoinPageParameters} options.parameters - Additional parameters for pre-join page actions.
89
+ * @param {JoinRoomOnMediaSFUType} options.joinMediaSFURoom - The function to join a room on MediaSFU.
90
+ * @param {string} options.localLink - The local link to use for Community Edition.
81
91
  *
82
92
  * @returns {Promise<void>} A promise that resolves when the actions are complete.
83
93
  *
@@ -97,6 +107,8 @@ export declare class JoinLocalRoom {
97
107
  * parameters: {
98
108
  * someParameter: "value",
99
109
  * },
110
+ * joinMediaSFURoom: joinRoomOnMediaSFU,
111
+ * localLink: "https://socketserver.example.com",
100
112
  * };
101
113
  *
102
114
  * try {
@@ -118,6 +130,8 @@ export declare class JoinLocalRoom {
118
130
  * - `islevel`: User's level indicator.
119
131
  * - `socket`: Socket instance for communication.
120
132
  * - `parameters`: Additional parameters for pre-join page actions.
133
+ * - `joinMediaSFURoom`: Function to join a room on MediaSFU.
134
+ * - `localLink`: Local link to use for Community Edition.
121
135
  */
122
136
  private checkMediasfuURL;
123
137
  static ɵfac: i0.ɵɵFactoryDeclaration<JoinLocalRoom, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasfu-angular",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "author": "MediaSFU",
5
5
  "license": "MIT",
6
6
  "description": "MediaSFU Prebuilt Angular SDK",