// libwebrtc ignores a PLI if a previous PLI was received less than 1-2 seconds before,
// other than that the delay can reduce the maximum number of keyframes that have to be generated and thus help sender bitrate, at the cost of clients having to wait and not receive video for the time of the delay.
keyFrameRequestDelay:3000,
appData:{
source:'webcam'
}
})
// Workaround the firefox screenshare issue.
// With this we effectively limit ourselves to 640 width
awaitcamProducer.setMaxSpatialLayer(1)
camProducer.on('transportclose',()=>{
camProducer=null
})
camProducer.on('trackended',()=>{
this.setCamera('',true)
})
// Create/Update the video element
addPeerTrack(peers.self,track)
if(!noUpdate){
trigger('updatePeer',peers.self,['videoSource'])
}
}
/**
* Set the microphone device for the current user
*/
this.setMic=async(deviceId,noUpdate)=>{
if(!(peers.self.role&Roles.PUBLISHER)){
// We're checking the role here because thanks to "subscribers only" feature
// the peer might have been "downgraded" automatically to a subscriber