Skip to content

Commit ba84fb3

Browse files
authored
Merge pull request #48 from oslabs-beta/doc
updated jsdoc for handleReceiveCall
2 parents fd79fb8 + 6ef53db commit ba84fb3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/src/components/VideoCall.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ const VideoCall = ({ URL, mediaOptions }: { URL: string, mediaOptions: { control
391391
* @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.
392392
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia
393393
*
394-
* @method getTracks - getTracks() method of the MediaStream interface returns an array of all the MediaStreamTrack objects
394+
* @method getTracks - getTracks() method of the MediaStream interface returns an array of all the MediaStreamTrack objects in the stream
395395
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/getTracks
396396
*
397397
* @method replaceTrack - The RTCRtpSender method replaceTrack() replaces the track currently being used as the sender's source with a new MediaStreamTrack.
@@ -402,17 +402,17 @@ const VideoCall = ({ URL, mediaOptions }: { URL: string, mediaOptions: { control
402402
navigator.mediaDevices.getDisplayMedia()
403403
.then(stream => {
404404

405-
const screenTrack = stream.getTracks()[0]; //
405+
const screenTrack = stream.getTracks()[0]; // local video stream
406406

407407
senders.current
408408
?.find(sender => sender.track?.kind === 'video')
409409
?.replaceTrack(screenTrack);
410-
localVideo.current.srcObject = stream; // changing local video to display is being screen shared to the other peer
410+
localVideo.current.srcObject = stream; // changing local video to display what is being screen shared to the other peer
411411

412-
screenTrack.onended = function() {
412+
screenTrack.onended = function() { // ended event is fired when playback or streaming has stopped because the end of the media was reached or because no further data is available
413413
senders.current
414414
?.find(sender => sender.track?.kind === 'video')
415-
?.replaceTrack(localStream.current.getTracks()[1]);
415+
?.replaceTrack(localStream.current.getTracks()[1]); //
416416
localVideo.current.srcObject = localStream.current; // changing local video displayed back to webcam
417417
};
418418
});

0 commit comments

Comments
 (0)