Conversation
|
| * Unpublish the track from the SFU. Once this is called, any further calls to | ||
| * {@link tryPush} will fail. | ||
| */ | ||
| async unpublish(): Promise<void> { |
There was a problem hiding this comment.
if this is async, do we need to await a dataTrackUnpublished response ?
| * | ||
| * @throws {@link DataTrackPushFrameError} If the push fails. | ||
| */ | ||
| tryPush(frame: DataTrackFrame): void { |
There was a problem hiding this comment.
thought(non-blocking): I left a similar comment on the JS implementation, it seems a bit counter-intuitive that a try* method can throw.
Although I don't know if there's a good alternative here. If users aren't expected to gain additional insight from the error's message maybe returning a "success" boolean from the method would be sufficient?
| case 'eos': { | ||
| this.dispose(); | ||
| if (event.detail.value.error) { | ||
| controller.error(new Error(event.detail.value.error)); |
There was a problem hiding this comment.
suggestion(non-blocking): maybe nice to have a more specific (tagged) error here
| }, | ||
| }); | ||
|
|
||
| return new ReadableStream<DataTrackFrame>(new DataTrackStreamSource(res.stream!), { |
There was a problem hiding this comment.
question: should we be worried about the fact that each subscribe call pushes the same frames across the FFI boundary each time?
Not sure if there's a good way to re-use an existing source.
We could also think about teeing the stream but that comes with it's own pitfalls when reading at different rates in different places.
Resolves BOT-281