On 2/16/18 2:04 PM, Alexander Abagian wrote:
I want to make Firefox stream both screen sharing and common webcam video
simultaneously. Is it possible at all ? Chrome lets do it with an external
screen sharing plugin, but here both of the should be produced by getUserMedia
and I haven't find a way how to make it. mediaDevices.enumerateDevices() does
never enumerate screen sharing. Constraints could contain a single video member
for both cam video or the sharing, but I need them both in the moment.
You should be able to grab both video streams and add them both to the
peer connection. Something like:
(async () => {
let pc = new RTCPeerConnection();
let camera = await navigator.mediaDevices.getUserMedia({video: true});
let screen = await navigator.mediaDevices.getUserMedia({video:
{mediaSource: "screen"}});
pc.addTrack(camera.getTracks()[0]);
pc.addTrack(screen.getTracks()[0]);
//...
})();
/a
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media