biati-digital / glightbox

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

CC button not showing up for Youtube videos #445

Open Lefthandmedia opened 11 months ago

Lefthandmedia commented 11 months ago

Describe the bug Well the CC button is not showing up for Youtube videos. It does for vimeo. I can see the markup for it with a display:none . But i expect it to be visible when the 'captions' option is in the controls array.

Are you able to reproduce the bug in the demo site The demo site also does not show a CC button for the Youtube video

To Reproduce Steps to reproduce the behavior: initialise a Glightbox, have the 'captions' in the controls [array], link a you tube video.

Expected behavior i expect the CC button to be visible in the controlbar when the 'captions' option is in the controls array.

Post the code you are using const Mylightbox = GLightbox({ selector: .lightbox, touchNavigation: true, loop: true, autoplayVideos: true, plyr: { css: 'https://cdn.plyr.io/3.7.8/plyr.css', js: 'https://cdn.plyr.io/3.7.8/plyr.js', config: { ratio: null, // or '4:3' controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'pip', 'airplay', 'fullscreen'], }, }, });

Screenshots

Screenshot 2023-09-08 151705
biati-digital commented 10 months ago

GLightbox does not modify the player interface at all, if captions are hidden it must be something related to Plyr. GLightbox simply passes your configuration to Plyr and that's it. Not sure if this is a know issue but you'll have more luck asking in the Plyr repo.

Lefthandmedia commented 10 months ago

Posted an issue there as well ( https://github.com/sampotts/plyr/issues/2744 ). That said, it looks like PLYR is a dying project moving towards Vidstack. issues are no longer dealt with or answered by maintainer. Is there an alternative for PLYR?

gingerchew commented 10 months ago

Currently, none that I know of. They were kind of in a league of their own. The one that was used in previous versions has gone paid only.

biati-digital commented 10 months ago

This is something we need to consider, Vidstack does not support Youtube or Vimeo yet.

Probably we'll keep Plyr until Vidstack is ready. Plyr is not perfect but seems to be the best option for now.

Lefthandmedia commented 7 months ago

Vidstack seems to support Youtube and Vimeo now. https://www.vidstack.io/docs/player Features; Multiple media provider support: Audio, Video, HLS, DASH (soon), YouTube, Vimeo, and Remotion.