Skip to content

Commit e3b622f

Browse files
committed
updated jsdoc for handleReceiveCall
1 parent 3c4a9d0 commit e3b622f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

dist/src/components/VideoCall.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,16 +364,26 @@ const VideoCall = ({ URL, mediaOptions }) => {
364364
remoteVideo.current.srcObject = e.streams[0];
365365
}
366366
/**
367-
* @function shareScreen - Enables screen sharing using MediaSession.getDisplayMedia()
367+
* @function shareScreen
368+
* @desc Enables screen sharing using MediaSession.getDisplayMedia()
369+
*
370+
* @method getDisplayMedia - getDisplayMedia() method of the MediaStream interface prompts the user to select and grant permission to capture the contents or portion (such as a window) of their screen as a MediaStream.
371+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia
372+
*
373+
* @method getTracks - getTracks() method of the MediaStream interface returns an array of all the MediaStreamTrack objects
374+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/getTracks
375+
*
376+
* @method replaceTrack - The RTCRtpSender method replaceTrack() replaces the track currently being used as the sender's source with a new MediaStreamTrack.
377+
*
368378
*/
369379
function shareScreen() {
370380
//TODOS: On a new connection the local and streamed screen bugs producing: Rtconnect.jsx:273 Uncaught (in promise) DOMException: The peer connection is closed.
371381
navigator.mediaDevices.getDisplayMedia()
372382
.then(stream => {
373383
var _a, _b;
374-
const screenTrack = stream.getTracks()[0];
384+
const screenTrack = stream.getTracks()[0]; //
375385
(_b = (_a = senders.current) === null || _a === void 0 ? void 0 : _a.find(sender => { var _a; return ((_a = sender.track) === null || _a === void 0 ? void 0 : _a.kind) === 'video'; })) === null || _b === void 0 ? void 0 : _b.replaceTrack(screenTrack);
376-
localVideo.current.srcObject = stream; // changing local video to reflect what we're sharing to the other end of the connection
386+
localVideo.current.srcObject = stream; // changing local video to display is being screen shared to the other peer
377387
screenTrack.onended = function () {
378388
var _a, _b;
379389
(_b = (_a = senders.current) === null || _a === void 0 ? void 0 : _a.find(sender => { var _a; return ((_a = sender.track) === null || _a === void 0 ? void 0 : _a.kind) === 'video'; })) === null || _b === void 0 ? void 0 : _b.replaceTrack(localStream.current.getTracks()[1]);

0 commit comments

Comments
 (0)