-
Notifications
You must be signed in to change notification settings - Fork 8
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 support for embedding playlists #296
Conversation
🦋 Changeset detectedLatest commit: fcde9ca The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 suggestion.
Files not reviewed (3)
- packages/youtube/test/embed.default.test.js: Evaluated as low risk
- packages/youtube/test/_urls.mjs: Evaluated as low risk
- demo/src/youtube.md: Evaluated as low risk
Comments skipped due to low confidence (2)
packages/youtube/lib/embed.js:87
- The use of 'id ?? playlist' should be reviewed to ensure it doesn't introduce unintended behavior when both are present or missing.
return `https://i.ytimg.com/${fileTypePath}/${id ?? playlist}/${fileName}`;
packages/youtube/lib/embed.js:181
- [nitpick] The error message should be reviewed for consistency with other error messages in the codebase.
console.info("Couldn’t fetch video title. Falling back to default...\n", error);
More refactoring and cleanup
Cleanup, a little more refactoring Fix typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Wrap in paragraph, fix tests
b4793e3
to
fcde9ca
Compare
Closes #149
At long last, this PR adds support for YouTube playlists. There are two use cases:
Standalone playlists
These are YouTube playlist URLs that don't specify an individual video ID:
https://www.youtube.com/playlist?list=PLFtSvldL7Mh4ismj4BgH33pBR9hbtBkxz
For standalone playlists, the plugin embeds the player and starts playing from the first video in the list.
lite-youtube-embed
package.Videos with associated playlists
These are YouTube URLs that include both a video ID and a playlist ID:
https://www.youtube.com/watch?v=C04JZsoqs1A&list=PLFtSvldL7Mh4ismj4BgH33pBR9hbtBkxz
For this type of URL, the plugin embeds the player and starts playing from the specified video, wherever it is in the playlist numbering.
ℹ️ In lite mode, only the individual video will be embedded. Playlists aren't supported by the
lite-youtube-embed
package.