Skip to content

Commit fbbb232

Browse files
Fix for brutaldesign#145 - support for any url with variable swipeboxVideo=1 (for example - example.com/video?swipeboxVideo=1)
1 parent 0d3d406 commit fbbb232

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/js/jquery.swipebox.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,11 @@
644644
if ( src.match( /youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/) || src.match( /vimeo\.com\/([0-9]*)/ ) || src.match( /youtu\.be\/([a-zA-Z0-9\-_]+)/ ) ) {
645645
return true;
646646
}
647+
648+
if (src.toLowerCase().indexOf( "swipeboxvideo=1" ) >= 0){
649+
650+
return true;
651+
}
647652
}
648653

649654
},
@@ -667,6 +672,12 @@
667672
iframe = '<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?byline=0&amp;portrait=0&amp;color='+plugin.settings.vimeoColor+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
668673

669674
}
675+
676+
if (youtubeShortUrl || youtubeShortUrl || vimeoUrl){
677+
678+
} else {
679+
iframe = '<iframe width="560" height="315" src="' + url + '" frameborder="0" allowfullscreen></iframe>';
680+
}
670681

671682
return '<div class="swipebox-video-container" style="max-width:' + plugin.settings.videomaxWidth + 'px"><div class="swipebox-video">'+iframe+'</div></div>';
672683
},

0 commit comments

Comments
 (0)