Skip to content

NicolasGraph/oui_video

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oui_video

Introduction

oui_video is a oui_player v2+ extension to easily embed HTML video provided videos in Textpattern powered websites.

Plugin requirements

oui_video’s minimum requirements:

Plugin management

Installation

From the admin interface

  1. Download the compiled plugin file or the source to compile a customized file.
  2. Paste the content of the compiled plugin file under the “Admin > Plugins”:?event=plugin tab and click the Upload button.
  3. Confirm the plugin install by clicking the Install button on the plugin preview page.
  4. Enable the plugin and click the Options link (or visit the Preferences tab) to set the provider preferences.

Via Composer (not available yet)

After installing Composer

  1. Target your project directory:
    $ cd /path/to/your/textpattern/installation/dir
  2. If it’s not already done, lock your version of Txp:
    $ composer require textpattern/lock:4.6.2, where 4.6.2 is the Txp version in use.
  3. Install oui_video:
    $ composer require nicolasgraph/oui_video

Update

From the admin interface

  1. Follow the installation instruction above.

Via Composer (not available yet)

$ composer update nicolasgraph/oui_video

Uninstall

From the admin interface

  1. Check the box on the left of the plugin row under the “Admin > Plugins”:?event=plugin.
  2. open the select list at the bottom of the plugins table and choose Delete.
  3. confirm the plugin deletion.

Via Composer (not available yet)

$ composer remove nicolasgraph/oui_video

Tags and parameters

oui_video vs oui_player

While the <txp:oui_player /> tag is able to embed any video from any extension-related provider, the <txp:oui_video /> tag is a shortcut to embed HTML video videos only. It is strictly equivalent to <txp:oui_player provider="video" />.

Check the oui_player documentation for more informations.

Recognised values for the play attribute

  • comma separated list of File ID’s;
  • comma separated list of filenames using one of the following extension: .mp4, .ogv or .wbm;
  • comma separated list of URL’s using the following extensions: .mp4, .ogv or .wbm.

When using the <txp:oui_player /> tag (vs <txp:oui_video />), the right provider needs to be set if the play value or its field related one is an ID. It is optional, but can fasten the rendering, if the value is an URL.

Player customization

Preferences vs attributes

While some player customization elements, related to the media to play, should be used through attributes, these used as global settings should preferrably be set through the plugin preferences to avoid a massive use of tag attributes.

Of course, it is still possible to override a preference value via an attribute when needed.

Size
width

Integer, initially set to 640.
The width of the player in pixels.

height

Integer, initially not set.
The height of the player in pixels.

ratio

Integer:integer; initially set to 16:9.
The ratio used to calculate the missing value for the width or the height.

responsive

true or false; initially set to false.
Adapts the final player size from the provided width and/or height and/or ratio values to fit the container width.
Wraps the player and adds some styles.

Parameters (a→z)

From Txp 4.7, paramaters accepting 0 and 1 as valid values can be enable through boolean/valueless attributes.

autoplay

0 or 1; initially set to 0.
Enables the automatic playing if set to 1.

controls

0 or 1; initially set to 0.
Displays the player controls.

loop

0 or 1; initially set to 0.
Reads the video over and over.

muted

0 or 1; initially set to 0.
Disables the sound if set to 1.

poster

URL; initially not set.
Specifies a start shot URL.

preload

none, metadata, auto; initially set to auto.
Specifies the way the browser load the media.

oui_if_video vs oui_if_player

While the <txp:oui_if_player>…</txp:oui_if_player> tag is able to check an URL against any URL from any extension-related provider, the <txp:oui_if_video>…</txp:oui_if_video> tag is a shortcut to check an URL against HTML video related URL schemes only. It is strictly equivalent to <txp:oui_if_player provider="video">…</txp:oui_if_player>.

Check the oui_player documentation for more informations.

Examples

Embed a player using the preference values

<txp:oui_player />

oui_player preference related field value: http://localhost:8888/GitHub/oui_player/demo/files/memory-of-a-woman.mp4.

Embed a player by defining its provider and a media ID through attributes

<txp:oui_player provider="video" play="2" />

…or:

<txp:oui_video play="2" />

Conditionally embed a player using attributes

<txp:oui_if_player provider="video" play="memory-of-a-woman.mp4">
    <txp:oui_player />
</txp:oui_if_player>

…or:

<txp:oui_if_video play="memory-of-a-woman.mp4">
    <txp:oui_video />
</txp:oui_if_video>

Credits

Author

Nicolas Morand
Thank you to the Textpattern community and the core team.

License

This plugin is distributed under GPL v2.0.

oui_video version 1.0.0-BETA4, Copyright © 2018 Nicolas Morand
This Textpattern plugin comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.

Changelog

  • oui_video v1.0.0-BETA4 (2018-08-15)
    • Added: MIME types managements;
    • changed: now extended from Oui\Player\Audio;
  • oui_player v1.3.0 (2017-05-24)