Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for JSON-based manifests. The changes allow the manifest loader to parse JSON responses and update the Dash model accordingly. The date handling in DashManifestModel has been made more robust to accommodate date strings from JSON, and the HTTP loader has been updated to pass response headers. The changes look good and align with the goal of the proof-of-concept. I've provided a few suggestions to improve code simplicity, consistency, and error handling.
| try { | ||
| data = JSON.parse(data); | ||
| } catch (e) { | ||
| } |
There was a problem hiding this comment.
Swallowing the error in this catch block can make debugging difficult. If JSON.parse fails, the error is silently ignored, and the code proceeds to attempt XML parsing on what is likely an invalid JSON string. This will cause a failure later with a misleading error message. It's better to log the JSON parsing error to aid in debugging.
try {
data = JSON.parse(data);
} catch (e) {
logger.warn('Failed to parse manifest as JSON, though content-type was application/json.', e);
}Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This pull request lays the groundwork for supporting DASH manifests delivered in JSON format. It enhances the manifest loading process to detect JSON content via HTTP headers and parse it accordingly, while also refining how date properties are processed within the manifest model for greater robustness.
Highlights