Skip to content

Commit

Permalink
Plugin code block must be identifiable by CSS
Browse files Browse the repository at this point in the history
resolves #57 and works around issues raised by @FinalAngel . The CSS can be added separately as per https://github.com/django-cms/djangocms-template frontend example however we don't want developers have to override this plugin's HTML template all the time.
  • Loading branch information
Mario Colombo authored Aug 14, 2021
1 parent e5621b7 commit 3af9807
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions djangocms_video/templates/djangocms_video/default/video_player.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
{% load i18n cms_tags %}

{% 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 %}
<div class="djangocms-video-plugin">
{% 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 %}
</div>

0 comments on commit 3af9807

Please sign in to comment.