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);
};
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.