Commit a0fc6b04 authored by Seb's avatar Seb
Browse files

Changed README to markdown so it acutally looks ok

parent 9de85360
================================================= # wagtailvideos
Work in progress
=================================================
=============
wagtailvideos
=============
Based on wagtailimages. The aim was to have feature parity with images but for html5 videos. Based on wagtailimages. The aim was to have feature parity with images but for html5 videos.
Must have have ffmpeg installed with the correct codecs *(todo: put codec requirements here )* to be able to use the transcoding feature. Includes the ability to transcode videos to a html5 compliant codec using ffmpeg.
It works with Wagtail 1.4 and upwards.
### Requirements
* Wagtail > 1.4
* [ffmpeg](https://ffmpeg.org/)
## Installing
Installing
==========
**This package is not on PyPI yet** **This package is not on PyPI yet**
Using ## Using
=====
On a page model: ### On a page model:
################
Implement as a ForeinKey relation, same as wagtailimages.
:: Implement as a `ForeinKey` relation, same as wagtailimages.
from django.db import models
from wagtail.wagtailadmin.edit_handlers import FieldPanel ```python
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Page
from wagtailvideos.edit_handlers import VideoChooserPanel from django.db import models
class HomePage(Page): from wagtail.wagtailadmin.edit_handlers import FieldPanel
body = RichtextField() from wagtail.wagtailcore.fields import RichTextField
header_video = models.ForeignKey('wagtailvideos.Video', from wagtail.wagtailcore.models import Page
related_name='+',
null=True,
on_delete=models.SET_NULL)
content_panels = Page.content_panels + [ from wagtailvideos.edit_handlers import VideoChooserPanel
FieldPanel('body'),
VideoChooserPanel('header_video'),
]
In template: class HomePage(Page):
############ body = RichtextField()
header_video = models.ForeignKey('wagtailvideos.Video',
related_name='+',
null=True,
on_delete=models.SET_NULL)
content_panels = Page.content_panels + [
FieldPanel('body'),
VideoChooserPanel('header_video'),
]
```
### In template:
The video template tag takes one required postitional argument, a video field. All extra The video template tag takes one required postitional argument, a video field. All extra
attributes are added to the surrounding <video> tag. The original video and all attributes are added to the surrounding `<video>` tag. The original video and all
extra transcodes are added as <source> tags. extra transcodes are added as `<source>` tags.
.. code-block:: django ```django
{% load wagtailvideos_tags %}
{% video self.header_video autoplay controls width=256 %}
```
{% load wagtailvideos_tags %} ### How to transcode using ffmpeg:
{% video self.header_video autoplay controls width=256 %}
How to transcode using ffmpeg:
##############################
Using the video collection manager from the left hand menu. In the video editing Using the video collection manager from the left hand menu. In the video editing
section you can see the available transcodes and a form that can be used to create section you can see the available transcodes and a form that can be used to create
new transcodes. It is assumed that your compiled version of ffmpeg has the matching new transcodes. It is assumed that your compiled version of ffmpeg has the matching
codec libraries required for the transcode. codec libraries required for the transcode.
## Future features
Future features
===============
- Richtext embed - Richtext embed
- Streamfield block - Streamfield block
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Install wagtailvideos using setuptools Install wagtailvideos using setuptools
""" """
with open('README.rst', 'r') as f: with open('README.md', 'r') as f:
readme = f.read() readme = f.read()
from setuptools import find_packages, setup from setuptools import find_packages, setup
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment