Skip to content

Commit

Permalink
Merge pull request #8 from NicolasGraph/v2
Browse files Browse the repository at this point in the history
v2.0.0-BETA1
  • Loading branch information
Nicolas Morand committed Jun 26, 2018
2 parents 3a76acd + e3ee8f9 commit 5dcd2f8
Show file tree
Hide file tree
Showing 61 changed files with 1,491 additions and 4,322 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.DS_Store
test/
300 changes: 278 additions & 22 deletions LICENSE

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions README.md

This file was deleted.

290 changes: 290 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
h1. oui_player

h2. Introduction

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

p(alert-block information). %(ui-icon ui-icon-info).% This plugin does not use oembed, it builds iframe embedding codes and HTML5 players by its own without any external request for better performances.

h3. Supported extensions

As known at the last plugin release…

* "Abc News":http://abcnews.go.com/video: "oui_abcnews":https://github.com/NicolasGraph/oui_abcnews;
* "Archive":https://archive.org/: "oui_archive":https://github.com/NicolasGraph/oui_archive;
* "Bandcamp":https://bandcamp.com/: "oui_bandcamp":https://github.com/NicolasGraph/oui_bandcamp;
* "Dailymotion":http://www.dailymotion.com/: "oui_dailymotion":https://github.com/NicolasGraph/oui_dailymotion;
* "Giphy":https://giphy.com/: "oui_giphy":https://github.com/NicolasGraph/oui_giphy;
* "HTML5 audio":https://developer.mozilla.org/docs/Web/HTML/Element/audio: "oui_audio":https://github.com/NicolasGraph/oui_audio;
* "HTML5 video":https://developer.mozilla.org/docs/Web/HTML/Element/video: "oui_video":https://github.com/NicolasGraph/oui_video;
* "Mixcloud":https://www.mixcloud.com/: "oui_mixcloud":https://github.com/NicolasGraph/oui_mixcloud;
* "Myspace videos":https://myspace.com/myspace/videos: "oui_myspace":https://github.com/NicolasGraph/oui_myspace;
* "Soundcloud":https://soundcloud.com/: "oui_soundcloud":https://github.com/NicolasGraph/oui_soundcloud;
* "Twitch":https://www.twitch.tv/: "oui_twitch":https://github.com/NicolasGraph/oui_twitch;
* "Viddsee":https://www.viddsee.com/: "oui_viddsee":https://github.com/NicolasGraph/oui_viddsee;
* "Vimeo":http://www.vimeo.com/: "oui_vimeo":https://github.com/NicolasGraph/oui_vimeo;
* "Vine":http://vine.co/: "oui_vine":https://github.com/NicolasGraph/oui_vine;
* "Youtube":https://www.youtube.com/: "oui_youtube":https://github.com/NicolasGraph/oui_youtube.

h3. Plugin requirements

oui_player's minimum requirements:

* "Textpattern CMS":http://textpattern.com/ 4.6+;
* "oui_provider":https://github.com/NicolasGraph/oui_provider v1+;
* Any of the above provider related extension.

h2. Plugin management

h3. Installation

h4. From the admin interface

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

# "Download":https://github.com/NicolasGraph/oui_player/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.

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.

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

h3. Update

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

h4. Via Composer (not available yet)

bc. $ composer update nicolasgraph/oui_player

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_player

h2. Preferences/options

Plugin prefs can be set under the "Admin > Preferences":?event=prefs#prefs_group_oui_player tab and are mainly used as default values for the @<txp:oui_player />@ tag attributes.

h3. Global prefs

- @Field used by default@ :=
Defines a field to use as the default @play@ attribute value.
%(warning)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@, @excerpt@ 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 =:
- @Render responsive player@ :=
*Default:* no
*valid:* yes or no =:
- @Display the provider player preferences@ :=
Displays the defined provider prefs as a goup of prefs.
*Default:* yes
*valid:* yes or no =:

h3. Providers prefs

While %(information)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), %(information)these used as global settings should preferrably be set through the plugin preferences% to %(warning)avoid a massive use of tag attributes%.

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

h2. Tags

h3. oui_player

Embeds a player.

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

h4. Presentational attributes

- @label@ :=
String; none by default.
Label for the video. =:
- @labeltag@ :=
HTML container tag name; none by default.
HTML wraptag for the label, without brackets. =:
- @wraptag@ :=
HTML container tag name; none by default.
HTML tag to be used as the content wraptag, without brackets. =:
- @class@ :=
String; none 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. =:

h4. 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:* %(information)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. =:

h4. Providers related tag attributes

See the related link in the table of contents.

h3. oui_if_player

Checks the @play@ attribute value againsts defined URL schemes.

bc(language-markup). <txp:oui_if_player>
[…]
</txp:oui_if_player>

h4. 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; none by default.
Check the URL against valid URL schemes of the defined provider. =:

h2. Examples

h3. Display a player from the default values collected via plugin prefs

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

h3. Display a player from a manually filled URL

bc(language-markup). <txp:oui_player play="https://vimeo.com/155020267" />

…or, maybe a bit faster…

bc(language-markup). <txp:oui_player provider="vimeo" play="https://vimeo.com/155020267" />

h3. Display a player from manually filled ID

Using the favourite provider set in the prefs.

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

…or, in conjonction with the @provider@ attribute…

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

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

With the default values collected via plugin prefs…

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

p. …or, with a manually filled URL…

bc(language-markup).. <txp:oui_if_player play="https://vimeo.com/155020267">
<txp:oui_player />
</txp:oui_if_player>

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

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_player version 2, 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

* *v2.0.0-BETA1* (2018-06-26)
** changed: providers now work as pluggable extensions:
*** Provider base (required): "oui_provider":https://github.com/NicolasGraph/;
*** ABC News: "oui_abcnews":https://github.com/NicolasGraph/oui_abcnews;
*** Archive: "oui_archive":https://github.com/NicolasGraph/oui_archive;
*** Bandcamp: "oui_bandcamp":https://github.com/NicolasGraph/oui_bandcamp;
*** Dailymotion: "oui_bandcamp":https://github.com/NicolasGraph/oui_dailymotion;
*** Giphy: "oui_giphy":https://github.com/NicolasGraph/oui_giphy (new);
*** Mixcloud: "oui_mixcloud":https://github.com/NicolasGraph/oui_mixcloud;
*** MySpace: "oui_myspace":https://github.com/NicolasGraph/oui_myspace;
*** HTML: "oui_html":https://github.com/NicolasGraph/oui_html;
*** Soundcloud: "oui_soundcloud":https://github.com/NicolasGraph/oui_soundcloud;
*** Twitch: "oui_twitch":https://github.com/NicolasGraph/oui_twitch;
*** Viddsee: "oui_viddsee":https://github.com/NicolasGraph/oui_viddsee;
*** Vimeo: "oui_vimeo":https://github.com/NicolasGraph/oui_vimeo;
*** Vine: "oui_vine":https://github.com/NicolasGraph/oui_vine;
*** Youtube: "oui_youtube":https://github.com/NicolasGraph/oui_youtube;
** added: responsive embedding;
** changed: providers related preferences displayed by default.
* *v1.3.1* (2017-07-13)
* *v1.3.0* (2017-05-24)
** Adds "Composer":https://getcomposer.org/ support for "textpattern/installer":https://packagist.org/packages/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:
*** "Bandcamp":https://bandcamp.com/;
*** HTML5 "audio":https://developer.mozilla.org/fr/docs/Web/HTML/Element/Audio + "video":https://developer.mozilla.org/fr/docs/Web/HTML/Element/Video;
* *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:
*** "Twitch channels":https://www.twitch.tv/,
*** "Vine":https://vine.co/;
** 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:
*** "Abc News":http://abcnews.go.com/video,
*** "Archive":https://archive.org/,
*** "Mixcloud":https://www.mixcloud.com/,
*** "Myspace videos":https://myspace.com/myspace/videos,
*** "Soundcloud":https://soundcloud.com/,
*** "Twitch":https://www.twitch.tv/,
*** "Viddsee":https://www.viddsee.com/;
** (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":http://andy-carter.com/txp/arc_youtube and "arc_vimeo":http://andy-carter.com/txp/arc_vimeo by "Andy Carter":http://andy-carter.com.
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oui/oui_player",
"description": "Configurable players embedding plugin for Textpattern CMS",
"name": "nicolasgraph/oui_player",
"description": "Manage configurable media players in Textpattern CMS",
"keywords": [
"textpattern",
"plugin",
Expand All @@ -11,6 +11,8 @@
"archive",
"bandcamp",
"dailymotion",
"giphy",
"html5",
"mixcloud",
"myspace",
"soundcloud",
Expand All @@ -21,7 +23,7 @@
"youtube"
],
"homepage": "https://github.com/NicolasGraph/oui_player",
"license": "MIT",
"license": "GPL-2.0-only",
"type": "textpattern-plugin",
"authors": [
{
Expand All @@ -35,7 +37,8 @@
"source": "https://github.com/NicolasGraph/oui_player"
},
"require": {
"textpattern/lock": "4.6.*",
"textpattern/lock": "^4.6",
"textpattern/installer": "*"
}
},
"minimum-stability": "beta"
}
Loading

0 comments on commit 5dcd2f8

Please sign in to comment.