Oui player - Manage configurable media players in @Textpattern CMS

Overview

oui_player

Introduction

An extendable plugin to easily embed customized audio and video players.

. This plugin does not use oembed, it builds iframe embedding codes and HTML5 players by its own without any external request for better performances.

Supported extensions

As known at the last plugin release…

Plugin requirements

oui_player’s minimum requirements:

Plugin management

Installation

From the admin interface

Follow the below instructions before or after installing the wanted oui_player extensions:

  1. Download the .txt or _zip.txt compiled plugin file;
  2. Upload its contents through the Admin > Plugins tab;
  3. Confirm the plugin install on the preview page.
  4. Enable the plugin and click the Options link to set the plugin 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_player:
    $ composer require nicolasgraph/oui_player
  4. 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.

Update

From the admin interface

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.

Via Composer (not available yet)

$ composer update nicolasgraph/oui_player

Uninstall

From the admin interface

  1. In the Admin > Plugins tab, check the box on the left of the plugin related row.
  2. Under the plugins list, select the the Delete option.
  3. confirm the deletion.

Via Composer (not available yet)

$ composer remove nicolasgraph/oui_player

Preferences/options

Plugin prefs can be set under the Admin > Preferences tab and are mainly used as default values for the <txp:oui_player /> tag attributes.

Global prefs

Field used by default

Defines a field to use as the default play attribute value.
The provided fieldname must be different than any value entered in it; avoid digits if you use ID’s as play attribute values
Default: article_image
valid: article_image or any existing custom field

Favourite provider

Set the default provider attribute value.
Default: the first plugged provider
valid: Any plugged provider in the select list

Display the provider player preferences

Displays the defined provider prefs as a goup of prefs.
Default: yes
valid: yes or no

Providers prefs

While some player parameters, related to the item to play, should be used through attributes (e.g. the Youtube start parameter which defines the second where to start playing the video), 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 plugin pref value via an attribute when needed.

Tags

oui_player

Embeds a player.

<txp:oui_player />

Presentational attributes

label

String; empty by default.
Label for the video.

labeltag

HTML container tag name; empty by default.
HTML wraptag for the label, without brackets.

wraptag

HTML container tag name; empty by default.
HTML tag to be used as the content wraptag, without brackets.

class

String; empty by default.
CSS class for HTML content wraptag.

responsive

true or false, related preference value used by default.
Adapts the final player size from provided width and/or height and/or ratio values to fit the container width.
Wraps the player and adds some styles.

Main tag attributes

Most of the following attributes can be set via the Preferences tab; always prefer plugin “global” prefs to tag related attributes!

play

Valid values differs from one provider to another, check each extension.
The item to play; required if it does not use the value of the custom field selected in the plugin prefs (See each provider to know the valid values).
default: changed v1.2.0 the play attribute value of an eventual <txp:oui_if_play></txp:oui_if_play> container tag, or the custom field value of the one selected in the plugin prefs.

provider

Extension related provider name; uses the related preference value by default.
The provider to use; required if the play attribute is an id, recommended anyways if known as it increases the plugin performances by skipping the provider guess.

Providers related tag attributes

See each provider related extension.

oui_if_player

Checks the play attribute value againsts defined URL schemes.

<txp:oui_if_player>
[…]
</txp:oui_if_player>

Attributes

play

The custom field value of the one selected in the plugin prefs by default.
The item to play; required if it does not use the value of the custom field selected in the plugin prefs (See each provider to know the valid values).

provider

Extension related provider name; empty by default.
Check the URL against valid URL schemes of the defined provider.

Examples

Display a player from the default values collected via plugin prefs

<txp:oui_player />

Display a player from a manually filled URL

<txp:oui_player play="https://vimeo.com/155020267" />

…or, maybe a bit faster…

<txp:oui_player provider="vimeo" play="https://vimeo.com/155020267" />

Display a player from manually filled ID

Using the favourite provider set in the prefs.

<txp:oui_player play="x4l8awd" />

…or, in conjonction with the provider attribute…

<txp:oui_player provider="dailymotion" play="x4l8awd" />

Display a player only if its URL is recognized as a provider URL scheme

With the default values collected via plugin prefs…

<txp:oui_if_player>
    <txp:oui_player />
</txp:oui_if_player>

…or, with a manually filled URL…

<txp:oui_if_player play="https://vimeo.com/155020267">
    <txp:oui_player />
</txp:oui_if_player>

You can also add the provider attribute to check the URL against URL schemes of a defined provider.

Credits

Author

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

License

This plugin is distributed under GPL v2.0.

oui_player version 2.0.0-BETA3, 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

  • v2.0.0-BETA3 (2018-08-15)
    • Added: admin side player preview;
    • Changed: excerpt field no longer supported;
    • Added: responsive embedding;
      • changed: providers related preferences displayed by default;
    • changed: code rework:
  • v1.3.1 (2017-07-13)
  • v1.3.0 (2017-05-24)
    • Adds Composer support for textpattern/installer;
    • fixes multiple players prefs display and improves perfs;
    • improves scripts embedding;
    • added: Youtube player parameters enablejsapi and origin;
    • added: Dailymotion player parameters api and origin;
    • added: Vimeo player parameter api and removes badge;
    • added: support for:
  • v1.2.1 (2017-01-16)
    • Fixed: Fixes the Field used by default pref display when no custom field exists;
    • fixed: fixes Textpack typo;
    • changed: compiled code lightened by removing duplicated license related comments;
  • v1.2.0 (2016-12-12)
    • added: sets the custom field plugin pref as the defaut value of the conditional tag play attribute;
    • added: introduces a play attribute value inheritance in a conditional/container tag context;
    • added: support for:
    • changed: improves PHP classes and methods use (see For developers).
  • oui_player v1.1.0 (2016-10-14)
    • changed: plugin/tag names;
    • removed: Txp 4.5 support;
    • changed: consistency between attribute and player parameter names increased;
    • changed: code rework to be easily extendable;
    • added: support for:
    • (changed) Help file styling improvements.
  • oui_video v0.1.0 (2016-09-13)
  • oui_dailymotion v1.3.1 (2016-02-25) inspired by arc_youtube and arc_vimeo by Andy Carter.
You might also like...
Ied plugin composer - Inspired Plugin Composer: Create, publish and edit plugins from within Textpattern CMS.

ied_plugin_composer Create, publish and edit plugins from within Textpattern CMS. Creates a new page under the Extensions tab where you can edit and e

Rah backup - Takes backups from Textpattern CMS installations

rah_backup Packagist | Twitter | Donate Rah_backup keeps your important site safe from disastrous events. Rah_backup is an admin-side backup utility p

Rah sitemap - XML sitemap generator for Textpattern CMS

rah_sitemap Packagist | Issues | Donate Sitemap plugin for Textpattern CMS. Generates Sitemaps.org XML sitemaps for your site, which help Google and o

Rah memcached - Store parts of Textpattern CMS templates in Memcached

rah_memcached Packagist | Issues | Donate A plugin for Textpattern CMS that stores parts of your templates in Memcached, a distributed in-memory key-v

Rah cache minify - HTML compressor module for rah cache Textpattern CMS plugin

Minify module for rah_cache This is a minify module for rah_cache, a full-page caching solution for Textpattern CMS. Rah_cache_minify will minify HTML

Etc cache - Cache plugin for Textpattern CMS

etc_cache Download | Packagist This Textpattern plugin provides an events-driven cache solution for Textpattern CMS. Textpattern is fast, but when you

Etc pagination - Pagination plugin for Textpattern CMS.

etc_pagination Download | Packagist This Textpattern plugin creates a paginated navigation bar on listings. It has a wide variety of attributes – so y

Smd imagery - A Textpattern CMS plugin for managing images in the Write panel.

smd_imagery Insert images into your Write panel. Very handy for people who run photoblog or image-heavy sites, or those who categorise images for incl

Zem contact reborn - An extensible HTML form mailer plugin for Textpattern CMS.

com_connect Contents Introduction Installing and upgrading Migrating from zem_contact_reborn Usage Tags com_connect tag com_connect_text tag com_conne

Comments
  • Youtube URLs for playlists not working on v1.3.1 (worked on v1.2.1)

    Youtube URLs for playlists not working on v1.3.1 (worked on v1.2.1)

    On oui_player v1.2.1 I was able to pass it an URL for a YouTube playlist, like this one:

    https://www.youtube.com/watch?v=k3qgrSon4To&list=PLgkSUkbS9MLs9LSkGlRAJA-dbiaHpycqq

    and oui_player will do its magic and output the proper "player" code (ie. the iframe).

    Now I've upgraded to v1.3.1 and the plugin isn't outputting any code at all. I didn't have time to debug it properly (so I could get a quick patch to apply) but it seems it all boils down to this line. oui_player is not extracting the id properly.

    $id = preg_match('/([.][a-z]+\/)/', $this->play) ? $this->getInfos()['id'] : $this->play;]

    bug enhancement Fixed (dev branch) 
    opened by maniqui 6
  • "Fatal error: Maximum execution time" when a few "Display [provider] preferences" are enabled

    I'm still tracking this down. I'm getting a:

    Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/xxxxxxx/public/textpattern/lib/txplib_misc.php on line 1902
    

    when I activate a few preferences (Soundcloud, Mixcloud, Vimeo, Youtube). I'm not sure if it's related to the amount of DB fields it has to fetch for the whole Preferences screen or if it's related to some of the oui_player preferences. I think it might be an issue with Soundcloud/Mixcloud preferences, although I've to prove that yet.

    bug 
    opened by maniqui 5
  • JS script for Vine is included even when not embedding Vine posts

    JS script for Vine is included even when not embedding Vine posts

    I've noticed that just before the closing </body>', the Vine script (https://platform.vine.co/static/scripts/embed.js`) was being injected on every page I'm using oui_player, even if I'm not embedding Vine content.

    To avoid this, I've changed the corresponding properties from protected to private, both in class Provider and on extending class Vine.

    Not sure if this is the correct solution and if it will work when embedding Vine content, but at least for me, it stopped injecting the script.

    bug Fixed (dev branch) 
    opened by maniqui 2
  • Undefined `$height` and `$ratio` variables

    Undefined `$height` and `$ratio` variables

    Config.

    • Txp v4.7.1;
    • oui_player v2.0.0-BETA3;
    • oui_provider v1.0.0-BETA4;
    • extensions:
      • oui_audio version: v1.0.0-BETA4

    Issue

    While players are correctly rendered Textpattern complains about both $height and $ratio undefined variables when the only extension plugged is oui_audio.

    bug 
    opened by NicolasGraph 0
Releases(2.0.0-BETA3)
Owner
Nicolas Morand
@drupal/@symfony developer @maetva
Nicolas Morand
Oui instagram - Instagram user infos and recent images embedding plugin for @textpattern

oui_instagram Easily display Instagram recent images galleries. Plugin requirements required: Textpattern CMS 4.6+. recommended: aks_cache or any part

Nicolas Morand 4 Feb 20, 2020
Oui embed - (o)Embed plugin for @Textpattern

oui_embed Embed everything… Get information from any web page (using oembed, opengraph, twitter-cards, scrapping the html, etc). It’s compatible with

Nicolas Morand 2 Jun 21, 2018
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Simple configurable plugin to see all commands executed by players

About [FR] Simple plugin configurable permettant de voir toutes les commandes exécutées par les joueurs [ENG] Simple configurable plugin to see all co

leo 1 Feb 4, 2022
Textpattern-for-Panic-Coda - A Textpattern CMS mode for Panic Coda

Textpattern elements for Panic Coda 2 Handy elements for use with Panic Coda 2 on a Mac when authoring files for the Textpattern CMS. This repository

Phil Wareham 8 Jun 26, 2017
This is a plugin for pocketmine-mp, when locking a player's items helps players not to lose items or throw things around causing server lag.

[] LockedItem| v1.0.0 Player's item lock Features Player's item lock Players aren't afraid of losing items For Devolopers You can access to LockedItem

JeroGamingYT 3 Jan 4, 2022
Textpattern-installer - Textpattern plugin and theme installer for Composer

Textpattern Installer for Composer Package directory | Issues Install plugins and themes to Textpattern CMS with Composer. $ composer require rah/rah_

Jukka Svahn 7 Apr 14, 2022
An advanced plugin to manage events when the player enters the server!

⭐ • Better Join Version Status Date 1.0.0 stable-dev 12/10/2022 ?? • General: Plugin Introduction: This is an advanced player input management plugin

HenryDM 3 Nov 2, 2022
Cbe frontauth - A Textpattern plugin to manage backend connections from frontend and protect content from non-logged users

cbe_frontauth This client-side plugin lets your users (or you) manage backend connection from frontend, i.e. connect and disconnect as they (you) woul

null 4 Jan 31, 2020
MassPlugCompiler - Textpattern CMS plugin compiler

mtxpc mtxpc compiles Textpattern CMS plugin sources into installer packages. Supports multi-file structure and a JSON manifest file. Install Using Com

Jukka Svahn 5 Apr 15, 2022