Django-cms : adding a video with a placeholder

1.1k views Asked by At

I'm trying to learn to use django-cms.

I'm trying to add a video (from youtube) on the default page. I've tried to do it with an iframe (The code you can copy directly from youtube, cf. picture bellow) by copying it directly in a template, and then with the administration interface (adding a video with a youtube link in a placeholder).

enter image description here

I succeed with the iframe, but not with the placeholder : I just get a black rectangle.

enter image description here

Here is the code rendered by the development server :

<div>
  <div class="cms_placeholder cms_placeholder-6"></div>
  <div class="cms_plugin cms_plugin-18">
    <div class="plugin_video">
      <object id="video-plugin-18" width="420" height="315" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" >
        <param name="movie" value="/static/cms/swf/player.swf"/>
        <param name="allowFullScreen" value="true" />
        <param name="allowScriptAccess" value="always" />
        <param name="allowFullScreen" value="true" /><param name="quality" value="autohigh" />
        <param name="wmode" value="opaque" />
        <param name="bgcolor" value="#000000" />
        <param name="flashvars" value="movie=https://www.youtube.com/watch?v=ynsBhCXm5Jk&amp;autoplay=false&amp;loop=false&amp;autohide=false&amp;fullscreen=true&amp;color_text=0xFFFFFF&amp;color_seekbar=0x13ABEC&amp;color_loadingbar=0x828282&amp;color_seekbarbg=0x333333&amp;color_button_out=0x333333&amp;color_button_over=0x000000&amp;color_button_highlight=0xFFFFFF" />
        <!--[if !IE]>-->
        <object width="420" height="315" data="/static/cms/swf/player.swf" type="application/x-shockwave-flash">
          <param name="allowFullScreen" value="true" />
          <param name="allowScriptAccess" value="always" />
          <param name="allowFullScreen" value="true" /><param name="quality" value="autohigh" />
          <param name="wmode" value="opaque" /><param name="bgcolor" value="#000000" />
          <param name="flashvars" value="movie=https://www.youtube.com/watch?v=ynsBhCXm5Jk&amp;autoplay=false&amp;loop=false&amp;autohide=false&amp;fullscreen=true&amp;color_text=0xFFFFFF&amp;color_seekbar=0x13ABEC&amp;color_loadingbar=0x828282&amp;color_seekbarbg=0x333333&amp;color_button_out=0x333333&amp;color_button_over=0x000000&amp;color_button_highlight=0xFFFFFF" />
          <!--<![endif]--><!-- alternate content -->
          Missing flash plugin. Please download the latest Adobe Flash Player: <br />
          <a href="https://www.adobe.com/go/getflashplayer">
            <img alt="Get Adobe Flash Player" src="/static/cms/img/icons/plugins/get_flash_player.gif" />
          </a>
          <!-- /alternate content --><!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>
    </div>
  </div>
  <iframe width="420" height="315" src="https://www.youtube.com/embed/ynsBhCXm5Jk" frameborder="0" allowfullscreen>
  </iframe>
  </div>

I don't know why I have this problem, here is the content of my pip freeze :

dj-database-url==0.3.0
Django==1.7.8
django-classy-tags==0.6.1
django-cms==3.1.0
django-reversion==1.8.5
django-sekizai==0.8.1
Django-Select2==4.3.1
django-treebeard==3.0
djangocms-admin-style==0.2.7
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.2
djangocms-inherit==0.1
djangocms-installer==0.7.7
djangocms-link==1.6.1
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.5.2
djangocms-video==0.1
html5lib==0.99999
Pillow==2.8.0
pytz==2015.4
six==1.9.0
tzlocal==1.1.3
wheel==0.24.0

I used a default page of a raw project. I just added some lines in the feature.html template :

{% extends "base.html" %}
{% load cms_tags staticfiles sekizai_tags menu_tags %}

{% block title %}{% page_attribute 'page_title' %}{% endblock title %}

{% block content %}
<div class="jumbotron">
  {% placeholder "feature" %}
</div>
<!-- from here -->
<div>
  {% placeholder "test" %}
<iframe width="420" height="315" src="https://www.youtube.com/embed/ynsBhCXm5Jk" frameborder="0" allowfullscreen></iframe>
</div>
<!-- to here -->
<div>
  {% placeholder "content" %}
</div>
{% endblock content %}

And added the first video via the admin interface.

How should I add a video with placeholders?

0

There are 0 answers