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

Doesnt seem to work with youtube playlist. #415

Closed
Lefthandmedia opened this issue Mar 29, 2023 · 5 comments
Closed

Doesnt seem to work with youtube playlist. #415

Lefthandmedia opened this issue Mar 29, 2023 · 5 comments

Comments

@Lefthandmedia
Copy link

Im trying to use a youtube playlist link in GL.
This playlistlink (https://www.youtube.com/embed/videoseries?list=PLM-mb7IpX4mryWYYoyl2HHboOUQHHC5hI&autoplay=1) works fine in a browser but not in the lightbox

Are you able to reproduce the bug in the demo site
Yes see here: https://codepen.io/Lefthandmedia/pen/vYzMZQd

Expected behavior
I expect the playlist to work in the Lightbox overlay

Post the code you are using
There is no specific code. see the codepen

Desktop:
All

Smartphone:
All

@Lefthandmedia
Copy link
Author

the only solution i see now is to not use PLYR for playlists and just use the embed code for embedding an Iframe when using a playlist.

@gingerchew
Copy link
Collaborator

Hey there @Lefthandmedia,

I think it is just a matter of updating the regex that determines the provider.

if (
  !provider &&
  (url.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || url.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/))
  ) {
    provider = 'youtube';
}

Unless it's something that plyr is not able to do, in which case you would need to reach out to them about updating how they handle YouTube playlists.

@Lefthandmedia
Copy link
Author

Hi Ginger,
Thanks for the reply, i think it is something that PLYR is unable to do. However that shouldn't be a reason for GL to fail on this, when it is possible to embed the standaard YouTube embed for playlists instead of using PLYR.
The only way i see now for GL to be able to service youtube playlists is not using PLYR for playlists.
The regex you mention is only to determine the video provider, nothing wrong there as far as i can see.

Lefthandmedia

@gingerchew
Copy link
Collaborator

You're right on the RegEx. But I think I found the issue:

The url you're giving as a video is: https://www.youtube.com/embed/videoseries?list=PLM-mb7IpX4mryWYYoyl2HHboOUQHHC5hI&autoplay=1

But when you open the lightbox, the url that is used is: https://www.youtube-nocookie.com/embed/videoseries?autoplay=0&controls=0&disablekb=1&playsinline=0&cc_load_policy=0&cc_lang_pref=auto&widget_referrer=https%3A%2F%2Fcodepen.io%2F&rel=0&showinfo=0&iv_load_policy=3&modestbranding=1&customControls=true&noCookie=true&enablejsapi=1&origin=https%3A%2F%2Fcdpn.io&widgetid=2

So what is missing? The ?list= param. (Similar to #396)

Seems like Plyr is consuming the param and not using it, you might be able to pass in the parameter using the settings.plyr.config.youtube option, but if not that is a weird Plyr quirk.

@stale
Copy link

stale bot commented Oct 15, 2023

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

@stale stale bot added the wontfix label Oct 15, 2023
@stale stale bot closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants