Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(djangocms_video): responsive template #580

Merged
merged 3 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions taccsite_cms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,14 @@ def get_subdirs_as_module_names(path):
'autoParagraph': False
}

# https://github.com/django-cms/djangocms-video
DJANGOCMS_VIDEO_TEMPLATES = [
('responsive-16by9', _('Responsive - 16 by 9')),
('responsive-4by3', _('Responsive - 4 by 3')),
('responsive-1by1', _('Responsive - 1 by 1')),
('responsive-21by9', _('Responsive - 21 by 9')),
]

########################
# IMPORT & EXPORT
########################
Expand Down
38 changes: 38 additions & 0 deletions taccsite_cms/templates/djangocms_video/default/video_player.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{# https://github.com/django-cms/djangocms-video/blob/3.0.0/djangocms_video/templates/djangocms_video/default/video_player.html #}
{% load i18n cms_tags %}

{# TACC: #}
{% block content_video %}
{# /TACC #}

{% if instance.embed_link %}
{# show iframe if embed_link is provided #}
<iframe src="{{ instance.embed_link_with_parameters }}" {{ instance.attributes_str }} frameborder="0" allowfullscreen="true"></iframe>
{% with disabled=instance.embed_link %}
{% for plugin in instance.child_plugin_instances %}
{% render_plugin plugin %}
{% endfor %}
{% endwith %}
{% else %}
{# render <source> or <track> plugins #}
<video controls {{ instance.attributes_str }}
{% if instance.poster %} poster="{{ instance.poster.url }}"{% endif %}>
{% for plugin in instance.child_plugin_instances %}
{% render_plugin plugin %}
{% endfor %}
{% trans "Your browser doesn't support this video format." %}
</video>
{% endif %}

{% comment %}
# Available variables:
{{ instance.template }}
{{ instance.label }}
{{ instance.embed_link }}
{{ instance.poster }}
{{ instance.attributes_str }}
{% endcomment %}

{# TACC: #}
{% endblock content_video %}
{# /TACC #}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "djangocms_video/default/video_player.html" %}

{% block content_video %}
<div class="embed-responsive embed-responsive-16by9">
{{ block.super }}
</div>
{% endblock content_video %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "djangocms_video/default/video_player.html" %}

{% block content_video %}
<div class="embed-responsive embed-responsive-1by1">
{{ block.super }}
</div>
{% endblock content_video %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "djangocms_video/default/video_player.html" %}

{% block content_video %}
<div class="embed-responsive embed-responsive-21by9">
{{ block.super }}
</div>
{% endblock content_video %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "djangocms_video/default/video_player.html" %}

{% block content_video %}
<div class="embed-responsive embed-responsive-4by3">
{{ block.super }}
</div>
{% endblock content_video %}