Web visio, add and remove video element

This commit is contained in:
gparant 2020-04-26 19:12:01 +02:00
parent e178712457
commit d7d7be9ed0
4 changed files with 56 additions and 37 deletions

View file

@ -116,10 +116,22 @@ export class MediaManager {
*
* @param userId
*/
addActiveVideo(userId : any){
addActiveVideo(userId : string){
let elementRemoteVideo = document.getElementById("activeCam");
elementRemoteVideo.insertAdjacentHTML('beforeend', '<video id="'+userId+'" autoplay></video>');
this.remoteVideo[userId] = document.getElementById(userId);
this.remoteVideo[(userId as any)] = document.getElementById(userId);
}
/**
*
* @param userId
*/
removeActiveVideo(userId : string){
let element = document.getElementById(userId);
if(!element){
return;
}
element.remove();
}
}