Skip to content
This repository was archived by the owner on Apr 15, 2021. It is now read-only.

Commit 70c0611

Browse files
authored
Merge pull request #36 from easingthemes/master
Added 'youtube-nocookie' domain
2 parents e4dd7cf + 91b06f0 commit 70c0611

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nivo-lightbox.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
checkContent: function( link ) {
124124
var $this = this,
125125
href = link.attr('href'),
126-
video = href.match(/(youtube|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
126+
video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
127127

128128
if(href.match(/\.(jpeg|jpg|gif|png)$/i) !== null){
129129
return true;
@@ -151,7 +151,7 @@
151151
processContent: function(content, link){
152152
var $this = this,
153153
href = link.attr('href'),
154-
video = href.match(/(youtube|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
154+
video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
155155

156156
content.html('').addClass('nivo-lightbox-loading');
157157

@@ -197,6 +197,10 @@
197197
src = 'http://www.youtube.com/embed/'+ video[4];
198198
classTerm = 'nivo-lightbox-youtube';
199199
}
200+
if(video[1] == 'youtube-nocookie'){
201+
src = href; //https://www.youtube-nocookie.com/embed/...
202+
classTerm = 'nivo-lightbox-youtube';
203+
}
200204
if(video[1] == 'youtu'){
201205
src = 'http://www.youtube.com/embed/'+ video[3];
202206
classTerm = 'nivo-lightbox-youtube';

0 commit comments

Comments
 (0)