Skip to main content

A wagtail module for uploading and displaying videos in various codecs.

Project description

https://gitlab.com/neonjungle/wagtailvideos/badges/master/pipeline.svg

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

Installing

Install using pypi

pip install wagtailvideos

Using

On a page model:

Implement as a ForeignKey relation, same as wagtailimages.

from django.db import models

from wagtail.admin.edit_handlers import FieldPanel
from wagtail.core.fields import RichTextField
from wagtail.core.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 a Streamfield:

A VideoChooserBlock is included

from wagtail.admin.edit_handlers import StreamFieldPanel
from wagtail.core.fields import StreamField
from wagtail.core.models import Page

from wagtailvideos.blocks import VideoChooserBlock

class ContentPage(Page):
  body = StreamField([
      ('video', VideoChooserBlock()),
  ])

  content_panels = Page.content_panels + [
      StreamFieldPanel('body'),
  ]

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.

{% 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

  • Transcoding via amazon service rather than ffmpeg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtailvideos-2.9.0.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

wagtailvideos-2.9.0-py2.py3-none-any.whl (56.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file wagtailvideos-2.9.0.tar.gz.

File metadata

  • Download URL: wagtailvideos-2.9.0.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for wagtailvideos-2.9.0.tar.gz
Algorithm Hash digest
SHA256 351c02e9974444ef202ec0511f77321f09a0eb30db589c44cae140b30b937cdd
MD5 67a138fa60bbd52141ddd69434696909
BLAKE2b-256 d8bcc51a84838ee427bb99e7736e604415704483d84f476f08953e6ce94b10f7

See more details on using hashes here.

File details

Details for the file wagtailvideos-2.9.0-py2.py3-none-any.whl.

File metadata

  • Download URL: wagtailvideos-2.9.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 56.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for wagtailvideos-2.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4143c279e20d6c9200807e2d31424753972f817ec2e1f9e2a0fea064d0c0ed7a
MD5 1ccb6057dda0e3df8f87041598d03b2f
BLAKE2b-256 e58242520198414b3e715d7b019b9a5962d8ebcab7b5e1434fe32990dab0dd78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page