Extension base oui_player v2+.
See oui_player for more informations.
As known at the last plugin release…
- Abc News: oui_abcnews;
- Archive: oui_archive;
- Bandcamp: oui_bandcamp;
- Dailymotion: oui_dailymotion;
- Giphy: oui_giphy;
- HTML5 audio: oui_audio;
- HTML5 video: oui_video;
- Mixcloud: oui_mixcloud;
- Myspace videos: oui_myspace;
- Soundcloud: oui_soundcloud;
- Twitch: oui_twitch;
- Viddsee: oui_viddsee;
- Vimeo: oui_vimeo;
- Vine: oui_vine;
- Youtube: oui_youtube.
oui_player’s minimum requirements:
- Textpattern CMS 4.6+;
- oui_player v2+;
- Any of the above provider related extension.
Follow the below instructions before or after installing the wanted oui_player extensions:
- Download the compiled plugin file or the source to compile a customized file.
- Paste the content of the compiled plugin file under the “Admin > Plugins”:?event=plugin tab and click the Upload button.
- Confirm the plugin install by clicking the Install button on the plugin preview page.
- Enable the plugin.
Once the plugin and its extensions enabled, you will need to complete the setup by clicking Options or visiting your “Admin > Preferences”:?event=prefs#prefs_group_oui_player tab.
This last step need to be repeated each time you add or remove one or more oui_player extensions to update the plugin preferences.
After installing Composer
- Target your project directory:
$ cd /path/to/your/textpattern/installation/dir
- If it’s not already done, lock your version of Txp:
$ composer require textpattern/lock:4.6.2
, where4.6.2
is the Txp version in use. - Install oui_player:
$ composer require nicolasgraph/oui_player
- Connect to the Txp admin interface and click Options or visit your “Admin > Preferences”:?event=prefs#prefs_group_oui_player tab to fill the plugin prefs.
Follow the install instructions.
If you are updating from v1.*, be sure to install all wanted extensions before to visit the “Admin > Preferences”:?event=prefs#prefs_group_oui_player tab to keep your preference values untouched.
$ composer update nicolasgraph/oui_player
- Check the box on the left of the plugin row under the “Admin > Plugins”:?event=plugin.
- open the select list at the bottom of the plugins table and choose Delete.
- confirm the plugin deletion.
$ composer remove nicolasgraph/oui_player
A provider related extension can be created by extending the Oui\Provider
class in a plugin author prefix related namespace.
As oui_provider may be not installed yet while enabling the new extension; it seems safe to wrap the new child class in a related condition clause.
Once the class created, in most cases, it should only require to override some static properties.
patterns
- Associative array of
'scheme'
, as a RegEx to check against media URL’s, and'id'
, as the index of the media ID in potential matches.
Multiple$patterns
can be defined through a multidimensional array. In this case, two optional subkeys can be useful:prefix
defines a string to prepend to the matched media ID, andglue
defines a string to append to the ID if multiple schemes can be matched at once. =: src
- URL base of the provider player. =:
glue
- Array of three strings to append, between the URL player base and media info, between the media info and the player parameters, and finally, between the player parameters.
dims
- Associative array of
'width'
,'height'
and'ratio'
values as strings. params
- Associative array of player paramaters and their related
'default'
value and'valid'
values.
Player parameters are used to set plugin preferences and tag attributes.
'valid'
values can be set to an array of strings or to a valid input type used for the plugin preference.
If an optionalforce
key is set, the parameter will be used by the player even if its value is set to the default one. =:
namespace Oui {
if (class_exists('Oui\Provider')) {
class Bandcamp extends Provider { protected static $patterns = array( 'album' => array( 'scheme' => '#((http|https)://bandcamp\.com/(EmbeddedPlayer/)?album=(\d+)/?)#i', 'id' => 4, 'prefix' => 'album=', 'glue' => '/', ), 'track' => array( 'scheme' => '#((http|https)://bandcamp\.com/(EmbeddedPlayer/)?[\S]+track=(\d+)/?)#i', 'id' => 4, 'prefix' => 'track=', ), ); protected static $src = '//bandcamp.com/'; protected static $glue = array('EmbeddedPlayer/', '/', '/'); protected static $dims = array( 'width' => '350', 'height' => '470', 'ratio' => '', ); protected static $params = array( 'size' => array( 'default' => 'large', 'force' => true, 'valid' => array('large', 'small'), ), 'artwork' => array( 'default' => '', 'valid' => array('', 'none', 'big', 'small'), ), 'bgcol' => array( 'default' => '#ffffff', 'valid' => 'color', ), 'linkcol' => array( 'default' => '#0687f5', 'valid' => 'color', ), 'tracklist' => array( 'default' => 'true', 'valid' => array('true', 'false'), ), ); } } }
Nicolas Morand
Thank you to the Textpattern community and the core team.
This plugin is distributed under GPL v2.0.
oui_provider 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.
- oui_provider v1.0.0-BETA4 (2018-08-15)
- Added: pluggable_ui related callback on each rendered player;
- Added: HTML5 validation;
- changed: now works as an extension base for oui_player; any plugin extending the
\Oui\Provider
class in an author prefix related namespace will be plugged into oui_player; - added: manages responsive embedding;
- changed: does not return any player if there is nothing to play (triggers an error);
- Added: triggers an error if an attribute value is not valid (for defined valid values only);
- changed: code rework:
- uses an author prefix related namespace;
- declares providers related dedicated tags;
- instances created/get via
Txp::get()
; - allows
$dims
/$prefs
to accept a string as default value.
- oui_player v1.3.1 (2017-07-13)