innoweb/silverstripe-hostedvideos

adds video handling to objects. supports locally hosted videos as well as YouTube and Vimeo.

Installs: 633

Dependents: 0

Suggesters: 0

Stars: 5

Watchers: 2

Forks: 1

Open Issues: 0

Type:silverstripe-module

1.2.0 2019-06-28 06:24 UTC

README

This module allows adding locally hosted, YouTube or Vimeo videos to any object.

It uses

When adding Vimeo and YouTube videos, you can add the video code or the whole URL. If URLs are given, the URLs are parsed the video codes extracted.

Usage

Add the HostedVideoExtension to any page/dataobject you want to contain a video. This will add the fields for the object to contain one single video.

Insert $HostedVideo in your template, wherever you want your video to show.

Configuration

video sources

By default all three video sources are enabled. You can disable any of them using the following config options:

HostedVideoExtension:
  disable_selfhosted: true
  disable_vimeo: true
  disable_youtube: true

video resolutions

By default there are two video resultions configured for self hosted videos:

HostedVideoExtension:
  resolutions:
    SD: 480
    HD: 720

You can change these settings and add more resultions if you would like to give the user more options.

display size

You can specify the display size of the videos in your yml config:

HostedVideoExtension:
  display_size:
    width: 560
    height: 315

The default CSS treats all videos as having a 16:9 ratio (56.25% height).

formats and media types

You can specify the media types allowed for your self hosted videos in the yml config:

HostedVideoExtension:
  formats:
    mp4:
      type: 'video/mp4'
      label: 'MP4 (H.264 with AAC or MP3 audio)'
    webm:
      type: 'video/webm'
      label: 'WebM (VP8/VP9 with Vorbis or Opus audio)'
    ogg:
      type: 'video/ogg'
      label: 'Ogg (Theora with Vorbis audio)'

Please make sure the configured media types are also defined on your server (.htaccess for Apache):

AddType video/mp4 .mp4
AddType video/webm .webm
AddType video/ogg .ogg