Skip to content
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

Cannot play YouTube Shorts videos #1571

Open
dialegein opened this issue Feb 5, 2025 · 0 comments
Open

Cannot play YouTube Shorts videos #1571

dialegein opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@dialegein
Copy link

Current Behavior:

The player fails to load or display a video when the src attribute is set to a YouTube Shorts URL with the format https://www.youtube.com/shorts/zwMEhBq4kYM.

Expected Behavior:

The player should load and play the YouTube Shorts video referenced by the provided URL (https://www.youtube.com/shorts/zwMEhBq4kYM). The expected behavior is the same as when playing standard YouTube video URLs.

Steps To Reproduce:

Set the src attribute of the player to a YouTube Shorts URL. For example: https://www.youtube.com/shorts/zwMEhBq4kYM.

Environment:

Anything Else?

This regular expression doesn't appear to correctly handle the YouTube Shorts.
packages/vidstack/src/providers/youtube/utils.ts
const videoIdRE = /(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/;

@dialegein dialegein added the bug Something isn't working label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant