limit video lightboxes to youtube and vimeo

This commit is contained in:
Sacha Greif 2015-08-13 09:35:37 +09:00
parent 153e7d9c37
commit 04df5f7bd3

View file

@ -5,7 +5,11 @@ Template.post_thumbnail.onCreated(function () {
Template.post_thumbnail.helpers({
playVideoClass: function () {
return (this.media && this.media.type === "video") ? 'post-thumbnail-has-video': '';
var url = this.url;
var isVideoSite = url && _.some(["youtube", "vimeo"], function (site) {
return url.indexOf(site) !== -1;
});
return (this.media && this.media.type === "video" && isVideoSite) ? 'post-thumbnail-has-video': '';
},
showVideo: function () {
return Template.instance().showVideo.get();