@@ -74,14 +74,14 @@ of an encoded frame and adds 4 bytes of padding.
74
74
let view = new DataView(chunk.data);
75
75
// Create a new buffer with 4 additional bytes.
76
76
let newData = new ArrayBuffer(chunk.data.byteLength + 4);
77
- Let newView = new DataView(newData);
77
+ let newView = new DataView(newData);
78
78
79
79
// Fill the new buffer with a negated version of all
80
80
// the bits in the original frame.
81
81
for (let i = 0; i < chunk.data.byteLength; ++i)
82
82
newView.setInt8(i, ~view.getInt8(i));
83
83
// Set the padding bytes to zero.
84
- For (let i = 0; i < 4; ++i)
84
+ for (let i = 0; i < 4; ++i)
85
85
newView.setInt8(chunk.data.byteLength + i, 0);
86
86
87
87
// Replace the frame's data with the new buffer.
@@ -111,7 +111,6 @@ let senderStreams = videoSender.getEncodedVideoStreams();
111
111
senderStreams.readable
112
112
.pipeThrough(senderTransform)
113
113
.pipeTo(senderStreams.writable);
114
- }
115
114
</pre >
116
115
117
116
4 . Do the corresponding operations on the receiver side.
@@ -149,11 +148,10 @@ pc.ontrack = e => {
149
148
},
150
149
});
151
150
152
- let receiver_streams = video_receiver.createEncodedVideoStreams();
153
- receiver_streams.readable
154
- .pipeThrough(my_transform)
155
- .pipeTo(receiver_streams.writable);
156
- }
151
+ let receiverStreams = videoReceiver.createEncodedVideoStreams();
152
+ receiverStreams.readable
153
+ .pipeThrough(receiverTransform)
154
+ .pipeTo(receiverStreams.writable);
157
155
}
158
156
</pre >
159
157
0 commit comments