parent
85a4defe96
commit
46066fda9c
8 changed files with 77 additions and 27 deletions
@ -1,15 +1,6 @@ |
|||||||
{% load static %} |
{% load static %} |
||||||
<div class="popup video-ended js-popup-video-ended" data-manual-close="1"> |
<div id="main-video-ended-popup" class="video-ended-popup js-popup-video-ended" data-manual-close="1"> |
||||||
<div class="popup__wrap popup__wrap_md js-popup-wrap"> |
<div class="video-ended__body"> |
||||||
<button class="popup__close js-popup-close"> |
Отправь другу реферальную ссылку, пригласи учиться вместе и получи лилики на свой бонусный счёт! |
||||||
<svg class="icon icon-close"> |
|
||||||
<use xlink:href={% static "img/sprite.svg" %}#icon-close></use> |
|
||||||
</svg> |
|
||||||
</button> |
|
||||||
<div class="popup__body video-ended__body"> |
|
||||||
<div> |
|
||||||
Отправь другу реферальную ссылку, пригласи учиться вместе и получи лилики на свой бонусный счёт! |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
|
|||||||
@ -0,0 +1,39 @@ |
|||||||
|
import $ from 'jquery'; |
||||||
|
import {loadScript} from '../utils'; |
||||||
|
|
||||||
|
function getVideoPopup($videoEl){ |
||||||
|
const $container = $videoEl.parent(); |
||||||
|
let $popup = $container.children('.video-ended-popup'); |
||||||
|
if(! $popup){ |
||||||
|
$popup = $('#main-video-ended-popup').clone(); |
||||||
|
$popup.attr('id', ''); |
||||||
|
//$popup.find('.')
|
||||||
|
$container.append($popup); |
||||||
|
} |
||||||
|
return $popup; |
||||||
|
} |
||||||
|
|
||||||
|
loadScript('https://player.vimeo.com/api/player.js'); |
||||||
|
$(document).ready(function () { |
||||||
|
$('.js-video').each(function (){ |
||||||
|
const $iframe = $(this); |
||||||
|
const isYT = $iframe.data('isYoutube'); |
||||||
|
const isVimeo = $iframe.data('isVimeo'); |
||||||
|
const courseId = $iframe.data('courseId'); |
||||||
|
if($iframe.data('isYoutube')){ |
||||||
|
|
||||||
|
} |
||||||
|
if($iframe.data('isVimeo')){ |
||||||
|
const player = new Vimeo.Player(this); |
||||||
|
player.on('pause', function(data) { |
||||||
|
if(data.percent == 1){ |
||||||
|
getVideoPopup($iframe).show(); |
||||||
|
document.exitFullscreen(); |
||||||
|
} |
||||||
|
}); |
||||||
|
player.on('play', function() { |
||||||
|
getVideoPopup($iframe).hide(); |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
@ -0,0 +1 @@ |
|||||||
|
import "../modules/content"; |
||||||
Loading…
Reference in new issue