improve init segment fetch error msg

Fixes #146, in combination with earlier commit 4892ed7.
This commit is contained in:
Scott Lamb 2021-08-31 16:41:43 -07:00
parent d2c7b62771
commit 7e5bc42646

View File

@ -160,9 +160,15 @@ class LiveCameraDriver {
videoSampleEntryId: part.videoSampleEntryId,
};
let initSegmentResult = await api.init(part.videoSampleEntryId, {});
if (initSegmentResult.status !== "success") {
this.error(`init segment fetch status ${initSegmentResult.status}`);
return;
switch (initSegmentResult.status) {
case "error":
this.error(`init segment fetch error: ${initSegmentResult.message}`);
return;
case "aborted":
this.error(`init segment fetch aborted`);
return;
case "success":
break;
}
this.setAspect(initSegmentResult.response.aspect);
srcBuf.appendBuffer(initSegmentResult.response.body);