|
|
|
|
@ -15,6 +15,12 @@ |
|
|
|
|
{% if livelesson.cover and livelesson.cover.image %}{{ livelesson.cover.image.height }}{% else %}{{ block.super }}{% endif %} |
|
|
|
|
{% endblock ogimage-height %} |
|
|
|
|
|
|
|
|
|
{% block head %} |
|
|
|
|
{% if livelesson.stream_index %} |
|
|
|
|
<script src="https://player.vimeo.com/api/player.js"></script> |
|
|
|
|
{% endif %} |
|
|
|
|
{% endblock head %} |
|
|
|
|
|
|
|
|
|
{% block content %} |
|
|
|
|
<div class="section" style="margin-bottom:0;padding-bottom:0"> |
|
|
|
|
<div class="section__center center center_sm"> |
|
|
|
|
@ -23,8 +29,9 @@ |
|
|
|
|
<div class="lesson__content">{{ livelesson.short_description | safe | linebreaks }}</div> |
|
|
|
|
<div class="lesson__video video"> |
|
|
|
|
{% if livelesson.stream_index %} |
|
|
|
|
<iframe class="lesson__video_frame" src="https://player.vimeo.com/video/{{ livelesson.stream_index }}?autoplay=1" frameborder="0" webkitallowfullscreen |
|
|
|
|
mozallowfullscreen allowfullscreen> |
|
|
|
|
<iframe class="lesson__video_frame" src="https://player.vimeo.com/video/{{ livelesson.stream_index }}" frameborder="0" |
|
|
|
|
width="720" height="400" |
|
|
|
|
webkitallowfullscreen mozallowfullscreen allowfullscreen> |
|
|
|
|
</iframe> |
|
|
|
|
<span>Если видео не загрузилось, - уменьшите качество видео или <a href="#" onclick="location.reload();">обновите страницу</a></span> |
|
|
|
|
<!--<iframe class="lesson__chat_frame" src="https://vimeo.com/live-chat/{{ livelesson.stream_index }}" frameborder="0"></iframe>--> |
|
|
|
|
@ -51,3 +58,31 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{% endblock content %} |
|
|
|
|
|
|
|
|
|
{% block foot %} |
|
|
|
|
{% if livelesson.stream_index %} |
|
|
|
|
<script> |
|
|
|
|
var iframe = document.querySelector('iframe.lesson__video_frame'); |
|
|
|
|
var player = new Vimeo.Player(iframe); |
|
|
|
|
player.on('ended', function() { |
|
|
|
|
console.log('vimeo player: ended', arguments[0]); |
|
|
|
|
}); |
|
|
|
|
player.on('error', function() { |
|
|
|
|
console.log('vimeo player: error', arguments[0]); |
|
|
|
|
}); |
|
|
|
|
player.on('loaded', function() { |
|
|
|
|
console.log('vimeo player: loaded', arguments[0]); |
|
|
|
|
}); |
|
|
|
|
player.on('ready', function() { |
|
|
|
|
console.log('vimeo player: ready', arguments[0]); |
|
|
|
|
}); |
|
|
|
|
player.on('play', function() { |
|
|
|
|
console.log('vimeo player: play', arguments[0]); |
|
|
|
|
}); |
|
|
|
|
player.on('pause', function() { |
|
|
|
|
console.log('vimeo player: pause', arguments[0]); |
|
|
|
|
}); |
|
|
|
|
player.play().catch(e => console.log(e)); |
|
|
|
|
</script> |
|
|
|
|
{% endif %} |
|
|
|
|
{% endblock foot %} |
|
|
|
|
|