player icon indicating copy to clipboard operation
player copied to clipboard

Cannot play YouTube Shorts videos

Open dialegein opened this issue 11 months ago • 0 comments

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 avatar Feb 05 '25 04:02 dialegein