Template tags

You have to load template tag library first.

{% load embed_video_tags %}
class embed_video.templatetags.embed_video_tags.VideoNode(parser, token)[source]

Template tag video. It gives access to all VideoBackend variables.

Usage (shortcut):

{% video URL [SIZE] %}

Or as a block:

{% video URL as VAR %}
    ...
{% endvideo %}

Example:

{% video item.video "large" %}
{% video item.video "340x200" %}
{% video item.video "100% x 300" %}

{% video item.video as my_video %}
    URL: {{ my_video.url }}
    Thumbnail: {{ my_video.thumbnail }}
    Backend: {{ my_video.backend }}
{% endvideo %}
static embed(url, size, context=None)[source]

Direct render of embed video.

static get_backend(backend_or_url, context=None)[source]

Returns instance of VideoBackend. If context is passed to the method and request is secure, than the is_secure mark is set to backend.

A string or VideoBackend instance can be passed to the method.

static get_size(value)[source]

Predefined sizes:

size width height
tiny 420 315
small 480 360
medium 640 480
large 960 720
huge 1280 960

You can also use custom size - in format WIDTHxHEIGHT (eg. 500x400).

embed_video.templatetags.embed_video_tags.embed(backend, size='small')[source]

Warning

Deprecated since version 0.7: Use VideoNode.embed() instead.

Same like VideoNode.embed() tag but always uses insecure HTTP protocol.

Usage:

{{ URL|embed:SIZE }}

Example:

{{ 'http://www.youtube.com/watch?v=guXyvo2FfLs'|embed:'large' }}