v1.7.0/video styling and stream management
This commit is contained in:
+8
-20
@@ -207,26 +207,14 @@ export default class CallManager {
|
||||
|
||||
VoxeetSDK.conference.on('streamAdded', (participant, stream) => {
|
||||
this.listener({ callActionPending: true });
|
||||
if (this.__useVideo === true) {
|
||||
const vid = 'video#' + LocalData().userUid;
|
||||
if (!document.querySelector(vid)) {
|
||||
const vidNode = document.createElement('video');
|
||||
vidNode.id = LocalData().userUid;
|
||||
vidNode.classList.add('vxt-video');
|
||||
document.querySelector('.vxt-video-container').appendChild(vidNode);
|
||||
navigator
|
||||
.getUserMedia({
|
||||
video: true,
|
||||
audio: false,
|
||||
})
|
||||
.then((stream) => {
|
||||
vidNode.srcObject = stream;
|
||||
vidNode.onloadedmetadata = vidNode.play;
|
||||
})
|
||||
.catch((err) => {
|
||||
//ignore
|
||||
});
|
||||
}
|
||||
const vid = 'video#' + participant.id;
|
||||
if (!document.querySelector(vid)) {
|
||||
const vidNode = document.createElement('video');
|
||||
vidNode.id = participant.id;
|
||||
vidNode.classList.add('vxt-video');
|
||||
document.querySelector('.vxt-video-container').appendChild(vidNode);
|
||||
vidNode.srcObject = stream;
|
||||
vidNode.onloadedmetadata = vidNode.play;
|
||||
}
|
||||
this.listener({ callActionPending: false });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user