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.
88 lines
3.5 KiB
88 lines
3.5 KiB
{% extends "templates/lilcity/index.html" %}
|
|
{% load static %}
|
|
{% block title %}{{ livelesson.title }} - {{ block.super }}{% endblock title %}
|
|
|
|
{% block twurl %}{{ request.build_absolute_uri }}{% endblock twurl %}
|
|
{% block ogtitle %}{{ livelesson.title }} - {{ block.super }}{% endblock ogtitle %}
|
|
{% block ogurl %}{{ request.build_absolute_uri }}{% endblock ogurl %}
|
|
{% block ogimage %}
|
|
{% if livelesson.cover and livelesson.cover.image %}http://{{request.META.HTTP_HOST}}{{ livelesson.cover.image.url }}{% else %}{{ block.super }}{% endif %}
|
|
{% endblock ogimage %}
|
|
{% block ogimage-width %}
|
|
{% if livelesson.cover and livelesson.cover.image %}{{ livelesson.cover.image.width }}{% else %}{{ block.super }}{% endif %}
|
|
{% endblock ogimage-width %}
|
|
{% block ogimage-height %}
|
|
{% 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">
|
|
<div class="lesson">
|
|
<div class="lesson__subtitle subtitle">{{ livelesson.title }}</div>
|
|
<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 }}" 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>-->
|
|
<comments obj-type="live-lesson" obj-id="{{ livelesson.id }}" :is-chat="true"></comments>
|
|
{% else %}
|
|
{% if livelesson.cover %}
|
|
<img class="video__pic" src="{{ livelesson.cover.image.url }}"/>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% for content in livelesson.content.all %}
|
|
|
|
{% with template="content/blocks/"|add:content.ctype|add:".html" %}
|
|
{% include template %}
|
|
{% endwith %}
|
|
|
|
{% endfor %}
|
|
<div class="section">
|
|
<div class="section__center center center_sm">
|
|
{% include 'templates/blocks/share.html' %}
|
|
</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 %}
|
|
|