-
Notifications
You must be signed in to change notification settings - Fork 4k
Refactor event handling in amp-slikeplayer #40355
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: main
Are you sure you want to change the base?
Conversation
SlikeTech
commented
Jul 11, 2025
- Renamed SlEvent to CleoEvent and added new ad-related events.
- Implemented viewportCallback to play/pause based on visibility.
- Updated redispatch logic to handle new events appropriately.
- Renamed SlEvent to CleoEvent and added new ad-related events. - Implemented viewportCallback to play/pause based on visibility. - Updated redispatch logic to handle new events appropriately.
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.
Pull Request Overview
This PR refactors the event handling in amp-slikeplayer by renaming the event mapping constant, adding visibility-based playback control, and updating the redispatch logic to accommodate new events.
- Renamed
SlEvent
toCleoEvent
and added seek and ad-related event mappings. - Implemented
viewportCallback
to automatically play/pause based on element visibility. - Updated calls to
redispatch
and expanded the event switch to include the new mappings.
Comments suppressed due to low confidence (3)
extensions/amp-slikeplayer/0.1/amp-slikeplayer.js:33
- [nitpick] Consider adding unit tests for the newly introduced event mappings (
seeked
,seeking
,ad*
events) to ensureredispatch
correctly handles each case.
const CleoEvent = {
extensions/amp-slikeplayer/0.1/amp-slikeplayer.js:46
- Mapping
adComplete
to the same enum value asadEnd
(AD_END
) may be confusing or redundant; consider using a distinctAD_COMPLETE
enum or removing the duplicate mapping.
'adComplete': VideoEvents_Enum.AD_END,
extensions/amp-slikeplayer/0.1/amp-slikeplayer.js:180
- viewportCallback should return a boolean (e.g.,
return true;
) to indicate it wants to continue receiving visibility callbacks; otherwise observation stops after the first call.
}
is this related to the changes in #40350 ? |
@erwinmombay I just merged main into our branch to update it. The 'All Unit Tests' check is failing, but it's unrelated to our changes. Could you please re-run the unit tests? ![]() |
re-running |
@SlikeTech can you try rebasing and force pushing to trigger a re-run of the tests. if it fails again ill investigate when possible |