biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.03k stars 228 forks source link

YouTube Shorts #395

Closed leenasn closed 5 months ago

leenasn commented 1 year ago

I find that the videos don't play when YouTube Shorts URL is provided. Can someone guide me to fix it?

Thanks, Leena

gingerchew commented 1 year ago

Hmmm, that is strange, can you post an example of the url you're using? There is a chance that plyr.js, and subsequently GLightbox, doesn't support that format yet.

leenasn commented 1 year ago

Here is a sample URL: https://www.youtube.com/shorts/Rj2JgmXzLxQ

Sorry, forgot to add it earlier.

gingerchew commented 1 year ago

Yup its like I thought, currently the regex that looks for the provider is this https://github.com/biati-digital/glightbox/blob/29e365d4148c72ac08da752a5d0ebbe595f7046f/src/js/slides/video.js#L38-L43

If someone wants to add to the regex the necessary regex pieces, I'm more than happy to review the PR :)

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.