From d03b9ad6314b59b33e0ccad6adb38022821ea194 Mon Sep 17 00:00:00 2001 From: Kimberlee Johnson Date: Wed, 1 Dec 2021 12:25:22 -0800 Subject: [PATCH] Added comments to clarify output-byte-stream --- custom/recording/contexts/RecordingProvider.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom/recording/contexts/RecordingProvider.js b/custom/recording/contexts/RecordingProvider.js index d7ad1f5..c63d0b8 100644 --- a/custom/recording/contexts/RecordingProvider.js +++ b/custom/recording/contexts/RecordingProvider.js @@ -93,6 +93,7 @@ export const RecordingProvider = ({ children }) => { }; // The 'recording-data' event is emitted when an output-byte-stream recording has started + // When the event emits, start writing data to the stream created in handleRecordingStarted() const handleRecordingData = async (ev) => { try { console.log('got data', ev); @@ -178,6 +179,7 @@ export const RecordingProvider = ({ children }) => { // Recording started locally, either through UI or programmatically setIsRecordingLocally(true); if (!recordingStartedDate) setRecordingStartedDate(new Date()); + // If an output-byte-stream recording has started, create a new data stream that can be piped to a third-party (in this case a file) if (event.type === 'output-byte-stream') { const { readable, writable } = new TransformStream({ transform: (chunk, ctrl) => {