Django template tags for YouTube and Vimeo
Project description
django-embed-video
==================
Django app for easy embeding YouTube and Vimeo videos.
Installation
------------
pip install django-embed-video
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
==================
Django app for easy embeding YouTube and Vimeo videos.
Installation
------------
pip install django-embed-video
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-embed-video-0.0.1.tar.gz
.
File metadata
- Download URL: django-embed-video-0.0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4bf180badc519ae4f8043c6c2500a024d8c35676af956bbcca7ae35f5447bc0 |
|
MD5 | 8b3558433713744a673a8b8057b1d9fc |
|
BLAKE2b-256 | fc2fad77d06ce2e5cad3d11ea679a188a255568fae9282c5b165091fd52e2484 |