v1.7.0/video styling and stream management

This commit is contained in:
2020-09-05 16:32:27 -04:00
parent 16ce29e93c
commit e99568a791
2 changed files with 33 additions and 25 deletions
+2 -14
View File
@@ -207,26 +207,14 @@ export default class CallManager {
VoxeetSDK.conference.on('streamAdded', (participant, stream) => { VoxeetSDK.conference.on('streamAdded', (participant, stream) => {
this.listener({ callActionPending: true }); this.listener({ callActionPending: true });
if (this.__useVideo === true) { const vid = 'video#' + participant.id;
const vid = 'video#' + LocalData().userUid;
if (!document.querySelector(vid)) { if (!document.querySelector(vid)) {
const vidNode = document.createElement('video'); const vidNode = document.createElement('video');
vidNode.id = LocalData().userUid; vidNode.id = participant.id;
vidNode.classList.add('vxt-video'); vidNode.classList.add('vxt-video');
document.querySelector('.vxt-video-container').appendChild(vidNode); document.querySelector('.vxt-video-container').appendChild(vidNode);
navigator
.getUserMedia({
video: true,
audio: false,
})
.then((stream) => {
vidNode.srcObject = stream; vidNode.srcObject = stream;
vidNode.onloadedmetadata = vidNode.play; vidNode.onloadedmetadata = vidNode.play;
})
.catch((err) => {
//ignore
});
}
} }
this.listener({ callActionPending: false }); this.listener({ callActionPending: false });
}); });
+25 -5
View File
@@ -967,12 +967,32 @@ button.giphy-list-item {
} }
.vxt-video-container { .vxt-video-container {
display: flex; display: block;
justify-content: space-evenly; overflow-x: hidden;
overflow-y: auto;
padding: 0 15px;
max-height: 50%;
max-width: 100% !important;
}
.vxt-video-container::-webkit-scrollbar-thumb {
background-color: #beff94 !important;
border-radius: 13px;
}
.vxt-video-container::-webkit-scrollbar {
width: 5px;
} }
.vxt-video { .vxt-video {
max-width: calc(50% - 20px) !important; max-width: calc(50% - 10px) !important;
min-height: calc(0.66 * calc(0.5 * var(--party-width))) !important;
max-height: 200px !important;
height: 200px;
border-radius: 10px; border-radius: 10px;
margin: 10px 15px; margin: 0 5px;
display: inline-flex; margin-top: 5px;
display: inline-flex !important;
background-color: black;
}
.vxt-video:first-of-type {
margin-top: 15px;
} }