Skip to content

Feature/add channelid #40266

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AniketVerma0614
Copy link

Summary

This PR enhances the amp-youtube component by adding support for a new attribute, data-channelid. Instead of embedding a channel directly—which YouTube does not support in AMP—this feature converts the provided channel ID (which starts with "UC") into its corresponding uploads playlist ID (by replacing "UC" with "UU"). This approach allows developers to embed the channel's uploads playlist, ensuring that the latest videos from the channel are displayed.

Changes

  • Added a new property channelid_ to store the value from data-channelid.
  • Modified buildCallback() to read the data-channelid attribute.
  • Updated getEmbedUrl_() to:
    • Convert the channel ID (UC…) to an uploads playlist ID (UU…) automatically.
    • Construct the embed URL using the converted uploads playlist ID.
  • Updated assertDatasourceExists_() to include data-channelid as a valid source.

Testing

  • Manually verified that when data-channelid is provided, the component converts it properly and embeds the uploads playlist.
  • Confirmed that existing functionalities (data-videoid, data-live-channelid, etc.) are unaffected.
  • Tested across multiple browsers to ensure consistent behavior.

Related Issues

Closes #[26304] (if applicable)

Conclusion

This PR provides a robust solution for embedding a YouTube channel’s uploads playlist in AMP, addressing the limitation that YouTube does not support direct channel embedding. Please review the changes and provide feedback.

…aylist

- Introduced a new property `channelid_` to capture the data-channelid attribute.
- Updated buildCallback() to read data-channelid.
- Modified getEmbedUrl_() to convert channel IDs (UC…) to uploads playlist IDs (UU…) by replacing “UC” with “UU”.
- Updated assertDatasourceExists_() to validate data-channelid alongside other attributes.

This change enables embedding a channel’s uploads playlist as a better alternative since direct channel embedding is not supported.
@CLAassistant
Copy link

CLAassistant commented Apr 6, 2025

CLA assistant check
All committers have signed the CLA.

@AniketVerma0614
Copy link
Author

👋 Hi maintainers! I'm a beginner contributor, and I'm running into issues resolving the import paths for services and event-helper after the recent structure updates.
I tried a few things but couldn't figure out the correct paths.

Could someone kindly guide me on where to import these from now? I’d love to get this working and learn from the fix 🙏

Thanks in advance for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants