feat(amp-youtube): add data-channelid to embed a channel's uploads#40529
Open
mmustafasenoglu wants to merge 2 commits into
Open
feat(amp-youtube): add data-channelid to embed a channel's uploads#40529mmustafasenoglu wants to merge 2 commits into
mmustafasenoglu wants to merge 2 commits into
Conversation
Allows embedding a YouTube channel's uploads playlist via a new data-channelid attribute, mirroring the existing data-videoid and data-live-channelid datasources. The uploads playlist id is the channel id prefixed with "UU". - 0.1 (extensions/amp-youtube) and 1.0 (bento) now support data-channelid - validator: data-channelid added to the mandatory_oneof group - tests: 0.1 render test + updated datasource assertion + validator fixture - docs: documented data-channelid in amp-youtube.md Refs ampproject#26304
- EXAMPLE_CHANNELID_URL should use embed/? (baseUrl ends with slash) - update extensions/amp-youtube/1.0/test/validator-amp-youtube.out error messages to include data-channelid in the mandatory_oneof list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Closes #26304. Adds a new
data-channelidattribute to<amp-youtube>so a YouTube channel's uploads can be embedded, mirroring the existingdata-videoidanddata-live-channeliddatasources.Why
The original request asked for a way to embed a YouTube channel. A channel embed is just its uploads playlist, whose id is the channel id prefixed with
UU(e.g.https://www.youtube.com/embed?listType=playlist&list=UU<channelId>). This PR implements that as a first-class datasource.How
extensions/amp-youtube/0.1/amp-youtube.js): addedchannelid_,getChannelId_(), extendedgetEmbedUrl_()to build?listType=playlist&list=UU<channelId>, and updatedassertDatasourceExists_()so exactly one ofdata-videoid/data-live-channelid/data-channelidis required.src/bento/components/bento-youtube/1.0/): same logic incomponent.js(getEmbedUrl) plus achannelidprop mapped todata-channelidinbase-element.js.extensions/amp-youtube/validator-amp-youtube.protoascii):data-channelidadded to themandatory_oneofgroup and as an allowed attribute.data-channelid, updated datasource assertion, updated validator.outmessages, andtest/fixtures/errors.htmlexpected error.data-channeliddocumented inamp-youtube.md.Notes
Checklist
data-channelidworks for both 0.1 and 1.0data-channelidand enforces exactly-one-of