Skip to content

Commit

Permalink
Correct typo in sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
chun137 committed Sep 25, 2024
1 parent e9d88a9 commit 8715d8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ This proposal does not aim for improving the accuracy of end-to-end delay measur

#### [API 1]: captureTimestamp

This specification adds captureTimestamp, type of DOMHighResTimeStamp, to the RTCRtpContributingSource dictionary. This surfaces the absolute capture timestamp in the absolute capture time RTP header extension, when it is present or can be extrapolated from previously received data, for the last rendered audio or video frame. It can be used for measuring audio video synchronization performance as illustrated in the following example code:
This specification adds captureTimestamp, type of DOMHighResTimestamp, to the RTCRtpContributingSource dictionary. This surfaces the absolute capture timestamp in the absolute capture time RTP header extension, when it is present or can be extrapolated from previously received data, for the last rendered audio or video frame. It can be used for measuring audio video synchronization performance as illustrated in the following example code:

[receiverAudio, receiverVideo] = peerconnection.getReceivers();

latestCaptureTimestampAudio = receiverAudio.getSynchronizationSources()[0].captureTimeStamp;
latestCaptureTimestampVideo = receiverVideo.getSynchronizationSources()[0].captureTimeStamp;
latestCaptureTimestampAudio = receiverAudio.getSynchronizationSources()[0].captureTimestamp;
latestCaptureTimestampVideo = receiverVideo.getSynchronizationSources()[0].captureTimestamp;

synchronizationError = latestCaptureTimestampAudio - latestCaptureTimestampVideo;

Expand All @@ -63,8 +63,8 @@ An example code to use captureTimestamp and senderCaptureTimeOffset to calculate

receiver = peerconnection.getReceivers()[0];
csrc = receiver.getSynchronizationSources()[0];
latestCaptureTimestamp = csrc.captureTimeStamp;
latestSenderCaptureTimeOffset = csrc.SenderCaptureTimeOffset;
latestCaptureTimestamp = csrc.captureTimestamp;
latestSenderCaptureTimeOffset = csrc.senderCaptureTimeOffset;
receiverTimestamp = csrc.timestamp;

// Calculates sender-receiver clock offset from stats.
Expand Down

0 comments on commit 8715d8e

Please sign in to comment.