function removePeer(socket_id) {

    let videoEl = document.getElementById(socket_id)
    if (videoEl) {

        const tracks = videoEl.srcObject.getTracks();

        tracks.forEach(function (track) {
            track.stop()
        })

        videoEl.srcObject = null
        videoEl.parentNode.removeChild(videoEl)
    }
    if (peers[socket_id]) peers[socket_id].destroy()
    delete peers[socket_id]
}
/**
 * Remove a peer with given socket_id. 
 * Removes the video element and deletes the connection
 * @param {String} socket_id 
 */
Remove a peer with given socket_id.
Removes the video element and deletes the connection
@param {String} socket_id
Remove a peer with given socket_id . Removes the video element and deletes the connection @param { String } socket_id
function removePeer(socket_id) {
    let videoEl = document.getElementById(socket_id)
    if (videoEl) {
        const tracks = videoEl.srcObject.getTracks();
        tracks.forEach(function (track) {
            track.stop()
        })
        videoEl.srcObject = null
        videoEl.parentNode.removeChild(videoEl)
    }
    if (peers[socket_id]) peers[socket_id].destroy()
    delete peers[socket_id]
}
function removePeer ( socket_id ) { let videoEl = document . getElementById ( socket_id ) if ( videoEl ) { const tracks = videoEl . srcObject . getTracks ( ) ; tracks . forEach ( function ( track ) { track . stop ( ) } ) videoEl . srcObject = null videoEl . parentNode . removeChild ( videoEl ) } if ( peers [ socket_id ] ) peers [ socket_id ] . destroy ( ) delete peers [ socket_id ] }
Remove a peer with given socket_id.
Remove a peer with given socket_id .