'WEBRTC screen capture API for mobile browsers

I have developed a video chat application using WEBRTC (peer.js). I have integrated screen share & screen recording feature using Screen capture API. It's working well with web browsers. I just found in MDN Web Doc that Screen Capture API don't support any of the mobile browsers. Is there is any other alternative to achieve this is mobile browsers ? Please help me out.

Code

const shareScreen = async () => {
  let captureStream = null;

  try {
    captureStream = await navigator.mediaDevices.getDisplayMedia({
      video: true,
      audio: true
    });
  } catch (err) {
    console.error("Error: " + err);
  }
  captureStream.getVideoTracks()[0].onended = function () {
    navigator.mediaDevices
      .getUserMedia({
        video: true,
        audio: true,
      })
      .then((stream) => {
        // connectToNewUser(uId, stream);
      })
  };
  peer.call(uId, captureStream);
}; 


Solution 1:[1]

None of the current mobile browsers support screen capture; thus, none of the browser-based videoconferencing solutions implement screen sharing. The only solution I am aware of is to use a native app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jch