-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
β¨ β
π Add new data attributes to amp-jwplayer
#35163
Conversation
amp-jwplayer
amp-jwplayer
amp-jwplayer
amp-jwplayer
Adding @alanorozco to the issue, and I should be able to look tomorrow. |
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.
Left a few comments and a nit, adding @alanorozco to review as well.
const configJSON = element.getAttribute('data-config-json'); | ||
const config = tryParseJson(configJSON) || {}; | ||
|
||
Object.keys(configAttributes).forEach((attr) => { |
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.
@alanorozco Thoughts? This appears to be a filter + copy.
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.
It looks like data-config-json
and data-config-json-*
are equivalent with the latter overriding specific properties in the former. It's the same case with data-ad-cust-params
and adMacro*
I would suggest that we stick to a single API, either a single attribute with all properties, or single attributes setting every property. But not both.
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.
There are actually only three options for the data-config-*
attribute, data-config-skin
, data-config-plugin
, and data-config-json
, so data-config-json-*
attributes are not expected. They follow that data-config-*
naming convention because they are player config settings.
getDataParamsFromAttributes
was used to grab those first two together, but they can instead be explicitly grabbed like this:
const configSkin = element.getAttribute('data-config-skin');
const configPlugin = element.getAttribute('data-config-plugin');
The data-ad-*
attributes are similar in that they are player ad settings. So data-ad-cust-params
is standalone, but multiple adMacros can be set with data-ad-macro-*
.
All these attributes are set on the config object to be sent together to the player, but that object can be renamed or a separate one can be used to make it more clear.
Open to any thoughts and ideas.
I've kicked off the systems to run CI/CD as well. |
@mamaddox Can you follow the instructions here to get this build running on CI? Pasted for convenience.
|
4e9abec
to
765b171
Compare
This reverts commit 5aeba5a.
* Add setup method * create separate postMessage method and add setup test * adding support for data-params and querystring * updating tests for data-params * re-adding unit test i accidentally removed * Pass custom config added through amp to player * Use correct import format * updated attribute names * adding code suggestions * Add test coverage and fix formatting * Move test config to above assertation * Update media id and player id for vast ad config * Add cust-params data attribute for ads * testing * Integrate with amp-consent and add custom macros * Lint fixes Co-authored-by: Daniel Lee <[email protected]>
ce703e7
to
77dc0b4
Compare
@kristoferbaxter Rebased the branch and fixed the other CircleCI issues, so should be good now. |
Approved the CI pipeline. |
Update our amp-jwplayer docs with the new attributes Add amp-jwplayer in the docs where it applies
hi @kristoferbaxter! just a quick nudge from the JW Player side, any update on when this will be merged and released? |
This reverts commit e73aba1.
* Add JW Player to documentation that applies * Revert "Add JW Player to documentation that applies" This reverts commit 5aeba5a. * Extend AMP Params (ampproject#62) * Add setup method * create separate postMessage method and add setup test * adding support for data-params and querystring * updating tests for data-params * re-adding unit test i accidentally removed * Pass custom config added through amp to player * Use correct import format * updated attribute names * adding code suggestions * Add test coverage and fix formatting * Move test config to above assertation * Update media id and player id for vast ad config * Add cust-params data attribute for ads * testing * Integrate with amp-consent and add custom macros * Lint fixes Co-authored-by: Daniel Lee <[email protected]> * Remove bad import * Clean up consentgdpr * Add comment about appending querystring * Clean up from rebase * Remove trailing whitespaces * Remove controls attribute * π [JW8-11873] Update JW Player AMP Docs (ampproject#61) Update our amp-jwplayer docs with the new attributes Add amp-jwplayer in the docs where it applies * cleanup rebase * lint fixes Co-authored-by: Zack Haigh <[email protected]> Co-authored-by: Daniel Lee <[email protected]>
This PR will...
amp-jwplayer
extension.Relates to:
amp-jwplayer
documentationΒ #35181