Skip to content

Conversation

@cotid-qualabs
Copy link

@cotid-qualabs cotid-qualabs commented Dec 18, 2025

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

  • JSON Manifest Parsing: Introduced initial support for parsing DASH manifests that are delivered in JSON format, allowing the system to handle both XML and JSON manifest structures.
  • Robust Date Handling: Improved the handling of date-related properties within the DashManifestModel to ensure that values are correctly converted to Date objects, preventing redundant conversions or errors when the input is already a Date.
  • HTTP Header Propagation: Modified the HTTP loader to pass response headers to the manifest loader, enabling content type detection for intelligent parsing decisions.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +196 to +199
try {
data = JSON.parse(data);
} catch (e) {
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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);
                            }

cotid-qualabs and others added 4 commits December 19, 2025 11:28
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>
@qualabs qualabs deleted a comment from gemini-code-assist bot Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants