Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
9b5b8662
Commit
9b5b8662
authored
Jul 27, 2016
by
Seb
Browse files
Fix for wrong method signature syntax, bump version, converted readme to rst for pypi
parent
2b471aa5
Changes
6
Hide whitespace changes
Inline
Side-by-side
MANIFEST.in
View file @
9b5b8662
include LICENSE
include README.
md
include README.
rst
recursive-include wagtailvideos/templates *
README.md
deleted
100644 → 0
View file @
2b471aa5
# wagtailvideos
Based on wagtailimages. The aim was to have feature parity with images but for html5 videos.
Includes the ability to transcode videos to a html5 compliant codec using ffmpeg.
### Requirements
*
Wagtail > 1.4
*
[
ffmpeg
](
https://ffmpeg.org/
)
## Installing
**This package is not on PyPI yet**
## Using
### On a page model:
Implement as a
`ForeinKey`
relation, same as wagtailimages.
```
python
from
django.db
import
models
from
wagtail.wagtailadmin.edit_handlers
import
FieldPanel
from
wagtail.wagtailcore.fields
import
RichTextField
from
wagtail.wagtailcore.models
import
Page
from
wagtailvideos.edit_handlers
import
VideoChooserPanel
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
attributes are added to the surrounding
`<video>`
tag. The original video and all
extra transcodes are added as
`<source>`
tags.
```
django
{%
load
wagtailvideos_tags
%}
{%
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
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
codec libraries required for the transcode.
## Future features
-
Richtext embed
-
Streamfield block
-
Transcoding via amazon service rather than ffmpeg
-
Wagtail homescreen video count
README.rst
0 → 100644
View file @
9b5b8662
wagtailvideos
=============
Based on wagtailimages. The aim was to have feature parity with images
but for html5 videos. Includes the ability to transcode videos to a
html5 compliant codec using ffmpeg.
Requirements
------------
- Wagtail > 1.4
- `ffmpeg <https://ffmpeg.org/>`__
Installing
----------
**This package is not on PyPI yet**
Using
-----
On a page model:
~~~~~~~~~~~~~~~~
Implement as a ``ForeinKey`` relation, same as wagtailimages.
.. code:: python
from django.db import models
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Page
from wagtailvideos.edit_handlers import VideoChooserPanel
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 attributes are added to the surrounding ``<video>``
tag. The original video and all extra transcodes are added as
``<source>`` tags.
.. code:: django
{% load wagtailvideos_tags %}
{% 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 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 codec libraries required for the
transcode.
Future features
---------------
- Richtext embed
- Streamfield block
- Transcoding via amazon service rather than ffmpeg
- Wagtail homescreen video count
setup.cfg
View file @
9b5b8662
[metadata]
description-file = README.
md
description-file = README.
rst
setup.py
View file @
9b5b8662
...
...
@@ -3,14 +3,14 @@
Install wagtailvideos using setuptools
"""
with
open
(
'README.
md
'
,
'r'
)
as
f
:
with
open
(
'README.
rst
'
,
'r'
)
as
f
:
readme
=
f
.
read
()
from
setuptools
import
find_packages
,
setup
setup
(
name
=
'wagtailvideos'
,
version
=
'0.1.
5
'
,
version
=
'0.1.
6
'
,
description
=
"A wagtail module for uploading and displaying videos in various codecs."
,
long_description
=
readme
,
author
=
'Takeflight'
,
...
...
wagtailvideos/forms.py
View file @
9b5b8662
...
...
@@ -5,6 +5,7 @@ from enumchoicefield.forms import EnumField
from
wagtail.wagtailadmin
import
widgets
from
wagtail.wagtailadmin.forms
import
(
BaseCollectionMemberForm
,
collection_member_permission_formset_factory
)
from
wagtailvideos.fields
import
WagtailVideoField
from
wagtailvideos.models
import
MediaFormats
,
Video
from
wagtailvideos.permissions
import
\
...
...
@@ -51,7 +52,7 @@ def get_video_form(model):
class
VideoTranscodeAdminForm
(
forms
.
Form
):
media_format
=
EnumField
(
MediaFormats
)
def
__init__
(
self
,
video
,
**
kwargs
,
data
=
None
):
def
__init__
(
self
,
data
=
None
,
*
,
video
,
**
kwargs
):
super
().
__init__
(
**
kwargs
,
data
=
None
)
self
.
video
=
video
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment