Skip to content

feat(amp-youtube): add data-channelid to embed a channel's uploads#40529

Open
mmustafasenoglu wants to merge 2 commits into
ampproject:mainfrom
mmustafasenoglu:feat/amp-youtube-channel
Open

feat(amp-youtube): add data-channelid to embed a channel's uploads#40529
mmustafasenoglu wants to merge 2 commits into
ampproject:mainfrom
mmustafasenoglu:feat/amp-youtube-channel

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

What does this PR do?

Closes #26304. Adds a new data-channelid attribute to <amp-youtube> so a YouTube channel's uploads can be embedded, mirroring the existing data-videoid and data-live-channelid datasources.

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

  • 0.1 (extensions/amp-youtube/0.1/amp-youtube.js): added channelid_, getChannelId_(), extended getEmbedUrl_() to build ?listType=playlist&list=UU<channelId>, and updated assertDatasourceExists_() so exactly one of data-videoid / data-live-channelid / data-channelid is required.
  • 1.0 (src/bento/components/bento-youtube/1.0/): same logic in component.js (getEmbedUrl) plus a channelid prop mapped to data-channelid in base-element.js.
  • Validator (extensions/amp-youtube/validator-amp-youtube.protoascii): data-channelid added to the mandatory_oneof group and as an allowed attribute.
  • Tests: 0.1 render test for data-channelid, updated datasource assertion, updated validator .out messages, and test/fixtures/errors.html expected error.
  • Docs: data-channelid documented in amp-youtube.md.

Notes

Checklist

  • data-channelid works for both 0.1 and 1.0
  • validator allows data-channelid and enforces exactly-one-of
  • unit + validator tests updated
  • documentation updated

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
@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Request to include channel in <amp-youtube>

2 participants