Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen share code #44

Open
saini3911 opened this issue Dec 12, 2021 · 0 comments
Open

Screen share code #44

saini3911 opened this issue Dec 12, 2021 · 0 comments

Comments

@saini3911
Copy link

saini3911 commented Dec 12, 2021

i am trying to add screen share in present code .. but it shows on my screen clearly but unable to see on other user screen
code :-

       navigator.mediaDevices.getDisplayMedia({
           video: true, 
           audio:true
       }).then(stream => {
           const video1 = document.createElement('video');
           video1.controls = true;
           addVideoStream(video1,stream)

           
       socket.on('user-connected', userId =>{
           const call = peer.call(userId, stream)
           stream.getVideoTracks()[0].addEventListener('ended', () => {
               video1.remove()
             });
           call.on('close', () => {

           })  
       })
           stream.getVideoTracks()[0].addEventListener('ended', () => {
             video1.remove()
           });
         });
       }catch(err) {
           console.log("Error: " + err);
       }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant