|
|
|
|
@ -97,13 +97,15 @@ $(document).ready(function () { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$(".js-video-modal").on('player-created', e => { |
|
|
|
|
if(window.LIL_STORE.user.id || ! $(e.target).data('trialLesson') || Cookies.get(EMAIL_CAPTURED_COOKIE)){ |
|
|
|
|
if(window.LIL_STORE.user.id || $(e.target).data('trialLesson') && Cookies.get(EMAIL_CAPTURED_COOKIE) |
|
|
|
|
|| ! $(e.target).data('freeLesson')){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const channel = $(e.target).data('channel'); |
|
|
|
|
const player = e.detail.player; |
|
|
|
|
let timeout = null; |
|
|
|
|
const interval = 1000 * 60; // 1 min
|
|
|
|
|
const freeLesson = $(e.target).data('freeLesson') |
|
|
|
|
const interval = 1000 * (freeLesson ? 180 : 60); // 1 min
|
|
|
|
|
const pauseVideo = () => { |
|
|
|
|
timeout = setTimeout(() => { |
|
|
|
|
clearTimeout(timeout); |
|
|
|
|
@ -118,6 +120,11 @@ $(document).ready(function () { |
|
|
|
|
player.pause(); |
|
|
|
|
} |
|
|
|
|
$modalVideo.css('opacity', 0); |
|
|
|
|
if(freeLesson){ |
|
|
|
|
popup = $('.js-popup-auth'); |
|
|
|
|
showPopup(); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
captureEmail(true).then(() => { |
|
|
|
|
$modalVideo.css('opacity', 1); |
|
|
|
|
Cookies.set(EMAIL_CAPTURED_COOKIE, 1); |
|
|
|
|
@ -130,6 +137,7 @@ $(document).ready(function () { |
|
|
|
|
}).catch(() => { |
|
|
|
|
$('.modal-video').remove(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, interval); |
|
|
|
|
} |
|
|
|
|
if(channel == 'youtube'){ |
|
|
|
|
|