poster_file = self.get_poster_file()
if poster_file:
url = poster_file.url
- if not "http" in url:
- domain = Site.objects.get_current().domain
- url = f'https://{domain}{url}'
return url
def get_file(self):
{% extends "teleforma/course_detail.html" %}
{% load teleforma_tags %}
{% load i18n %}
-{% load thumbnail %}
{% block extra_javascript %}
height="auto"
data-setup='{"playbackRates": [1, 1.25, 1.5, 2]}'
{% if media.poster_url %}
- {% thumbnail media.poster_url '640' as im %}
- poster="{{ im.url }}"
- {% endthumbnail %}
+ poster="{{ media.poster_url }}"
{% endif %}
>
<source src="{% url 'teleforma-media-stream' period.id media.id %}" type="{{ media.mime_type }}" />
<div style="margin-top:1em;">
{% if media.poster_file %}
-
- {% thumbnail media.poster_url "300" as im %}
- <img src="{{ im.url }}" width="300px" alt="preview" />
- {% endthumbnail %}
-
+ <img src="{{ media.poster_url }}" width="300px" alt="preview" />
{% else %}
snapshot
{% endif %}
</div>
{% endif %}
- {% if user.is_staff %}
- <div class="module_action">
- <a href="{% url 'teleforma-desk-period-pending' period.id %}" class="component_icon button"
- id="action_red">{% trans "Pending" %}</a>
- </div>
- {% endif %}
-
{% endblock module-action %}
{% block notes %}
<div class="video" style="width:400px">
<a href="{% url 'teleforma-media-detail' period.id home_video.id %}" title="{% trans "Play" %}">
{% if home_video.poster_file %}
- {% thumbnail home_video.poster_file "168x96" as im %}
- <div style="background: no-repeat url('{{ im.url }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
+ <div style="background: no-repeat url('{{ home_video.poster_url }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
<img src="/static/teleforma/images/play_168.png" width="100%" alt="{% trans 'Click here' %}" />
</div>
- {% endthumbnail %}
{% else %}
{% trans 'Click here' %}
{% endif %}
{% load teleforma_tags %}
-{% load thumbnail %}
{% load i18n %}
{% course_past_conferences as all_conferences %}
<td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
<a href="{% url 'teleforma-media-detail' period.id conference.video.id %}" title="{% trans "Play" %}">
{% if conference.video.poster_file %}
- {% thumbnail conference.video.poster_url "168x96" as im %}
- <div style="background: no-repeat url('{{ im.url }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
+ <div style="background: no-repeat url('{{ conference.video.poster_url }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
<img src="/static/teleforma/images/play_168.png" width="100%" alt="{% trans 'Click here' %}" />
</div>
- {% endthumbnail %}
{% else %}
<div>{% trans 'Click here' %}</div>
{% endif %}