mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Simplified streams pipe
parent
7348ce6535
commit
f20a2a8001
|
@ -1,5 +1,5 @@
|
||||||
import { Pipe, PipeTransform } from '@angular/core';
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
import { StreamModel, ParticipantAbstractModel } from '../models/participant.model';
|
import { ParticipantAbstractModel, StreamModel } from '../models/participant.model';
|
||||||
import { TranslateService } from '../services/translate/translate.service';
|
import { TranslateService } from '../services/translate/translate.service';
|
||||||
|
|
||||||
@Pipe({ name: 'streams' })
|
@Pipe({ name: 'streams' })
|
||||||
|
@ -10,11 +10,8 @@ export class ParticipantStreamsPipe implements PipeTransform {
|
||||||
let streams: StreamModel[] = [];
|
let streams: StreamModel[] = [];
|
||||||
if(participants && Object.keys(participants).length > 0){
|
if(participants && Object.keys(participants).length > 0){
|
||||||
if (Array.isArray(participants)) {
|
if (Array.isArray(participants)) {
|
||||||
participants.forEach((p) => {
|
streams = participants.map(p => p.getAvailableConnections()).flat();
|
||||||
streams = streams.concat(p.getAvailableConnections());
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
streams = participants.getAvailableConnections();
|
streams = participants.getAvailableConnections();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue