mediasfu-angular 2.2.0 → 2.2.1
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/README.md +1514 -432
- package/dist/README.md +1514 -432
- package/dist/fesm2022/mediasfu-angular.mjs +235 -0
- package/dist/fesm2022/mediasfu-angular.mjs.map +1 -1
- package/dist/lib/components/mediasfu-components/mediasfu-broadcast.component.d.ts +52 -0
- package/dist/lib/components/mediasfu-components/mediasfu-chat.component.d.ts +52 -0
- package/dist/lib/components/mediasfu-components/mediasfu-conference.component.d.ts +64 -0
- package/dist/lib/components/mediasfu-components/mediasfu-generic.component.d.ts +64 -0
- package/dist/lib/components/mediasfu-components/mediasfu-webinar.component.d.ts +64 -0
- package/package.json +1 -1
|
@@ -35321,6 +35321,51 @@ class MediasfuGeneric {
|
|
|
35321
35321
|
});
|
|
35322
35322
|
return inj;
|
|
35323
35323
|
}
|
|
35324
|
+
/**
|
|
35325
|
+
* Gets a list of media devices filtered by the specified kind.
|
|
35326
|
+
* @param kind - The kind of media device to filter by ('videoinput' or 'audioinput')
|
|
35327
|
+
* @returns A promise that resolves to an array of MediaDeviceInfo objects
|
|
35328
|
+
*/
|
|
35329
|
+
getMediaDevicesList = async (kind) => {
|
|
35330
|
+
try {
|
|
35331
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
35332
|
+
return devices.filter((device) => device.kind === kind);
|
|
35333
|
+
}
|
|
35334
|
+
catch (error) {
|
|
35335
|
+
console.error('Error enumerating devices:', error);
|
|
35336
|
+
return [];
|
|
35337
|
+
}
|
|
35338
|
+
};
|
|
35339
|
+
/**
|
|
35340
|
+
* Gets the media stream for a participant by their ID or name.
|
|
35341
|
+
* @param options - Object containing id, name, and kind parameters
|
|
35342
|
+
* @returns A promise that resolves to the participant's MediaStream or null if not found
|
|
35343
|
+
*/
|
|
35344
|
+
getParticipantMedia = async (options) => {
|
|
35345
|
+
const { id, name, kind } = options;
|
|
35346
|
+
try {
|
|
35347
|
+
const streams = kind === 'video' ? this.allVideoStreams.value : this.allAudioStreams.value;
|
|
35348
|
+
// Search by producerId if provided
|
|
35349
|
+
if (id) {
|
|
35350
|
+
const streamObj = streams.find((obj) => obj.producerId === id);
|
|
35351
|
+
if (streamObj && 'stream' in streamObj) {
|
|
35352
|
+
return streamObj.stream || null;
|
|
35353
|
+
}
|
|
35354
|
+
}
|
|
35355
|
+
// Search by name if provided
|
|
35356
|
+
if (name) {
|
|
35357
|
+
const streamObj = streams.find((obj) => obj.name === name);
|
|
35358
|
+
if (streamObj && 'stream' in streamObj) {
|
|
35359
|
+
return streamObj.stream || null;
|
|
35360
|
+
}
|
|
35361
|
+
}
|
|
35362
|
+
return null;
|
|
35363
|
+
}
|
|
35364
|
+
catch (error) {
|
|
35365
|
+
console.error('Error getting participant media:', error);
|
|
35366
|
+
return null;
|
|
35367
|
+
}
|
|
35368
|
+
};
|
|
35324
35369
|
// Initial values
|
|
35325
35370
|
mediaSFUFunctions = () => {
|
|
35326
35371
|
return {
|
|
@@ -35592,6 +35637,8 @@ class MediasfuGeneric {
|
|
|
35592
35637
|
(() => {
|
|
35593
35638
|
console.log('none');
|
|
35594
35639
|
}),
|
|
35640
|
+
getMediaDevicesList: this.getMediaDevicesList,
|
|
35641
|
+
getParticipantMedia: this.getParticipantMedia,
|
|
35595
35642
|
};
|
|
35596
35643
|
};
|
|
35597
35644
|
validated = new BehaviorSubject$1(false);
|
|
@@ -40823,6 +40870,51 @@ class MediasfuBroadcast {
|
|
|
40823
40870
|
});
|
|
40824
40871
|
return inj;
|
|
40825
40872
|
}
|
|
40873
|
+
/**
|
|
40874
|
+
* Gets a list of media devices filtered by the specified kind.
|
|
40875
|
+
* @param kind - The kind of media device to filter by ('videoinput' or 'audioinput')
|
|
40876
|
+
* @returns A promise that resolves to an array of MediaDeviceInfo objects
|
|
40877
|
+
*/
|
|
40878
|
+
getMediaDevicesList = async (kind) => {
|
|
40879
|
+
try {
|
|
40880
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
40881
|
+
return devices.filter((device) => device.kind === kind);
|
|
40882
|
+
}
|
|
40883
|
+
catch (error) {
|
|
40884
|
+
console.error('Error enumerating devices:', error);
|
|
40885
|
+
return [];
|
|
40886
|
+
}
|
|
40887
|
+
};
|
|
40888
|
+
/**
|
|
40889
|
+
* Gets the media stream for a participant by their ID or name.
|
|
40890
|
+
* @param options - Object containing id, name, and kind parameters
|
|
40891
|
+
* @returns A promise that resolves to the participant's MediaStream or null if not found
|
|
40892
|
+
*/
|
|
40893
|
+
getParticipantMedia = async (options) => {
|
|
40894
|
+
const { id, name, kind } = options;
|
|
40895
|
+
try {
|
|
40896
|
+
const streams = kind === 'video' ? this.allVideoStreams.value : this.allAudioStreams.value;
|
|
40897
|
+
// Search by producerId if provided
|
|
40898
|
+
if (id) {
|
|
40899
|
+
const streamObj = streams.find((obj) => obj.producerId === id);
|
|
40900
|
+
if (streamObj && 'stream' in streamObj) {
|
|
40901
|
+
return streamObj.stream || null;
|
|
40902
|
+
}
|
|
40903
|
+
}
|
|
40904
|
+
// Search by name if provided
|
|
40905
|
+
if (name) {
|
|
40906
|
+
const streamObj = streams.find((obj) => obj.name === name);
|
|
40907
|
+
if (streamObj && 'stream' in streamObj) {
|
|
40908
|
+
return streamObj.stream || null;
|
|
40909
|
+
}
|
|
40910
|
+
}
|
|
40911
|
+
return null;
|
|
40912
|
+
}
|
|
40913
|
+
catch (error) {
|
|
40914
|
+
console.error('Error getting participant media:', error);
|
|
40915
|
+
return null;
|
|
40916
|
+
}
|
|
40917
|
+
};
|
|
40826
40918
|
// Initial values
|
|
40827
40919
|
mediaSFUFunctions = () => {
|
|
40828
40920
|
return {
|
|
@@ -41082,6 +41174,8 @@ class MediasfuBroadcast {
|
|
|
41082
41174
|
(() => {
|
|
41083
41175
|
console.log('none');
|
|
41084
41176
|
}),
|
|
41177
|
+
getMediaDevicesList: this.getMediaDevicesList,
|
|
41178
|
+
getParticipantMedia: this.getParticipantMedia,
|
|
41085
41179
|
};
|
|
41086
41180
|
};
|
|
41087
41181
|
validated = new BehaviorSubject$1(false);
|
|
@@ -45267,6 +45361,51 @@ class MediasfuWebinar {
|
|
|
45267
45361
|
});
|
|
45268
45362
|
return inj;
|
|
45269
45363
|
}
|
|
45364
|
+
/**
|
|
45365
|
+
* Gets a list of media devices filtered by the specified kind.
|
|
45366
|
+
* @param kind - The kind of media device to filter by ('videoinput' or 'audioinput')
|
|
45367
|
+
* @returns A promise that resolves to an array of MediaDeviceInfo objects
|
|
45368
|
+
*/
|
|
45369
|
+
getMediaDevicesList = async (kind) => {
|
|
45370
|
+
try {
|
|
45371
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
45372
|
+
return devices.filter((device) => device.kind === kind);
|
|
45373
|
+
}
|
|
45374
|
+
catch (error) {
|
|
45375
|
+
console.error('Error enumerating devices:', error);
|
|
45376
|
+
return [];
|
|
45377
|
+
}
|
|
45378
|
+
};
|
|
45379
|
+
/**
|
|
45380
|
+
* Gets the media stream for a participant by their ID or name.
|
|
45381
|
+
* @param options - Object containing id, name, and kind parameters
|
|
45382
|
+
* @returns A promise that resolves to the participant's MediaStream or null if not found
|
|
45383
|
+
*/
|
|
45384
|
+
getParticipantMedia = async (options) => {
|
|
45385
|
+
const { id, name, kind } = options;
|
|
45386
|
+
try {
|
|
45387
|
+
const streams = kind === 'video' ? this.allVideoStreams.value : this.allAudioStreams.value;
|
|
45388
|
+
// Search by producerId if provided
|
|
45389
|
+
if (id) {
|
|
45390
|
+
const streamObj = streams.find((obj) => obj.producerId === id);
|
|
45391
|
+
if (streamObj && 'stream' in streamObj) {
|
|
45392
|
+
return streamObj.stream || null;
|
|
45393
|
+
}
|
|
45394
|
+
}
|
|
45395
|
+
// Search by name if provided
|
|
45396
|
+
if (name) {
|
|
45397
|
+
const streamObj = streams.find((obj) => obj.name === name);
|
|
45398
|
+
if (streamObj && 'stream' in streamObj) {
|
|
45399
|
+
return streamObj.stream || null;
|
|
45400
|
+
}
|
|
45401
|
+
}
|
|
45402
|
+
return null;
|
|
45403
|
+
}
|
|
45404
|
+
catch (error) {
|
|
45405
|
+
console.error('Error getting participant media:', error);
|
|
45406
|
+
return null;
|
|
45407
|
+
}
|
|
45408
|
+
};
|
|
45270
45409
|
// Initial values
|
|
45271
45410
|
mediaSFUFunctions = () => {
|
|
45272
45411
|
return {
|
|
@@ -45534,6 +45673,8 @@ class MediasfuWebinar {
|
|
|
45534
45673
|
(() => {
|
|
45535
45674
|
console.log('none');
|
|
45536
45675
|
}),
|
|
45676
|
+
getMediaDevicesList: this.getMediaDevicesList,
|
|
45677
|
+
getParticipantMedia: this.getParticipantMedia,
|
|
45537
45678
|
};
|
|
45538
45679
|
};
|
|
45539
45680
|
validated = new BehaviorSubject$1(false);
|
|
@@ -50494,6 +50635,51 @@ class MediasfuConference {
|
|
|
50494
50635
|
});
|
|
50495
50636
|
return inj;
|
|
50496
50637
|
}
|
|
50638
|
+
/**
|
|
50639
|
+
* Gets a list of media devices filtered by the specified kind.
|
|
50640
|
+
* @param kind - The kind of media device to filter by ('videoinput' or 'audioinput')
|
|
50641
|
+
* @returns A promise that resolves to an array of MediaDeviceInfo objects
|
|
50642
|
+
*/
|
|
50643
|
+
getMediaDevicesList = async (kind) => {
|
|
50644
|
+
try {
|
|
50645
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
50646
|
+
return devices.filter((device) => device.kind === kind);
|
|
50647
|
+
}
|
|
50648
|
+
catch (error) {
|
|
50649
|
+
console.error('Error enumerating devices:', error);
|
|
50650
|
+
return [];
|
|
50651
|
+
}
|
|
50652
|
+
};
|
|
50653
|
+
/**
|
|
50654
|
+
* Gets the media stream for a participant by their ID or name.
|
|
50655
|
+
* @param options - Object containing id, name, and kind parameters
|
|
50656
|
+
* @returns A promise that resolves to the participant's MediaStream or null if not found
|
|
50657
|
+
*/
|
|
50658
|
+
getParticipantMedia = async (options) => {
|
|
50659
|
+
const { id, name, kind } = options;
|
|
50660
|
+
try {
|
|
50661
|
+
const streams = kind === 'video' ? this.allVideoStreams.value : this.allAudioStreams.value;
|
|
50662
|
+
// Search by producerId if provided
|
|
50663
|
+
if (id) {
|
|
50664
|
+
const streamObj = streams.find((obj) => obj.producerId === id);
|
|
50665
|
+
if (streamObj && 'stream' in streamObj) {
|
|
50666
|
+
return streamObj.stream || null;
|
|
50667
|
+
}
|
|
50668
|
+
}
|
|
50669
|
+
// Search by name if provided
|
|
50670
|
+
if (name) {
|
|
50671
|
+
const streamObj = streams.find((obj) => obj.name === name);
|
|
50672
|
+
if (streamObj && 'stream' in streamObj) {
|
|
50673
|
+
return streamObj.stream || null;
|
|
50674
|
+
}
|
|
50675
|
+
}
|
|
50676
|
+
return null;
|
|
50677
|
+
}
|
|
50678
|
+
catch (error) {
|
|
50679
|
+
console.error('Error getting participant media:', error);
|
|
50680
|
+
return null;
|
|
50681
|
+
}
|
|
50682
|
+
};
|
|
50497
50683
|
// Initial values
|
|
50498
50684
|
mediaSFUFunctions = () => {
|
|
50499
50685
|
return {
|
|
@@ -50761,6 +50947,8 @@ class MediasfuConference {
|
|
|
50761
50947
|
(() => {
|
|
50762
50948
|
console.log('none');
|
|
50763
50949
|
}),
|
|
50950
|
+
getMediaDevicesList: this.getMediaDevicesList,
|
|
50951
|
+
getParticipantMedia: this.getParticipantMedia,
|
|
50764
50952
|
};
|
|
50765
50953
|
};
|
|
50766
50954
|
validated = new BehaviorSubject$1(false);
|
|
@@ -55649,6 +55837,51 @@ class MediasfuChat {
|
|
|
55649
55837
|
});
|
|
55650
55838
|
return inj;
|
|
55651
55839
|
}
|
|
55840
|
+
/**
|
|
55841
|
+
* Gets a list of media devices filtered by the specified kind.
|
|
55842
|
+
* @param kind - The kind of media device to filter by ('videoinput' or 'audioinput')
|
|
55843
|
+
* @returns A promise that resolves to an array of MediaDeviceInfo objects
|
|
55844
|
+
*/
|
|
55845
|
+
getMediaDevicesList = async (kind) => {
|
|
55846
|
+
try {
|
|
55847
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
55848
|
+
return devices.filter((device) => device.kind === kind);
|
|
55849
|
+
}
|
|
55850
|
+
catch (error) {
|
|
55851
|
+
console.error('Error enumerating devices:', error);
|
|
55852
|
+
return [];
|
|
55853
|
+
}
|
|
55854
|
+
};
|
|
55855
|
+
/**
|
|
55856
|
+
* Gets the media stream for a participant by their ID or name.
|
|
55857
|
+
* @param options - Object containing id, name, and kind parameters
|
|
55858
|
+
* @returns A promise that resolves to the participant's MediaStream or null if not found
|
|
55859
|
+
*/
|
|
55860
|
+
getParticipantMedia = async (options) => {
|
|
55861
|
+
const { id, name, kind } = options;
|
|
55862
|
+
try {
|
|
55863
|
+
const streams = kind === 'video' ? this.allVideoStreams.value : this.allAudioStreams.value;
|
|
55864
|
+
// Search by producerId if provided
|
|
55865
|
+
if (id) {
|
|
55866
|
+
const streamObj = streams.find((obj) => obj.producerId === id);
|
|
55867
|
+
if (streamObj && 'stream' in streamObj) {
|
|
55868
|
+
return streamObj.stream || null;
|
|
55869
|
+
}
|
|
55870
|
+
}
|
|
55871
|
+
// Search by name if provided
|
|
55872
|
+
if (name) {
|
|
55873
|
+
const streamObj = streams.find((obj) => obj.name === name);
|
|
55874
|
+
if (streamObj && 'stream' in streamObj) {
|
|
55875
|
+
return streamObj.stream || null;
|
|
55876
|
+
}
|
|
55877
|
+
}
|
|
55878
|
+
return null;
|
|
55879
|
+
}
|
|
55880
|
+
catch (error) {
|
|
55881
|
+
console.error('Error getting participant media:', error);
|
|
55882
|
+
return null;
|
|
55883
|
+
}
|
|
55884
|
+
};
|
|
55652
55885
|
// Initial values
|
|
55653
55886
|
mediaSFUFunctions = () => {
|
|
55654
55887
|
return {
|
|
@@ -55908,6 +56141,8 @@ class MediasfuChat {
|
|
|
55908
56141
|
(() => {
|
|
55909
56142
|
console.log('none');
|
|
55910
56143
|
}),
|
|
56144
|
+
getMediaDevicesList: this.getMediaDevicesList,
|
|
56145
|
+
getParticipantMedia: this.getParticipantMedia,
|
|
55911
56146
|
};
|
|
55912
56147
|
};
|
|
55913
56148
|
validated = new BehaviorSubject$1(false);
|