|
@@ -326,27 +326,20 @@ export default class E2EEcontext {
|
326
|
326
|
return controller.enqueue(encodedFrame);
|
327
|
327
|
}, e => {
|
328
|
328
|
logger.error(e, encodedFrame.type);
|
|
329
|
+
|
|
330
|
+ // TODO: notify the application about error status.
|
|
331
|
+
|
|
332
|
+ // TODO: For video we need a better strategy since we do not want to based any
|
|
333
|
+ // non-error frames on a garbage keyframe.
|
329
|
334
|
if (encodedFrame.type === undefined) { // audio, replace with silence.
|
|
335
|
+ // audio, replace with silence.
|
330
|
336
|
const newData = new ArrayBuffer(3);
|
331
|
337
|
const newUint8 = new Uint8Array(newData);
|
332
|
338
|
|
333
|
339
|
newUint8.set([ 0xd8, 0xff, 0xfe ]); // opus silence frame.
|
334
|
340
|
encodedFrame.data = newData;
|
335
|
|
- } else { // video, replace with a 320x180px black frame
|
336
|
|
- const newData = new ArrayBuffer(60);
|
337
|
|
- const newUint8 = new Uint8Array(newData);
|
338
|
|
-
|
339
|
|
- newUint8.set([
|
340
|
|
- 0xb0, 0x05, 0x00, 0x9d, 0x01, 0x2a, 0xa0, 0x00, 0x5a, 0x00, 0x39, 0x03, 0x00, 0x00, 0x1c, 0x22,
|
341
|
|
- 0x16, 0x16, 0x22, 0x66, 0x12, 0x20, 0x04, 0x90, 0x40, 0x00, 0xc5, 0x01, 0xe0, 0x7c, 0x4d, 0x2f,
|
342
|
|
- 0xfa, 0xdd, 0x4d, 0xa5, 0x7f, 0x89, 0xa5, 0xff, 0x5b, 0xa9, 0xb4, 0xaf, 0xf1, 0x34, 0xbf, 0xeb,
|
343
|
|
- 0x75, 0x36, 0x95, 0xfe, 0x26, 0x96, 0x60, 0xfe, 0xff, 0xba, 0xff, 0x40
|
344
|
|
- ]);
|
345
|
|
- encodedFrame.data = newData;
|
|
341
|
+ controller.enqueue(encodedFrame);
|
346
|
342
|
}
|
347
|
|
-
|
348
|
|
- // TODO: notify the application about error status.
|
349
|
|
- controller.enqueue(encodedFrame);
|
350
|
343
|
});
|
351
|
344
|
}
|
352
|
345
|
|