minor error handling improvements

*   When the MediaSource is in error state (or busy, I think),
    endOfStream throws an exception. This prevented the error from being
    properly displayed in the UI. We don't really need to call
    endOfStream, I guess.
*   including an Event in a format string just said [Object object],
    at least on Safari. Use the type instead, which I think is the
    only useful info in the event anyway.
This commit is contained in:
Scott Lamb 2021-03-30 16:31:13 -07:00
parent d7f4b255bf
commit f34937220d

View File

@ -92,7 +92,6 @@ class LiveCameraDriver {
console.error(`${this.camera.shortName}: aborting due to ${reason}`);
this.stopStream(reason);
this.buf = { state: "error" };
this.src.endOfStream("network");
this.setPlaybackState({ state: "error", message: reason });
};
@ -230,7 +229,7 @@ class LiveCameraDriver {
};
bufEvent = (e: Event) => {
this.error(`bufEvent: ${e}`);
this.error(`SourceBuffer ${e.type}`);
};
videoPlaying = (e: SyntheticEvent<HTMLVideoElement, Event>) => {