RTCRtpScriptTransform-sender-worker-single-frame.js (594B)
1 onrtctransform = async (event) => { 2 const readableStream = event.transformer.readable; 3 const reader = readableStream.getReader(); 4 const result = await reader.read(); 5 // Post an object with individual fields so that the test side has 6 // values to verify the serialization of the RTCEncodedVideoFrame. 7 postMessage({ 8 type: result.value.type, 9 data: result.value.data, 10 metadata: result.value.getMetadata(), 11 }); 12 // Send the frame twice to verify that the frame does not change after the 13 // first serialization. 14 postMessage(result.value); 15 postMessage(result.value); 16 }