-
Notifications
You must be signed in to change notification settings - Fork 0
SGAI: alternative and list mpd #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
Implement alternative max duration and clip
Implement alternative return offset
Implement alternative startAtPlayhead
…ad-with-t-anchor Feature/alternative start at play head with t anchor
…lternative duration
Alternative player signaling demo bug fixes
…efault Add default value to the earliestResolutionTimeOffset
Remove href from dropdown links Co-authored-by: Sebastian Piquerez <89274285+sebastianpiq@users.noreply.github.com>
typo Co-authored-by: Sebastian Piquerez <89274285+sebastianpiq@users.noreply.github.com>
…ack-to-main-content Media manager unit test: switch back to main content
…ve-media-presentations/media-manager-unit-tests
…media-manager-unit-tests Alternative media presentations: media manager unit tests
… log in PlaybackController
…live-to-live-switch-back feat: Implement live to live switch back
* alternative clip functional test vod to vod * small refacotr alternative replace live functional test * add clip live to live test case * fix clip for live to live * Update test/functional/test/feature-support/alternative/alternative-mpd-clip-vod.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * remove comment * Update src/streaming/controllers/AlternativeMediaController.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * rename deltaTime * remove comments * add missing clear timeouts * add missing done --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…in EventController and AlternativeMediaController
…update-and-listen-mode Add Alternative event update and listen mode
Co-authored-by: Sebastian Piquerez <sebastianp@qualabs.com>
…listen-mode-sample-page Add Listen Mode sample and update samples.json with new entry
…e correct HTML file
Summary of ChangesHello @cotid-qualabs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the player's capabilities by integrating support for DASH Alternative Media Presentations and the List MPD profile. These additions enable advanced content manipulation, such as dynamic ad insertion, content replacement, and modular manifest composition, providing greater flexibility for content providers and a more dynamic viewing experience for users. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 significant new functionality for Alternative Media Presentations and List MPDs, which is a great addition. The implementation includes new controllers, models, and sample pages to demonstrate the features. The code is generally well-structured. I've found a few issues, including some duplicate event definitions in CoreEvents.js that should be addressed. I've also suggested some minor refactoring in the new sample pages for better maintainability. Overall, this is a solid contribution.
| this.LOADING_COMPLETED = 'loadingCompleted'; | ||
| this.LOADING_DATA_PROGRESS = 'loadingDataProgress'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| switch(caseId) { | ||
| case 'case0': | ||
| behavior.innerText = "The player should download the Imported MPD and reproduce the unique Period."; | ||
| break; | ||
| case 'case1': | ||
| behavior.innerText = "The player should download the first Imported MPD, reproduce its first Period, and, upon completion, download the second Imported MPD and reproduce its first Period."; | ||
| break; | ||
| case 'case2': | ||
| behavior.innerText = "The player should download the first Imported MPD, reproduce its first Period, and, upon completion, play the next regular Period."; | ||
| break; | ||
| case 'case3': | ||
| behavior.innerText = "The player should start by playing the first regular Period as usual and, upon completion, download the linked Imported MPD and reproduce its first Period."; | ||
| break; | ||
| case 'case4': | ||
| behavior.innerText = "The player should start by playing the first regular Period as usual and, upon its completion, download the linked Imported MPD at startTime - earliestResolutionTime and reproduce its first Period"; | ||
| break; | ||
| case 'case5': | ||
| behavior.innerText = "The player should start by playing the first regular Period as usual and, upon its completion, download the linked Imported MPD at with earliestResolutionTime = 0 and reproduce its first Period."; | ||
| break; | ||
| case 'case6': | ||
| behavior.innerText = "The player must respect the shortest duration between the Linked Period in the main manifest and the Imported MPD. Playback should seamlessly stop at the shorter duration, ensuring no content extends beyond the specified boundaries."; | ||
| break; | ||
| case 'case7': | ||
| behavior.innerText = "The player should throw an error indicating that the start time of the first period in a list type MPD manifest is invalid."; | ||
| break; | ||
| case 'case8': | ||
| behavior.innerText = "The player should attempt to download the manifest four times before failing."; | ||
| break; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This switch statement can be refactored into a more maintainable data structure, like a map or an object, to associate case IDs with their behavior descriptions. This will make the code cleaner and easier to extend with new cases.
const behaviors = {
'case0': "The player should download the Imported MPD and reproduce the unique Period.",
'case1': "The player should download the first Imported MPD, reproduce its first Period, and, upon completion, download the second Imported MPD and reproduce its first Period.",
'case2': "The player should download the first Imported MPD, reproduce its first Period, and, upon completion, play the next regular Period.",
'case3': "The player should start by playing the first regular Period as usual and, upon completion, download the linked Imported MPD and reproduce its first Period.",
'case4': "The player should start by playing the first regular Period as usual and, upon its completion, download the linked Imported MPD at startTime - earliestResolutionTime and reproduce its first Period",
'case5': "The player should start by playing the first regular Period as usual and, upon its completion, download the linked Imported MPD at with earliestResolutionTime = 0 and reproduce its first Period.",
'case6': "The player must respect the shortest duration between the Linked Period in the main manifest and the Imported MPD. Playback should seamlessly stop at the shorter duration, ensuring no content extends beyond the specified boundaries.",
'case7': "The player should throw an error indicating that the start time of the first period in a list type MPD manifest is invalid.",
'case8': "The player should attempt to download the manifest four times before failing."
};
if (behaviors[caseId]) {
behavior.innerText = behaviors[caseId];
}| var video = document.getElementById('video-element'); | ||
| var alternativeVideo = document.getElementById('alternative-video-element'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using const instead of var for variables that are not reassigned. This is a modern JavaScript best practice that improves code clarity and prevents accidental reassignment.
| var video = document.getElementById('video-element'); | |
| var alternativeVideo = document.getElementById('alternative-video-element'); | |
| const video = document.getElementById('video-element'); | |
| const alternativeVideo = document.getElementById('alternative-video-element'); |
| }); | ||
|
|
||
| // Add response interceptor to modify manifest dynamically | ||
| addManifestResponseInterceptor(manifestUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| // Replace | ||
| this.returnOffset = NaN; | ||
| this.returnOffset = NaN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative MPD and List MPD implementation