parent
85a4defe96
commit
46066fda9c
8 changed files with 77 additions and 27 deletions
@ -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