jsor / lity

Lightweight, accessible and responsive lightbox.
https://sorgalla.com/lity/
MIT License
1.16k stars 196 forks source link

YouTube not using 'rel=0' parameter #233

Open LightIllusion opened 4 years ago

LightIllusion commented 4 years ago

As above, when Lity is use to open a iframe based YouTube video there is no 'rel=0' parameter. That means when the video ends a bunch of 'random' videos are shown.

With 'rel=0' used, just related videos from the same channel are show,

How cal I add that parameter?

PixeltechCanada commented 4 years ago

You can force it by modifying the YouTube code starting on line 209 by adding:

{
  rel: 0
},

under

$.extend(
  {
    autoplay: 1
   },
LightIllusion commented 4 years ago

Perfect - that worked a charm!