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, videoSampleEntryId: part.videoSampleEntryId,
}; };
let initSegmentResult = await api.init(part.videoSampleEntryId, {}); let initSegmentResult = await api.init(part.videoSampleEntryId, {});
if (initSegmentResult.status !== "success") { switch (initSegmentResult.status) {
this.error(`init segment fetch status ${initSegmentResult.status}`); case "error":
return; 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); this.setAspect(initSegmentResult.response.aspect);
srcBuf.appendBuffer(initSegmentResult.response.body); srcBuf.appendBuffer(initSegmentResult.response.body);