blob: 0a66457c333556334d8cc78c1f37de186810298c [file] [log] [blame]
class MockRTCRtpTransformer {
constructor(transformer) {
this.context = transformer;
this.start();
}
start()
{
this.reader = this.context.readable.getReader();
this.writer = this.context.writable.getWriter();
this.process();
}
process()
{
this.reader.read().then(chunk => {
if (chunk.done)
return;
if (chunk.value.type === "delta")
chunk.value = new ArrayBuffer();
this.writer.write(chunk.value);
this.process();
});
}
};
onrtctransform = (event) => {
new MockRTCRtpTransformer(event.transformer);
};
self.postMessage("registered");