Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
Find a file
Juda Kaleta 5b994c2b5a Merge pull request #1 from zodman/master
Enhanced getingt the id code from youtube
2013-06-24 07:34:13 -07:00
embed_video enhanced 2013-06-18 17:30:53 -05:00
.gitignore ignored files 2013-05-31 13:27:07 +02:00
.travis.yml Improve travis 2013-06-08 09:26:17 +02:00
CHANGES.rst version 0.1 2013-06-01 15:21:01 +02:00
LICENSE License 2013-05-31 13:25:11 +02:00
MANIFEST.in manifest 2013-06-01 15:33:46 +02:00
README.rst Installation from sources 2013-06-01 15:38:53 +02:00
setup.py manifest 2013-06-01 15:33:46 +02:00

django-embed-video
==================

Django app for easy embeding YouTube and Vimeo videos.


Installation
************

::

    pip install django-embed-video


or from sources

::

    pip install git+https://github.com/yetty/django-embed-video.git


Add ``embed_video`` to ``INSTALLED_APPS`` in your Django settings.


Examples
********

Template examples
-----------------

First you have to load the `embed_video_tags` template tags in your template:

::

    {% load embed_video_tags %}

Simple embeding of video:

::

    {% video item.video as video %}
        {{ video|embed:'small' }}
    {% endvideo %}

Default sizes are ``tiny`` (420x315), ``small`` (480x360), ``medium`` (640x480),
``large`` (960x720) and ``huge`` (1280x960). You can set your own size:

::

    {{ video|embed:'800x600' }}

Usage of variables:

::

    {% video item.video as video %}
        URL: {{ video.url }}
        Thumbnail: {{ video.thumbnail }}
    {% endvideo %}


Model examples
---------------

Using the EmbedVideoField you provide validation of correct URL.

::

    from django.db import models
    from embed_video.fields import EmbedVideoField

    class Item(models.Model):
        video = EmbedVideoField()  # same like models.URLField()


TODO
*****

- provide AdminEmbedVideoMixin
- Vimeo thumbnail