jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
http://django-embed-video.rtfd.org
MIT License
382 stars 135 forks source link

Fix examples in documentation #15

Closed dellis23 closed 10 years ago

dellis23 commented 10 years ago

The documentation has the following as an example of embedding:

{# you can just embed #}
{% video item.video 'small' %}

{# or use variables (with embedding, too) #}
{% video item.video as my_video %}
    URL: {{ my_video.url }}
    Thumbnail: {{ my_video.thumbnail }}
    Backend: {{ my_video.backend }}
    {% video my_video 'small' %}
{% endvideo %}

There's also an example of how to use custom sizes:

{% video my_video '800x600' %}

After digging through the code to try to determine why I was getting an error with this code, I got the code working by doing {{ item.video.url|embed:"296x195" }}. I'm not 100% sure what the best practice way of using the library is, so I won't make suggestions as to how the documentation should read, but it certainly seems as though the example code is wrong.

yetty commented 10 years ago

{{ item.video.url|embed:"296x195" }} is deprecated way to embed video. You can use it, but it always uses HTTP protocol (instead of detecting of current protocol, what {% video %} tag does.)

{% video my_video '800x600' %} should work. Can you post the error message? Do you have the latest version of package (0.7)?

dellis23 commented 10 years ago

Ah, I suspect that's the issue. I have 0.6 and notice that documentation reflects the way that ended up working for me. The error was "Syntax error. Expected: video source as var". Sorry for the confusion, assumptions coming back to bite me once again!