So, once the participant stops sharing using the "stop sharing" button on chrome, it should remove the video-tag (or at least make it black) from the other subscribers screen with the following code:
$('#shareScreen').click(async function(){
const stream = await navigator.mediaDevices.getDisplayMedia();
let screenTrack = new Twilio.Video.LocalVideoTrack(stream.getTracks()[0]);
room.localParticipant.publishTrack(screenTrack);
screenTrack.once('stopped', () => {
room.localParticipant.unpublishTrack(screenTrack);
screenTrack.stop();
screenTrack = null;
});
});
But I still see a still screen.
The window is still being displayed and the video tag has not been removed from the other participants screen
How do I fix this and remove the screen sharing video after the participant has stopped sharing his/her screen?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…