-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin code block must be identifiable by CSS
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.
There are no files selected for viewing
55 changes: 29 additions & 26 deletions
55
djangocms_video/templates/djangocms_video/default/video_player.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |