You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
601 B
22 lines
601 B
/* global woodmart_settings */
|
|
(function($) {
|
|
woodmartThemeModule.videoPoster = function() {
|
|
$('.wd-video-poster-wrapper').on('click', function() {
|
|
var videoWrapper = $(this),
|
|
video = videoWrapper.parent().find('iframe'),
|
|
videoScr = video.attr('src'),
|
|
videoNewSrc = videoScr + '&autoplay=1';
|
|
|
|
if (videoScr.indexOf('vimeo.com') + 1) {
|
|
videoNewSrc = videoScr + '?autoplay=1';
|
|
}
|
|
|
|
video.attr('src', videoNewSrc);
|
|
videoWrapper.addClass('hidden-poster');
|
|
});
|
|
};
|
|
|
|
$(document).ready(function() {
|
|
woodmartThemeModule.videoPoster();
|
|
});
|
|
})(jQuery);
|
|
|