"Download":https://github.com/NicolasGraph/oui_audio/releases the compiled plugin file or the source to compile a customized file.

August 15, 2018 · View on GitHub

h1. oui_audio

  • "Introduction":#introduction
  • "Plugin management":#plugin-management
  • "Tags and parameters":#tags-and-parameters
  • "Examples":#examples
  • "Credits":#credits

h2. Introduction

"oui_audio":https://github.com/NicolasGraph/oui_audio is a "oui_player":https://github.com/NicolasGraph/oui_player v2+ extension to easily embed "HTML video":https://video.com/ provided videos in "Textpattern":https://textpattern.com/ powered websites.

h3. Plugin requirements

oui_audio's minimum requirements:

h2. Plugin management

h3. Installation

h4. From the admin interface

"Download":https://github.com/NicolasGraph/oui_audio/releases 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 and click the Options link (or visit the Preferences tab) to set the provider preferences.

h4. Via Composer (not available yet)

After "installing Composer":https://getcomposer.org/doc/00-intro.md…

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@, where @4.6.2@ is the Txp version in use.

Install oui_audio:

@$ composer require nicolasgraph/oui_audio@

h3. Update

h4. From the admin interface

Follow the installation instruction above.

h4. Via Composer (not available yet)

bc. $ composer update nicolasgraph/oui_audio

h3. Uninstall

h4. From the admin interface

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.

h4. Via Composer (not available yet)

bc. $ composer remove nicolasgraph/oui_audio

h2. Tags and parameters

h3. oui_audio vs oui_player

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

Check the "oui_player":https://github.com/NicolasGraph/oui_player documentation for more informations.

h4. Recognised values for the @play@ attribute

  • comma separated list of File ID's;
  • comma separated list of filenames using one of the following extension: @.mp3@, @.ogg@, @.oga@, @.wav@, @aac@ or @.flac@;
  • comma separated list of URL's using one of the following extensions: @.mp3@, @.ogg@, @.oga@, @.wav@, @aac@ or @.flac@.

When using the @<txp:oui_player />@ tag (vs @<txp:oui_audio />@), 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.

h4. Player customization

h5. 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.

h5. Size

  • @width@ := Integer; initially not set; The width of the player in pixels. =:
  • @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. =:

h5. 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 @1@. Enables the automatic playing if set to @1@. =:
  • @controlse@ := @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@ or @auto@; initially set to @auto@. Specifies the way the browser load the media. =:
  • @volume@ := @0@ or @1@; initially not set. Set the sound volume. =:

h3. oui_if_audio vs oui_if_player

p. 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_audio…</txp:oui_if_audio>@ tag is a shortcut to check an URL against HTML audio related URL schemes only. It is strictly equivalent to @<txp:oui_if_player provider="audio">…</txp:oui_if_player>@.

Check the "oui_player":https://github.com/NicolasGraph/oui_player documentation for more informations.

h2. Examples

h3. Embed a player using the preference values

bc(language-markup). <txp:oui_player />

"oui_player":https://github.com/NicolasGraph/oui_player preference related field value: @https://www.w3schools.com/html/horse.ogg, https://www.w3schools.com/html/horse.mp3@.

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

bc(language-markup). <txp:oui_player provider="audio" play="3" />

…or:

bc(language-markup). <txp:oui_audio play="3" />

h3. Conditionally embed a player using attributes

bc(language-markup).. <txp:oui_if_player provider="audio" play="horse.ogg"> <txp:oui_player /> </txp:oui_if_player>

p. …or:

bc(language-markup).. <txp:oui_if_audio play="horse.ogg"> <txp:oui_audio /> </txp:oui_if_audio>

h2. Credits

h3. Author

"Nicolas Morand":https://twitter.com/NicolasGraph Thank you to the Textpattern community and the core team.

h3. License

This plugin is distributed under "GPL v2.0":https://www.gnu.org/licenses/gpl-2.0.txt.

oui_audio version 1.0.0-BETA4, Copyright (C) 2018 Nicolas Morand This Textpattern plugin comes with ABSOLUTELY "NO WARRANTY":https://www.gnu.org/licenses/gpl-2.0.html#section11. This is free software, and you are welcome to redistribute it "under certain conditions":https://www.gnu.org/licenses/gpl-2.0.html#SEC3.

h3. Changelog

  • oui_audio v1.0.0-BETA4 (2018-08-15) ** Added: MIME types managements; ** added: player width management; ** added: @.aac@ and @.flac@ support; ** changed: does not try to play non existing files (triggers errors).
  • oui_player v1.3.0 (2017-05-24)