mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 05:49:22 +00:00
Apply user name as title on video streams
This commit is contained in:
parent
c4e81d1ded
commit
4095ae5653
@ -482,7 +482,7 @@ class CallWindow extends CustomEvents {
|
|||||||
* @param {boolean} muted True to mute video
|
* @param {boolean} muted True to mute video
|
||||||
* @param {MediaStream} stream Target stream
|
* @param {MediaStream} stream Target stream
|
||||||
*/
|
*/
|
||||||
applyStream(peerID, muted, stream) {
|
async applyStream(peerID, muted, stream) {
|
||||||
|
|
||||||
// Remove any previous video stream
|
// Remove any previous video stream
|
||||||
if(this.videoEls.has(peerID)) {
|
if(this.videoEls.has(peerID)) {
|
||||||
@ -497,6 +497,7 @@ class CallWindow extends CustomEvents {
|
|||||||
class: isVideo ? "video" : undefined
|
class: isVideo ? "video" : undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Apply video
|
||||||
const videoEl = document.createElement(isVideo ? "video" : "audio");
|
const videoEl = document.createElement(isVideo ? "video" : "audio");
|
||||||
videoContainer.appendChild(videoEl)
|
videoContainer.appendChild(videoEl)
|
||||||
|
|
||||||
@ -507,6 +508,12 @@ class CallWindow extends CustomEvents {
|
|||||||
|
|
||||||
this.videoEls.set(peerID, videoEl)
|
this.videoEls.set(peerID, videoEl)
|
||||||
|
|
||||||
|
|
||||||
|
// Show user name
|
||||||
|
if(isVideo) {
|
||||||
|
const userName = (await user(peerID)).fullName
|
||||||
|
videoEl.title = userName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -552,7 +559,7 @@ class CallWindow extends CustomEvents {
|
|||||||
return
|
return
|
||||||
|
|
||||||
// Show user video
|
// Show user video
|
||||||
this.applyStream(userID(), true, stream)
|
await this.applyStream(userID(), true, stream)
|
||||||
|
|
||||||
this.mainPeer = new SimplePeer({
|
this.mainPeer = new SimplePeer({
|
||||||
initiator: true,
|
initiator: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user