title: How to share screen using webRTC
body: <p>I need to get the screen sharing working. It is working if it is video sharing. This is the code:</p>
  <pre><code>public n = navigator as any;
  
  ngAfterViewInit(): void {
   const video = this.myVideo.nativeElement;
   let peerx: any;
   this.n.getUserMedia =
    this.n.getUserMedia ||
    this.n.webkitGetUserMedia ||
    this.n.mozGetUserMedia ||
    this.n.msGetUserMedia;
  }
  
   this.n.getUserMedia( // this.n.mediaDevices.getDisplayMedia
    {
      video: {
        madatory: {
          chromeMediaSource: 'screen',
          maxWidth: 1920,
          maxHeight: 1080,
          minAspectRatio: 1.77
        },
      }
     },
    (stream: any) =&gt; {
      peerx = new SimplePeer({
        initiator: location.hash === '#init',
        trickle: false,
        stream,
      });
      
  peerx.on('signal', (data) =&gt; {
        const strData = JSON.stringify(data);
        console.log(strData);
  
        this.targetpeer = data;
      });
      
  peerx.on('stream', (streamX: any) =&gt; {
        if ('srcObject' in video) {
          video.srcObject = streamX;
        } else {
          video.src = window.URL.createObjectURL(streamX);
        }
        const playPromise = video.play();
  
        if (playPromise !== undefined) {
          playPromise
            .then((_) =&gt; {
              video.play();
            })
            .catch((error) =&gt; {
              console.log(`Playing was prevented: ${error}`);
            });
        }
      });
  </code></pre>
  <p>If I change the line 'this.n.getUserMedia(....)' to this 'this.n.mediaDevices.getDisplayMedia(...)', I do not get the 'signal' (the key that I need to paste on the client to connect).</p>