diff --git a/.DS_Store b/.DS_Store index 2952156..74595ac 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 20c4be9..e43b0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ .DS_Store -test/ diff --git a/LICENSE b/LICENSE index 1fad608..4619a0f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,22 +1,278 @@ -MIT License - -Copyright (c) 2016 Nicolas Morand aka @NicolasGraph -Inspired by arc_youtube and arc_vimeo by Andy Carter aka @drmonkeyninja. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/README.md b/README.md deleted file mode 100644 index eb8cf2a..0000000 --- a/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# oui_player (formerly oui_video) - -An extendable plugin to easily display HTML5 players or embed customized iframe players in [Textpattern CMS](http://www.textpatern.com). -This plugin does not use oembed, it builds iframe embedding codes by its own without any external request. - -## Supported providers - -* [Abc News](http://abcnews.go.com/video); -* [Archive](https://archive.org/); -* [Bandcamp](https://bandcamp.com/); -* [Dailymotion](http://www.dailymotion.com/); -* [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/); -* [Vimeo](http://www.vimeo.com/); -* [Vine](http://vine.co/); -* [Youtube](https://www.youtube.com/). - -## Plugin requirements - -oui_player's minimum requirements: - -* [Textpattern CMS](http://textpattern.com/) 4.6+. - -## Customization (advanced users) - -This plugin can be customized by excluding/adding providers via the _manifest.json_ file. Then it can be installed via [Composer](https://getcomposer.org) or compiled via this [MassPlugCompiler fork](https://github.com/NicolasGraph/MassPlugCompiler). - -## Installation - -### From the admin interface - -1. [Download](https://github.com/NicolasGraph/oui_player/releases) 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 _Options_ or visit your *Admin > Preferences* tab to fill the plugin prefs. - -### Via Composer - -After [installing Composer](https://getcomposer.org/doc/00-intro.md)… - -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 oui/oui_player` -4. Connect to the Txp admin interface and click _Options_ or visit your *Admin > Preferences* tab to fill the plugin prefs. - -## Author - -[Nicolas Morand](https://twitter.com/NicolasGraph), 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). -*Thank you to the Textpattern community and the core team.* - -## License - -This plugin is distributed under the [MIT licence](https://opensource.org/licenses/MIT). - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.textile b/README.textile new file mode 100644 index 0000000..3d241ab --- /dev/null +++ b/README.textile @@ -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 @@ 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). + +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 @@ 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). +[…] + + +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). + +h3. Display a player from a manually filled URL + +bc(language-markup). + +…or, maybe a bit faster… + +bc(language-markup). + +h3. Display a player from manually filled ID + +Using the favourite provider set in the prefs. + +bc(language-markup). + +…or, in conjonction with the @provider@ attribute… + +bc(language-markup). + +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).. + + + +p. …or, with a manually filled URL… + +bc(language-markup).. + + + +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. diff --git a/composer.json b/composer.json index 7cc182d..d3ff22f 100644 --- a/composer.json +++ b/composer.json @@ -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", @@ -11,6 +11,8 @@ "archive", "bandcamp", "dailymotion", + "giphy", + "html5", "mixcloud", "myspace", "soundcloud", @@ -21,7 +23,7 @@ "youtube" ], "homepage": "https://github.com/NicolasGraph/oui_player", - "license": "MIT", + "license": "GPL-2.0-only", "type": "textpattern-plugin", "authors": [ { @@ -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" } diff --git a/docs/main/Basics.textile b/docs/main/Basics.textile deleted file mode 100644 index 940fd2e..0000000 --- a/docs/main/Basics.textile +++ /dev/null @@ -1,79 +0,0 @@ -notextile.
- -h2. Basics - -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 providers - -In addition to the HTML5 @
diff --git a/docs/main/Credits.textile b/docs/main/Credits.textile deleted file mode 100644 index e4468e1..0000000 --- a/docs/main/Credits.textile +++ /dev/null @@ -1,53 +0,0 @@ -notextile.
- -h2. Author - -"Nicolas Morand":https://twitter.com/NicolasGraph, 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. -_Thank you to the Textpattern community and the core team._ - -h2. License - -This plugin is distributed under the "MIT licence":https://opensource.org/licenses/MIT. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -h2. Changelog - -* *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; -** adds Youtube player parameters @enablejsapi@ and @origin@; -** adds Dailymotion player parameters @api@ and @origin@; -** adds Vimeo player parameter @api@ and removes @badge@; -** adds 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) -** Fixes the _Field used by default_ pref display when no custom field exists; -** fixes Textpack typo; -** lighten compiled code by removing license related comments; -* *v1.2.0* (2016-12-12) -** sets the custom field plugin pref as the defaut value of the conditional tag @play@ attribute; -** introduces a @play@ attribute value inheritance in a conditional/container tag context; -** adds support for: -*** "Twitch channels":https://www.twitch.tv/, -*** "Vine":https://vine.co/; -** improves PHP classes and methods use (see _For developers_). -* *oui_player v1.1.0* (2016-10-14) -** changes plugin/tag names; -** drops Txp 4.5 support; -** Sets closer attribute names to player parameters for consistency; -** reworks source code to be easily extendable; -** adds 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/; -** improves and styles help file. -* *oui_video v0.1.0* (2016-09-13) - -notextile.
diff --git a/docs/main/Dev.textile b/docs/main/Dev.textile deleted file mode 100644 index 427e592..0000000 --- a/docs/main/Dev.textile +++ /dev/null @@ -1,37 +0,0 @@ -notextile.
- -h2. For Developpers - -h3. Using plugin classes and methods - -This plugin allow developers to easily embed configurable players directly via PHP. -For more informations, these two main plugin classes should be considered: @Oui\Player\Main@ and @Oui\Player\Provider@. - -h3. Txp tags use vs PHP examples - -h4. Display a player if the provided URL is recognised as a provider URL scheme - -bc(language-markup).. - - - -p. This can be achieve with the following PHP code. - -bc(language-php).. $obj = Oui\Player\Main::getInstance("https://vimeo.com/186406583"); - -echo $obj->isValid ? $obj->getPlayer() : 'Nothing to see here.'; - -h4. Display a Vimeo customized player - -bc(language-markup).. - -p. The tag above can be replaced by the few following lines of PHP. - -bc(language-php). echo Oui\Player\Vimeo::getInstance("186406583", array('width' => '480', 'autoplay' => '1'))->getPlayer(); - -h3. Extending - -This plugin was designed to make it easily extendable. -For more informations, take a look at the @Oui\Player\Provider@ class which is the parent class of each provider class. - -notextile.
diff --git a/docs/main/Examples.textile b/docs/main/Examples.textile deleted file mode 100644 index ba49256..0000000 --- a/docs/main/Examples.textile +++ /dev/null @@ -1,43 +0,0 @@ -notextile.
- -h2. Examples - -h3. Display a player from the default values collected via plugin prefs - -bc(language-markup). - -h3. Display a player from a manually filled URL - -bc(language-markup). - -…or, maybe a bit faster… - -bc(language-markup). - -h3. Display a player from manually filled ID - -Using the favourite provider set in the prefs. - -bc(language-markup). - -…or, in conjonction with the @provider@ attribute… - -bc(language-markup). - -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).. - - - -p. …or, with a manually filled URL… - -bc(language-markup).. - - - -p. You can also add the provider attribute to check the URL against URL schemes of a defined provider. - -notextile.
diff --git a/docs/main/Header.textile b/docs/main/Header.textile deleted file mode 100644 index 716394e..0000000 --- a/docs/main/Header.textile +++ /dev/null @@ -1,5 +0,0 @@ -notextile.
- -h1(txp-heading). oui_player (formerly oui_video) - -notextile.
diff --git a/docs/main/Menu.textile b/docs/main/Menu.textile deleted file mode 100644 index c8ae719..0000000 --- a/docs/main/Menu.textile +++ /dev/null @@ -1,34 +0,0 @@ -notextile.
-
- -h3(#all_options-label). Table of contents - -notextile.
- -*(switcher-list) "Presentation/management":#basics -* "Preferences/options":#prefs -* "Tags basics":#tags -* "ABC News player config":#abc -* "Archive player config":#archive -* "Bandcamp player config":#bandcamp -* "Dailymotion player config":#dailymotion -* "HTML audio player config":#audio -* "HTML video player config":#video -* "Mixcloud player config":#mixcloud -* "Myspace videos player config":#myspace -* "Soundcloud player config":#soundcloud -* "Twitch player config":#twitch -* "Viddsee player config":#viddsee -* "Vimeo player config":#vimeo -* "Vine player config":#vine -* "Youtube player config":#youtube -* "Examples":#examples -* "For developpers":#for-developers -* "Credits/changelog":#credits - -notextile.
-
- -"(navlink)Contribute":https://github.com/NicolasGraph/oui_player "(navlink)Donate":https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PREHX3MZMXEUN "(navlink)Tweet":https://twitter.com/intent/tweet?text=I%27m%20enjoying%20video%20embedding%20in%20%23Textpattern%20%23CMS%20via%20%23oui_player!%20%40NicolasGraph%20https://github.com/NicolasGraph/oui_player - -notextile.
diff --git a/docs/main/Prefs.textile b/docs/main/Prefs.textile deleted file mode 100644 index b0b7292..0000000 --- a/docs/main/Prefs.textile +++ /dev/null @@ -1,29 +0,0 @@ -notextile.
- -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 @@ 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 =: -- @Display the provider player prefs@ := -Displays the defined provider prefs as a goup of prefs. -*Default:* no -*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. - -notextile.
diff --git a/docs/main/Tags.textile b/docs/main/Tags.textile deleted file mode 100644 index a0f2140..0000000 --- a/docs/main/Tags.textile +++ /dev/null @@ -1,64 +0,0 @@ -notextile.
- -h2. Tags - -h3. oui_player - -Embeds a video in the page using an iframe. - -bc. - -h4. Presentational attributes - -- @label@ := -Label for the video. -*default:* none -*valid:* string =: -- @labeltag@ := -HTML wraptag for the label, without brackets. -*default:* none -*valid:* HTML container tag =: -- @wraptag@ := -HTML tag to be used as the content wraptag, without brackets. -*default:* none -*valid:* HTML container tag =: -- @class@ := -CSS class for HTML content wraptag. -*default:* none -*valid:* string =: - -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@ := -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 @@ container tag, or the custom field value of the one selected in the plugin prefs. -*valid:* URL, id or custom field name =: -- @provider@ := -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. -*default:* plugin pref -*valid:* a defined provider - -h4. Providers related tag attributes - -See the related link in the table of contents. - -h3. oui_if_player - -In addition to oui_player this plugin also comes with oui_if_player, a conditional tag for checking if the video URL is a valid one. - -bc. -[…] - - -h4. Attributes - -- @play@ := -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:* The custom field value of the one selected in the plugin prefs. =: -- @provider@ := -Check the URL against valid URL schemes of the provided provider. -*Default:* none =: - -notextile.
diff --git a/docs/misc/_bottom.textile b/docs/misc/_bottom.textile deleted file mode 100644 index 3dd465c..0000000 --- a/docs/misc/_bottom.textile +++ /dev/null @@ -1 +0,0 @@ -notextile. diff --git a/docs/misc/_scripts.textile b/docs/misc/_scripts.textile deleted file mode 100644 index b808978..0000000 --- a/docs/misc/_scripts.textile +++ /dev/null @@ -1,8 +0,0 @@ -notextile. diff --git a/docs/misc/_styles.textile b/docs/misc/_styles.textile deleted file mode 100644 index ddaafd4..0000000 --- a/docs/misc/_styles.textile +++ /dev/null @@ -1,3 +0,0 @@ -notextile. diff --git a/docs/misc/_text_bottom.textile b/docs/misc/_text_bottom.textile deleted file mode 100644 index 3dd465c..0000000 --- a/docs/misc/_text_bottom.textile +++ /dev/null @@ -1 +0,0 @@ -notextile. diff --git a/docs/misc/_text_top.textile b/docs/misc/_text_top.textile deleted file mode 100644 index 1995f27..0000000 --- a/docs/misc/_text_top.textile +++ /dev/null @@ -1 +0,0 @@ -notextile.
diff --git a/docs/misc/_top.textile b/docs/misc/_top.textile deleted file mode 100644 index e8636be..0000000 --- a/docs/misc/_top.textile +++ /dev/null @@ -1 +0,0 @@ -notextile.
diff --git a/docs/providers/Abcnews.textile b/docs/providers/Abcnews.textile deleted file mode 100644 index af6a6ec..0000000 --- a/docs/providers/Abcnews.textile +++ /dev/null @@ -1,29 +0,0 @@ -notextile.
- -h2. Abc News player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @abcnews@ as provider.) -* http(s)://abcnews.go.com/…/video/…[*ID*] -* http(s)://abcnews.go.com/video/embed?id=[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -notextile.
diff --git a/docs/providers/Archive.textile b/docs/providers/Archive.textile deleted file mode 100644 index c3bb7cc..0000000 --- a/docs/providers/Archive.textile +++ /dev/null @@ -1,49 +0,0 @@ -notextile.
- -h2. Archive player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @archive@ as provider.) -* http(s):(www.)//archive.org/details/[*ID*] -* http(s):(www.)//archive.org/embed/[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ (use @500@ for a music player) -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* @480@ (use @30@ for a music player) -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* none -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @autoplay@ := -Specifies whether the initial video will automatically start to play when the player loads. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @playlist@ := -Specifies whether to display the next titles if the item to play is a playlist. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @poster@ := -Specifies the URL of an image to display as the starting shot. -*Default:* related plugin pref -*Initial:* none -*valid:* image URL =: - -p(alert-block information). %(ui-icon ui-icon-info).% More informations on "this Archive webpage":https://archive.org/help/video.php. - -notextile.
diff --git a/docs/providers/Audio.textile b/docs/providers/Audio.textile deleted file mode 100644 index 9eed477..0000000 --- a/docs/providers/Audio.textile +++ /dev/null @@ -1,51 +0,0 @@ -notextile.
- -h2. HTML audio player config - -h3. Recognised values for the @play@ attribute - -* comma separated list of *File ID's* (using @audio@ as provider.) -* comma separated list of *filenames* using one of the following extension: @.mp3@, @.ogg@, @.oga@ or @.wav@ -* comma separated list of *URL's* using one of the following extensions: @.mp3@, @.ogg@, @.oga@ or @.wav@ - -h3. Player parameters (aplhabetical order) - -- @autoplay@ := -Enables the automatic playing if set to @1@. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @controlse@ := -Displays the player controls. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @loop@ := -Reads the video over and over. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @muted@ := -Disables the sound if set to @1@. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @poster@ := -Specifies a start shot URL. -*Default:* related plugin pref -*Initial:* none -*valid:* URL =: -- @preload@ := -Specifies the way the browser load the media. -*Default:* related plugin pref -*Initial:* @auto@ -*valid:* @none@, @metadata@, @auto@ =: -- @volume@ := -Set the sound volume. -*Default:* related plugin pref -*Initial:* none -*valid:* @0@ to @1@ =: - -p(alert-block information). %(ui-icon ui-icon-info).% More informations on "this MDN webpage":https://developer.mozilla.org/fr/docs/Web/HTML/Element/Audio. - -notextile.
diff --git a/docs/providers/Bandcamp.textile b/docs/providers/Bandcamp.textile deleted file mode 100644 index 3574b84..0000000 --- a/docs/providers/Bandcamp.textile +++ /dev/null @@ -1,62 +0,0 @@ -notextile.
- -h2. Bandcamp player config - -h3. Recognised values for the @play@ attribute - -* album=[*ID*] (using @bandcamp@ as provider.) -* track=[*ID*] (using @bandcamp@ as provider.) -* album=[*ID*]/track=[*ID*] (using @bandcamp@ as provider.) -* http(s)://bandcamp.com/(EmbeddedPlayer/)album=[*ID*] -* http(s)://bandcamp.com/(EmbeddedPlayer/)track=[*ID*] -* http(s)://bandcamp.com/(EmbeddedPlayer/)album=[*ID*]/(…/)track=[*ID*] - -h3. Player size - -- @width@ := -The width of the player. -*Default:* related plugin pref -*Initial:* @350px@ -*valid:* @@ =: -- @height@ := -The height of the player. -*Default:* related plugin pref -*Initial:* @350px@ -*valid:* @@ =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* none -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @artwork@ := -Defines the artwork size. -*Default:* related plugin pref -*Initial:* @big@ -*valid:* @big@ or @small@ =: -- @bgcol@ := -Background color. -*Default:* related plugin pref -*Initial:* @#ffffff@ -*valid:* hexadecimal color value =: -- @linkcol@ := -Links colors. -*Default:* related plugin pref -*Initial:* @#0687f5@ -*valid:* hexadecimal color value =: -- @tracklist@ := -Displays the tracklist. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @size@ := -Defines the player size type; recommended width and height values are: -* @big@: @350px@ × @470px@ (without the tracklist) -* @small@: @100%@ × @120px@ (or @42px@ for a slim player) -*Default:* related plugin pref -*Initial:* none -*valid:* @big@ or @small@ =: - -notextile.
diff --git a/docs/providers/Dailymotion.textile b/docs/providers/Dailymotion.textile deleted file mode 100644 index f657a5d..0000000 --- a/docs/providers/Dailymotion.textile +++ /dev/null @@ -1,110 +0,0 @@ -notextile.
- -h2. Dailymotion player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @bandcamp@ as provider.) -* http(s)://dai.ly/[*ID*] -* http(s)://www.dailymotion.com/video/[*ID*]… -* http(s)://www.dailymotion.com/embed/video/[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @api@ := -Enables or disables "the javascript player api":https://developer.dailymotion.com/player#player-api. -*Default:* related plugin pref -*Initial:* @false@ -*valid:* @false@, @postMessage@, @location@, @1@ =: -- @autoplay@ := -Starts the playback of the video automatically after the player load. -This parameter may not work on some mobile OS. -*Default:* related plugin pref -*Initial:* @false@ -*valid:* @true@ or @false@ =: -- @controls@ := -Whether to display the player controls or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @endscreen_enable@ := -Whether to enable the end screen or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @mute@ := -Whether to mute the video or not. -*Default:* related plugin pref -*Initial:* @false@ -*valid:* @true@ or @false@ =: -- @origin@ := -The domain of the page hosting the Dailymotion player. -When using @api="postMessage"@, you might want to specify origin for extra security. -*Default:* related plugin pref -*Initial:* none -*valid:* URL =: -- @quality@ := -Set the suggested playback quality for the video. -*Default:* related plugin pref -*Initial:* @auto@ -*valid:* @240@, @380@, @480@, @720@, @1080@, @1440@ or @2160@ =: -- @sharing_enable@ := -Whether to display the sharing button or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @start@ := -Specifies the time (in seconds) from which the video should start playing. -*Default:* related plugin pref -*Initial:* none -*valid:* an integer =: -- @subtitles_default@ := -Specifies the default selected subtitles language. -*Default:* related plugin pref -*Initial:* none =: -- @syndication@ := -Passes your syndication key to the player. -*Default:* related plugin pref -*Initial:* none =: -- @ui_highlight@ := -Changes the default colour used in the controls. -*Default:* related plugin pref -*Initial:* @ffcc33@ -*valid:* a hexa color value =: -- @ui_logo@ := -Whether to display the Dailymotion logo or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @ui_start_screen_info@ := -Whether to show video information on the start screen or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @ui_theme@ := -Choose the default base colour theme. -*Default:* related plugin pref -*Initial:* @dark@ -*valid:* @dark@ or @light@ =: - -p(alert-block information). %(ui-icon ui-icon-info).% Some prefs/attributes may be deprecated for HTML5 players or overriden by the provider depending on several conditions. More informations on "this Dailymotion webpage":https://developer.dailymotion.com/player#player-parameters. - -notextile.
diff --git a/docs/providers/Mixcloud.textile b/docs/providers/Mixcloud.textile deleted file mode 100644 index 3a43984..0000000 --- a/docs/providers/Mixcloud.textile +++ /dev/null @@ -1,55 +0,0 @@ -notextile.
- -h2. Mixcloud player config - -h3. Recognised values for the @play@ attribute - -* http(s)://(www.)mixcloud.com/… - -h3. Player size - -- @width@ := -The width of the player in pixels (OK, pourcentage works also…). -*Default:* related plugin pref -*Initial:* @100%@ -*Valid:* integer =: -- @height@ := -The height of the player in pixels. -*Default:* related plugin pref -*Initial:* @400@ (alt native heights are @120@ and @60@) -*Valid:* integer =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* none -*Valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @autoplay@ := -Whether to play after loading or not. -*Default:* related plugin pref -*Initial:* @0@ -*Valid:* @0@ or @1@ =: -- @light@ := -Enables the light theme. -*Default:* related plugin pref -*Initial:* @0@ -*Valid:* @0@ or @1@ =: -- @hide_artwork@ := -Hides the background image. -*Default:* related plugin pref -*Initial:* @0@ -*Valid:* @0@ or @1@ =: -- @hide_cover@ := -Hides the cover. -*Default:* related plugin pref -*Initial:* @0@ -*Valid:* @0@ or @1@ =: -- @mini@ := -Uses the _mini_ player config. -*Default:* related plugin pref -*Initial:* @0@ -*Valid:* @0@ or @1@ =: - -notextile.
diff --git a/docs/providers/Myspace.textile b/docs/providers/Myspace.textile deleted file mode 100644 index 646b0b6..0000000 --- a/docs/providers/Myspace.textile +++ /dev/null @@ -1,28 +0,0 @@ -notextile.
- -h2. Myspace videos player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @myspace@ as provider.) -* http(s)://myspace.com/…/video/…/[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -notextile.
diff --git a/docs/providers/Soundcloud.textile b/docs/providers/Soundcloud.textile deleted file mode 100644 index d76072a..0000000 --- a/docs/providers/Soundcloud.textile +++ /dev/null @@ -1,107 +0,0 @@ -notextile.
- -h2. Soundcloud player config - -h3. Recognised values for the @play@ attribute - -* http(s)://(api.)soundcloud.com/… - -h3. Player size - -- @width@ := -The width of the player in pixels (OK, pourcentage works also…). -*Default:* related plugin pref -*Initial:* @100%@ -*valid:* Integer =: -- @height@ := -The height of the player in pixels (if @visual="true"@ Soundcloud width is usually @450@). -*Default:* related plugin pref -*Initial:* @166@ (alt provided height is @450@) -*valid:* Integer =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* none -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -Some prefs/attributes can conditionate the behavior of others (e.g. @visual="true"@ desactivates @color@). - -- @auto_play@ := -Whether to play after loading or not. -*Default:* related plugin pref -*Initial:* @false@ -*valid:* @true@ or @false@ =: -- @buying@ := -Whether to display the _Buy_ button or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @color@ := -Changes the colour of the user interface elements. -*Default:* related plugin pref -*Initial:* @ff8800@ -*valid:* a hexa color value =: -- @download@ := -Whether to display the _Download_ button or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @hide_related@ := -Whether to display related tracks or not. -*Default:* related plugin pref -*Initial:* @false@ -*valid:* @true@ or @false@ =: -- @sharing@ := -Whether to enable the sharing features or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @show_artwork@ := -Whether to display the artwork or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @show_comments@ := -Whether to display comments or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @show_reposts@ := -Whether to display reposts or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @show_playcount@ := -Whether to display the playcount or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @show_user@ := -Whether to display the uploader or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @single_active@ := -Whether to stop playing while another player is on or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @start_track@ := -Specifies the time (in seconds) when the track should start playing. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* an integer =: -- @theme_color@ := -Changes the color of the player theme. -*Default:* related plugin pref -*Initial:* @ff3300@ -*valid* a hexa color value =: -- @visual@ := -Whether to display the artwork as a background or not. -*Default:* related plugin pref -*Initial:* @false@ -*valid:* @true@ or @false@ =: - -notextile.
diff --git a/docs/providers/Twitch.textile b/docs/providers/Twitch.textile deleted file mode 100644 index 67d9040..0000000 --- a/docs/providers/Twitch.textile +++ /dev/null @@ -1,49 +0,0 @@ -notextile.
- -h2. Twitch player config - -h3. Recognised values for the @play@ attribute - -* v[*ID*] (using @twitch@ as provider.) -* http(s)://(www.)twitch.tv/…/v/[*ID*] (video) -* http(s)://(www.)twitch.tv/[*ID*] (channel) - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @autoplay@ := -Whether to play after loading or not. -*Default:* related plugin pref -*Initial:* @true@ -*valid:* @true@ or @false@ =: -- @muted@ := -Whether to disable sound by default or not. -*Default:* related plugin pref -*Initial:* @false@ -*valid:* @true@ or @false@ =: -- @time@ := -Starts playback at the given timestamp. -*Default:* related plugin pref -*Initial:* @true@ -*Format:* @1h2m3s@ =: - -p(alert-block information). %(ui-icon ui-icon-info).% More informations on "this GitHub webpage":https://dev.twitch.tv/docs/v5/guides/embed-video/ - -notextile.
diff --git a/docs/providers/Viddsee.textile b/docs/providers/Viddsee.textile deleted file mode 100644 index 83ad44d..0000000 --- a/docs/providers/Viddsee.textile +++ /dev/null @@ -1,29 +0,0 @@ -notextile.
- -h2. Viddsee player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @viddsee@ as provider.) -* http(s):(www.)//viddsee.com/video/…/[*ID*] -* http(s):(www.)//viddsee.com/player/[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -notextile.
diff --git a/docs/providers/Video.textile b/docs/providers/Video.textile deleted file mode 100644 index e68ce69..0000000 --- a/docs/providers/Video.textile +++ /dev/null @@ -1,64 +0,0 @@ -notextile.
- -h2. HTML video player config - -h3. Recognised values for the @play@ attribute - -* comma separated list of *File ID's* (using @video@ as provider.) -* 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@; - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @autoplay@ := -Enables the automatic playing if set to @1@. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @controls@ := -Displays the player controls. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @loop@ := -Reads the video over and over. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @muted@ := -Disables the sound if set to @1@. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @poster@ := -Specifies a start shot URL. -*Default:* related plugin pref -*Initial:* none -*valid:* URL =: -- @preload@ := -Specifies the way the browser load the media. -*Default:* related plugin pref -*Initial:* @auto@ -*valid:* @none@, @metadata@, @auto@ =: - -p(alert-block information). %(ui-icon ui-icon-info).% More informations on "this MDN webpage":https://developer.mozilla.org/fr/docs/Web/HTML/Element/Video. - -notextile.
diff --git a/docs/providers/Vimeo.textile b/docs/providers/Vimeo.textile deleted file mode 100644 index e9f9a76..0000000 --- a/docs/providers/Vimeo.textile +++ /dev/null @@ -1,74 +0,0 @@ -notextile.
- -h2. Vimeo player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @vimeo@ as provider.) -* http(s)://vimeo.com/[*ID*] -* http(s)://player.vimeo.com/video/[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @api@ := -Enables or disables "the javascript player api":https://github.com/vimeo/player.js. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @autopause@ := -Enables or disables pausing this video when another video is played. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@ or @1@ =: -- @autoplay@ := -Play the video automatically on load. Note that this won’t work on some devices. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @byline@ := -Show the user’s byline on the video. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@ or @1@ =: -- @color@ := -Specify the color of the video controls. Make sure that you don’t include the #. -*Default:* related plugin pref -*Initial:* @00adef@ -*valid:* a hexa color value =: -- @loop@ := -Play the video again when it reaches the end. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @portrait@ := -Show the user’s portrait on the video. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@ or @1@ =: -- @title@ := -Show the title on the video. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@ or @1@ =: - -p(alert-block information). %(ui-icon ui-icon-info).% More informations on "this Vimeo webpage":https://developer.vimeo.com/player/embedding. - -notextile.
diff --git a/docs/providers/Vine.textile b/docs/providers/Vine.textile deleted file mode 100644 index 83b69e9..0000000 --- a/docs/providers/Vine.textile +++ /dev/null @@ -1,39 +0,0 @@ -notextile.
- -h2. Vine player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @vine@ as provider.) -* http(s)://(www.)vine.co/v/[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @600@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* @600@ -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* none -*valid:* integer[@:@]integer =: - -h3. Player parameters - -- @type@ := -*Default:* related plugin pref -*Initial:* @simple@ -*valid:* @simple@ or @postcard@ =: -- @audio@ := -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: - -notextile.
diff --git a/docs/providers/Youtube.textile b/docs/providers/Youtube.textile deleted file mode 100644 index 642a193..0000000 --- a/docs/providers/Youtube.textile +++ /dev/null @@ -1,140 +0,0 @@ -notextile.
- -h2. Youtube player config - -h3. Recognised values for the @play@ attribute - -* *ID* (using @youtube@ as provider.) -* list=[*list_ID*] -* http(s)://(www.)youtu.be/[*ID*] -* http(s)://(www.)youtube.com/v/[*ID*] -* http(s)://(www.)youtube.com/watch?v=[*ID*](&list=[*list_ID*]) -* http(s)://(www.)youtube.com/embed/[*ID*] - -h3. Player size - -- @width@ := -The width of the player in pixels. -*Default:* related plugin pref -*Initial:* @640@ -*valid:* integer =: -- @height@ := -*Default:* related plugin pref -*Initial:* none -*valid:* integer -The height of the player in pixels. =: -- @ratio@ := -The ratio used to calculate the missing value for the width or the height. -*Default:* related plugin pref -*Initial:* @16:9@ -*valid:* integer[@:@]integer =: - -h3. Player parameters (aplhabetical order) - -- @autohide@ := -Indicates whether the video controls will automatically hide after a video begins playing. -This parameter has been deprecated for HTML5 players, which display or hide the video progress bar and player controls automatically (autohide=1). -*Default:* related plugin pref -*Initial:* @2@ -*valid:* @0@, @1@ or @2@ =: -- @autoplay@ := -Specifies whether the initial video will automatically start to play when the player loads. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @cc_load_policy@ := -1 causes closed captions to be shown by default, even if the user has turned captions off. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @1@ =: -- @color@ := -Specifies the color used in the player's progress bar. -*Default:* related plugin pref -*Initial:* @red@ -*valid:* @red@ or @white@ =: -- @controls@ := -Indicates whether the video player controls are displayed. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@, @1@ or @2@ =: -- @disablekb@ := -Disables keyboard commands. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @enablejsapi@ := -Enables or disables "the javascript player api":https://developers.google.com/youtube/js_api_reference. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @end@ := -Specifies the time, measured in seconds, when the player should stop playing the video. -*Default:* related plugin pref -*Initial:* none -*valid:* an integer =: -- @fs@ := -Setting this parameter to 0 prevents the fullscreen button from displaying in the player. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@ or @1@ =: -- @hl@ := -Sets the player's interface language. -*Default:* related plugin pref -*Initial:* none -*valid:* an ISO 639-1 two-letter language code or a fully specified locale. -- @iv_load_policy@ := -Setting the parameter's value to 1 causes video annotations to be shown by default. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @1@ or @3@ =: -- @loop@ := -Causes the player to play the video again and again. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @modestbranding@ := -Lets you use a YouTube player that does not show a YouTube logo. -*Default:* related plugin pref -*Initial:* @0@ -*valid:* @0@ or @1@ =: -- @origin@ := -URL scheme (@http://@ or @https://@) and full domain of your host page. -Required for @https://@ URL's; including it protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player. -*Default:* related plugin pref -*Initial:* none -*valid:* URL =: -- @playlist@ := -A list of video id's to read after the one provided via the @video@ attribute. -*Default:* related plugin pref -*Initial:* none -*valid:* a comma separeted list of video id's =: -- @playsinline@ := -Controls whether videos play inline or fullscreen in an HTML5 player on iOS. -*Default:* related plugin pref -*Initial:* none -*valid:* =: -- @rel@ := -Indicates whether the player should show related videos when playback of the initial video ends. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@ or @1@ =: -- @showinfo@ := -Whether to display the video informations or not. -*Default:* related plugin pref -*Initial:* @1@ -*valid:* @0@ or @1@ =: -- @start@ := -Specifies the time (in seconds) when the video should start playing. -*Default:* related plugin pref -*Initial:* none -*valid:* an integer =: -- @theme@ := -Indicates whether the embedded player will display player controls (like a play button or volume control) within a dark or light control bar. -This parameter has been deprecated for HTML5 players. -*Default:* related plugin pref -*Initial:* @dark@ -*valid:* @dark@ or @light@ =: - -p(alert-block information). %(ui-icon ui-icon-info).% Some prefs/attributes may be deprecated for HTML5 players or overriden by the provider depending on several conditions. More informations on "this Youtube webpage":https://developers.google.com/youtube/player_parameters. - -notextile.
diff --git a/manifest.json b/manifest.json index b0bebf9..c74cfa9 100755 --- a/manifest.json +++ b/manifest.json @@ -1,61 +1,17 @@ { "name" : "oui_player", - "description" : "Embed customised players", - "version" : "1.4.0-dev", + "description" : "Manage configurable media players", + "version" : "2.0.0-BETA1", "type" : 1, "author" : "Nicolas Morand", "author_uri" : "http://github.com/NicolasGraph", "order" : 5, "flags" : 3, - "help" : {"file" : [ - "./docs/misc/_styles.textile", - "./docs/misc/_scripts.textile", - "./docs/misc/_top.textile", - "./docs/main/Header.textile", - "./docs/main/Menu.textile", - "./docs/misc/_text_top.textile", - "./docs/main/Basics.textile", - "./docs/main/Prefs.textile", - "./docs/main/Tags.textile", - "./docs/providers/Abcnews.textile", - "./docs/providers/Archive.textile", - "./docs/providers/Bandcamp.textile", - "./docs/providers/Dailymotion.textile", - "./docs/providers/Audio.textile", - "./docs/providers/Video.textile", - "./docs/providers/Mixcloud.textile", - "./docs/providers/Myspace.textile", - "./docs/providers/Soundcloud.textile", - "./docs/providers/Twitch.textile", - "./docs/providers/Viddsee.textile", - "./docs/providers/Vimeo.textile", - "./docs/providers/Vine.textile", - "./docs/providers/Youtube.textile", - "./docs/main/Examples.textile", - "./docs/main/Dev.textile", - "./docs/main/Credits.textile", - "./docs/misc/_text_bottom.textile", - "./docs/misc/_bottom.textile" - ]}, "code": {"file" : [ - "./src/player/providers/Provider.php", - "./src/player/providers/Video.php", - "./src/player/providers/Audio.php", - "./src/player/providers/Abcnews.php", - "./src/player/providers/Archive.php", - "./src/player/providers/Bandcamp.php", - "./src/player/providers/Dailymotion.php", - "./src/player/providers/Mixcloud.php", - "./src/player/providers/Myspace.php", - "./src/player/providers/Soundcloud.php", - "./src/player/providers/Twitch.php", - "./src/player/providers/Viddsee.php", - "./src/player/providers/Vimeo.php", - "./src/player/providers/Vine.php", - "./src/player/providers/Youtube.php", - "./src/player/Player.php", - "./src/player/Admin.php", - "./src/player/Public.php", + "./src/Provider.php", + "./src/Player.php", + "./src/Admin.php", + "./src/Public.php", "./src/tags.php" ]} } diff --git a/src/.DS_Store b/src/.DS_Store index 75a4a38..00a5695 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/Admin.php b/src/Admin.php new file mode 100644 index 0000000..bd275c8 --- /dev/null +++ b/src/Admin.php @@ -0,0 +1,391 @@ +setPrefs(); + $this->deleteOldPrefs(); + } else { + $this->uninstall(); + } + } + + public function uninstall() + { + safe_delete('txp_prefs', "event LIKE '" . self::getPlugin() . "%'"); + } + + /** + * Links 'options' to the prefs panel. + */ + + public static function optionsLink() + { + global $event; + + header('Location: ?event=' . str_replace('plugin_prefs.', 'prefs#prefs_group_', $event)); + } + + /** + * Defines a plugin pref widget. + * + * @param array $options Current pref options + * @return string HTML + */ + + private static function prefWidget($options) + { + $valid = isset($options['valid']) ? $options['valid'] : false; + + if ($valid && is_array($valid)) { + $yesno_diff = array_diff($valid, array('0', '1')); + $truefalse_diff = array_diff($valid, array('true', 'false')); + + if (empty($yesno_diff)) { + $widget = 'yesnoradio'; + } elseif (empty($truefalse_diff)) { + $widget = 'Oui\Player\Admin::truefalseradio'; + } else { + $widget = 'Oui\Player\Admin::prefFunction'; + } + } elseif ($valid) { + $widget = 'Oui\Player\Admin::prefFunction'; + } else { + $widget = 'text_input'; + } + + return $widget; + } + + /** + * Builds a plugin pref widget. + * + * @param string $name The preference name (Txp var) + * @param string $val The preference value (Txp var) + * @return string HTML + */ + + public static function prefFunction($name, $val) + { + $prefs = self::getAllPrefs(); + $valid = $prefs[$name]['valid']; + + if (is_array($valid)) { + $vals = array(); + + foreach ($valid as $value) { + $value === '' ?: $vals[$value] = gtxt($name . '_' . strtolower($value)); + } + + return selectInput($name, $vals, $val, $valid[0] === '' ? true : false); + } else { + return fInput($valid, $name, $val); + } + } + + /** + * Generates a select list of custom + article_image + excerpt fields. + * + * @param string $name The name of the preference (Textpattern variable) + * @param string $val The value of the preference (Textpattern variable) + * @return string HTML + */ + + public static function customFields($name, $val) + { + $vals = array(); + $vals['article_image'] = gtxt('article_image'); + $vals['excerpt'] = gtxt('excerpt'); + + $custom_fields = safe_rows( + "name, val", + 'txp_prefs', + "name LIKE 'custom_%_set' AND val<>'' ORDER BY name" + ); + + if ($custom_fields) { + foreach ($custom_fields as $row) { + $vals[strtolower($row['val'])] = $row['val']; + } + } + + return selectInput($name, $vals, $val); + } + + /** + * Generates a Yes/No radio button toggle using 'true'/'false' as values. + * + * @param string $field The field name + * @param string $checked The checked button, either 'true', 'false' + * @param int $tabindex The HTML tabindex + * @param string $id The HTML id + * @return string HTML + */ + + public static function truefalseradio( + $field, + $checked = '', + $tabindex = 0, + $id = '' + ) { + $vals = array( + 'false' => gTxt('no'), + 'true' => gTxt('yes'), + ); + + return radioSet($vals, $field, $checked, $tabindex, $id); + } + + /** + * $allPrefs property setter + * Collects plugin prefs + * + * @return array $allPrefs + */ + + public static function setAllPrefs() + { + $prefs = array(); + $plugin = self::getPlugin(); + $providers = self::getProviders(); + + self::setPref('provider', 'valid', $providers); + self::setPref('provider', 'default', $providers[0]); + self::setPref('providers', 'default', implode(', ', $providers)); + + // Collects the plugin main prefs. + foreach (self::getPrefs() as $pref => $options) { + $options['group'] = $plugin; + $pref = $options['group'] . '_' . $pref; + $prefs[$pref] = $options; + } + + foreach ($providers as $provider) { + // Adds privilieges to provider prefs only if they are enabled. + $group = $plugin . '_' . strtolower($provider); + $pref = $group . '_prefs'; + + if (!empty($_POST[$pref]) || (!isset($_POST[$pref]) && get_pref($pref))) { + add_privs('prefs.' . $group, self::getPrivs()); + } + + // Adds a pref per provider to display/hide its own prefs group. + $options = array( + 'default' => '1', + 'valid' => array('0', '1'), + ); + $options['group'] = $plugin; + $pref = $options['group'] . '_' . strtolower($provider) . '_prefs'; + $prefs[$pref] = $options; + + // Collects provider prefs. + $class = __NAMESPACE__ . '\\' . $provider; + $prefs = $class::GetPrefs($prefs); + } + + return static::$allPrefs = $prefs; + } + + /** + * $allPrefs property getter + * + * @return array $allPrefs + */ + + public static function getAllPrefs() + { + static::$allPrefs or self::setAllPrefs(); + + return static::$allPrefs; + } + + /** + * Set plugin prefs. + */ + + public function setPrefs() + { + $prefs = $this->getAllPrefs(); + $position = 250; + + $existing = array(); + + $rs = safe_rows_start( + 'name, html', + doSlash('txp_prefs'), + "name LIKE '".doSlash('oui_player_%')."'" + ); + + if ($rs) { + while ($row = nextRow($rs)) { + $existing[$row['name']] = $row['html']; + } + } + + foreach ($prefs as $pref => $options) { + $widget = isset($options['widget']) ? $options['widget'] : self::prefWidget($options); + + if ($pref === 'oui_player_providers') { + set_pref( + $pref, + $options['default'], + $options['group'], + PREF_HIDDEN, + $widget, + $position + ); + } elseif (!isset($existing[$pref])) { + create_pref( + $pref, + $options['default'], + $options['group'], + PREF_PLUGIN, + $widget, + $position + ); + } elseif (isset($existing[$pref]) && $existing[$pref] !== $widget) { + update_pref($pref, $options['default'], null, null, $widget, null); + } + + $position += 10; + } + } + + /** + * Deletes old unused plugin prefs. + */ + + private function deleteOldPrefs() + { + $prefs = $this->getAllPrefs(); + + safe_delete( + 'txp_prefs', + "event LIKE '" .self::getPlugin() . "%' AND name NOT IN ( '" . implode(array_keys($prefs), "', '") . "' )" + ); + } + } + + global $event; + + $pluginPrefs = 'plugin_prefs.' . Admin::getPlugin(); + + if (txpinterface === 'admin') { + new Admin; + } +} diff --git a/src/Player.php b/src/Player.php new file mode 100644 index 0000000..69d9dc4 --- /dev/null +++ b/src/Player.php @@ -0,0 +1,205 @@ + array( + 'class' => array( + 'default' => '', + ), + 'label' => array( + 'default' => '', + ), + 'labeltag' => array( + 'default' => '', + ), + 'provider' => array( + 'default' => '', + ), + 'play' => array( + 'default' => '', + ), + 'wraptag' => array( + 'default' => '', + ), + 'responsive' => array( + 'default' => '', + ), + ), + 'oui_if_player' => array( + 'play' => array( + 'default' => '', + ), + 'provider' => array( + 'default' => '', + ), + ), + ); + + /** + * Plugin prefs related privilege levels. + * + * @var string + */ + + protected static $privs = '1, 2'; + + /** + * Multidimensional associative array + * of plugin general prefs. + * + * @var array. + */ + + protected static $prefs = array( + 'custom_field' => array( + 'widget' => 'Oui\Player\Admin::customFields', + 'default' => 'article_image', + ), + 'provider' => array( + 'default' => '', + ), + 'responsive' => array( + 'default' => 'false', + 'valid' => array('true', 'false'), + ), + 'providers' => array( + 'default' => '', + ), + ); + + /** + * Plugin property setter. + */ + + public static function setPlugin() + { + static::$plugin = strtolower(str_replace('\\', '_', __NAMESPACE__)); + } + + /** + * $plugin property getter. + * + * @return string self::$plugin + */ + + public static function getPlugin() + { + self::$plugin or self::setPlugin(); + + return self::$plugin; + } + + /** + * $providers property getter. + * + * @return array static::$providers + */ + + public static function getProviders() + { + static::$providers or static::setProviders(); + + return static::$providers; + } + + /** + * $tags property getter. + * + * @return array static::$tags + */ + + public static function getTags() + { + return static::$tags; + } + + /** + * $privs property getter. + * + * @return array self::$privs + */ + + public static function getPrivs() + { + return self::$privs; + } + + /** + * $prefs property getter. + * + * @return array static::$prefs + */ + + public static function getPrefs() + { + return static::$prefs; + } + + public static function getPref($name = null, $key = null) + { + return $key ? static::$prefs[$name][$key] : static::$prefs[$name]; + } + + public static function setPref($name, $key, $value) + { + static::$prefs[$name][$key] = $value; + } + } +} diff --git a/src/Public.php b/src/Public.php new file mode 100644 index 0000000..dca8f57 --- /dev/null +++ b/src/Public.php @@ -0,0 +1,270 @@ +play = $value; + $infos = $this->getInfos(); + + if (!$infos || array_diff(explode(', ', $value), array_keys($infos))) { + $this->setInfos($fallback); + } + + return $this; + } + + /** + * Gets the play property. + */ + + public function getPlay() + { + return $this->play; + } + + /** + * Gets the infos property; set it if necessary. + * + * @param bool $fallback Whether to set fallback infos or not. + * @return array An associative array of + */ + + public function getProvider($fallback = false) + { + $this->infos or $this->setInfos($fallback); + + if ($this->provider && !array_diff(explode(', ', $this->getPlay()), array_keys($this->infos))) { + return $this->provider; + } + + return false; + } + + /** + * Finds the right provider to use and set the current media(s) infos. + * + * @return bool false if no provider is found. + */ + + public function setInfos($fallback = false) + { + foreach (self::getProviders() as $provider) { + $class = __NAMESPACE__ . '\\' . $provider; + $this->infos = $class::getInstance() + ->setPlay($this->getPlay()) + ->getInfos(); + + if ($this->infos) { + $this->provider = $provider; + + return $this->infos; + } + } + + if (!$this->infos && $fallback) { + // No matched provider, set default infos. + $this->infos = array( + $this->getPlay() => array( + 'play' => $this->getPlay(), + 'type' => 'id', + ) + ); + + $this->provider = get_pref(self::getPlugin() . '_provider'); + } + + return $this->infos; + } + + /** + * Gets the infos property; set it if necessary. + * + * @param bool $fallback Whether to set fallback infos or not. + * @return array An associative array of + */ + + public function getInfos() + { + return $this->infos; + } + + public function setConfig($value) + { + $this->config = $value; + + return $this; + } + + public function getConfig() + { + return $this->config; + } + + /** + * Get tag attributes. + * + * @param string $tag The plugin tag + * @return array An associative array using attributes as keys. + */ + + public static function getAtts($tag) + { + $get_atts = array(); + $tags = self::getTags(); + + // Collects main attributes. + foreach ($tags[$tag] as $att => $options) { + $get_atts[$att] = ''; + } + + if ($tag === self::getPlugin()) { + // Collects provider attributes. + foreach (self::getProviders() as $provider) { + $class = __NAMESPACE__ . '\\' . $provider; + $get_atts = $class::getAtts($tag, $get_atts); + } + } + + return $get_atts; + } + + /** + * Whether a provided URL to play matches a provider URL scheme or not. + * + * @return bool + */ + + public function isValid() + { + return $this->getInfos(); + } + + /** + * Gets the player code + */ + + public function getPlayer() + { + if ($provider = $this->getProvider(true)) { + $class = __NAMESPACE__ . '\\' . $provider; + + return $class::getInstance() + ->setPlay($this->getPlay()) + ->setConfig($this->getConfig()) + ->getPlayer(); + } + + trigger_error('Undefined oui_player provider.'); + } + } + + if (txpinterface === 'public') { + foreach (Main::getTags() as $tag => $attributes) { + \Txp::get('\Textpattern\Tag\Registry')->register($tag); + + foreach (Main::getProviders() as $provider) { + \Txp::get('\Textpattern\Tag\Registry')->register(str_replace('player', strtolower($provider), $tag)); + } + } + } +} diff --git a/src/player/Admin.php b/src/player/Admin.php deleted file mode 100644 index da5c247..0000000 --- a/src/player/Admin.php +++ /dev/null @@ -1,317 +0,0 @@ -setPrefs(); - $this->deleteOldPrefs(); - break; - case 'deleted': - \safe_delete('txp_prefs', "event LIKE '" . static::$plugin . "%'"); - \safe_delete('txp_lang', "owner = '" . static::$plugin . "'"); - break; - } - } - - /** - * Links 'options' to the prefs panel. - */ - - public static function optionsLink() - { - header('Location: ?event=prefs#prefs_group_' . static::$plugin); - } - - /** - * Defines a plugin pref widget. - * - * @param array $options Current pref options - * @return string HTML - * @see \yesnoradio() - * \oui_player_truefalseradio() - * \oui_player_pref_widget() - * \text_input() - */ - - private static function prefWidget($options) - { - $valid = isset($options['valid']) ? $options['valid'] : false; - - if ($valid && is_array($valid)) { - $yesno_diff = array_diff($valid, array('0', '1')); - $truefalse_diff = array_diff($valid, array('true', 'false')); - - if (empty($yesno_diff)) { - $widget = 'yesnoradio'; - } elseif (empty($truefalse_diff)) { - $widget = 'Oui\Player\Admin::truefalseradio'; - } else { - $widget = 'Oui\Player\Admin::prefFunction'; - } - } elseif ($valid) { - $widget = 'Oui\Player\Admin::prefFunction'; - } else { - $widget = 'text_input'; - } - - return $widget; - } - - /** - * Builds a plugin pref widget. - * - * @param string $name The preference name (Txp var) - * @param string $val The preference value (Txp var) - * @return string HTML - * @see getPrefs() - * \gtxt() - * \selectInput() - * \fInput() - */ - - public static function prefFunction($name, $val) - { - $prefs = self::getPrefs(); - $valid = $prefs[$name]['valid']; - - if (is_array($valid)) { - $vals = array(); - - foreach ($valid as $value) { - $value === '' ?: $vals[$value] = \gtxt($name . '_' . strtolower($value)); - } - - return \selectInput($name, $vals, $val, $valid[0] === '' ? true : false); - } else { - return \fInput($valid, $name, $val); - } - } - - /** - * Generates a select list of custom + article_image + excerpt fields. - * - * @param string $name The name of the preference (Textpattern variable) - * @param string $val The value of the preference (Textpattern variable) - * @return string HTML - */ - - public static function customFields($name, $val) - { - $vals = array(); - $vals['article_image'] = gtxt('article_image'); - $vals['excerpt'] = gtxt('excerpt'); - - $custom_fields = safe_rows("name, val", 'txp_prefs', "name LIKE 'custom_%_set' AND val<>'' ORDER BY name"); - - if ($custom_fields) { - foreach ($custom_fields as $row) { - $vals[$row['val']] = $row['val']; - } - } - - return selectInput($name, $vals, $val); - } - - /** - * Generates a Yes/No radio button toggle using 'true'/'false' as values. - * - * @param string $field The field name - * @param string $checked The checked button, either 'true', 'false' - * @param int $tabindex The HTML tabindex - * @param string $id The HTML id - * @see radioSet() - * @return string HTML - */ - - public static function truefalseradio($field, $checked = '', $tabindex = 0, $id = '') - { - $vals = array( - 'false' => gTxt('no'), - 'true' => gTxt('yes'), - ); - - return radioSet($vals, $field, $checked, $tabindex, $id); - } - - /** - * Collects plugin prefs - * - * @return array Preferences - * @see getPrefs() - */ - - public static function getPrefs() - { - $prefs = array(); - - // Collects the plugin main prefs. - foreach (static::$prefs as $pref => $options) { - $options['group'] = static::$plugin; - $pref = $options['group'] . '_' . $pref; - $prefs[$pref] = $options; - } - - foreach (static::$providers as $provider) { - // Adds a pref per provider to display/hide its own prefs group. - $options = array( - 'default' => '0', - 'valid' => array('0', '1'), - ); - $options['group'] = static::$plugin; - $pref = $options['group'] . '_' . strtolower($provider) . '_prefs'; - $prefs[$pref] = $options; - - // Collects provider prefs. - $class = __NAMESPACE__ . '\\' . $provider; - $prefs = $class::getPrefs($prefs); - } - - return $prefs; - } - - /** - * Set plugin prefs. - * - * @see getPrefs() - * \get_pref() - * \set_pref() - * prefWidget() - */ - - private function setPrefs() - { - $prefs = $this->getPrefs(); - $position = 250; - - foreach ($prefs as $pref => $options) { - $widget = isset($options['widget']) ? $options['widget'] : self::prefWidget($options); - - if ($pref === 'oui_player_providers' || \get_pref($pref, null) === null) { - \set_pref( - $pref, - $options['default'], - $options['group'], - $pref === 'oui_player_providers' ? PREF_HIDDEN : PREF_PLUGIN, - $widget, - $position - ); - } else { - \safe_update( - doSlash('txp_prefs'), - "html = '".doSlash($widget)."'", - "name = '".doSlash($pref)."'" - ); - } - - $position += 10; - } - } - - /** - * Deletes old unused plugin prefs. - * - * @see getPrefs() - * \safe_delete() - */ - - private function deleteOldPrefs() - { - $prefs = $this->getPrefs(); - - \safe_delete( - 'txp_prefs', - "event LIKE '" . static::$plugin . "%' AND name NOT IN ( '" . implode(array_keys($prefs), "', '") . "' )" - ); - } - } - - if (txpinterface === 'admin') { - new Admin; - } -} diff --git a/src/player/Player.php b/src/player/Player.php deleted file mode 100644 index 94e319b..0000000 --- a/src/player/Player.php +++ /dev/null @@ -1,111 +0,0 @@ - array( - 'class' => array( - 'default' => '', - ), - 'label' => array( - 'default' => '', - ), - 'labeltag' => array( - 'default' => '', - ), - 'provider' => array( - 'default' => '', - ), - 'play' => array( - 'default' => '', - ), - 'wraptag' => array( - 'default' => '', - ), - ), - 'oui_if_player' => array( - 'play' => array( - 'default' => '', - ), - 'provider' => array( - 'default' => '', - ), - ), - ); - - /** - * Plugin prefs related privilege levels. - * - * @var string - */ - - protected static $privs = '1, 2'; - - /** - * Multidimensional associative array - * of plugin general prefs. - * - * @var array. - */ - - protected static $prefs = array( - 'custom_field' => array( - 'widget' => 'Oui\Player\Admin::customFields', - 'default' => 'article_image', - ), - 'provider' => array(), - 'providers' => array(), - ); - } -} diff --git a/src/player/Public.php b/src/player/Public.php deleted file mode 100644 index 1e29ff9..0000000 --- a/src/player/Public.php +++ /dev/null @@ -1,289 +0,0 @@ -play = $play; - $config ? static::$instance[$class]->config = $config : ''; - - return static::$instance[$class]; - } - - /** - * Registers plugin tags. - */ - - public static function registerTags() - { - // Registers plugin tags. - foreach (self::$tags as $tag => $attributes) { - \Txp::get('\Textpattern\Tag\Registry')->register($tag); - } - } - - /** - * Get tag attributes. - * - * @param string $tag The plugin tag - * @return array An associative array using attributes as keys. - */ - - public static function getAtts($tag) - { - $get_atts = array(); - - // Collects main attributes. - foreach (self::$tags[$tag] as $att => $options) { - $get_atts[$att] = ''; - } - - if ($tag === static::$plugin) { - // Collects provider attributes. - foreach (static::$providers as $provider) { - $class = __NAMESPACE__ . '\\' . $provider; - $get_atts = $class::getAtts($tag, $get_atts); - } - } - - return $get_atts; - } - - /** - * Finds the right provider to use and set the current media(s) infos. - * - * @return bool false if no provider is found. - * @see getPlay() - * \get_pref() - */ - - public function setInfos() - { - foreach (static::$providers as $provider) { - $class = __NAMESPACE__ . '\\' . $provider; - $obj = $class::getInstance($this->getPlay()); - - if ($this->infos = $obj->setInfos()) { - $this->provider = $provider; - - return true; - } - } - - return false; - } - - /** - * Set the current media(s) infos fallback. - * - * @see getPlay() - * \get_pref() - */ - - public function setFallbackInfos() - { - // No matched provider, set default infos. - $this->infos = array( - $this->getPlay() => array( - 'play' => $this->getPlay(), - 'type' => 'id', - ) - ); - - $this->provider = \get_pref(static::$plugin . '_provider'); - } - - /** - * Gets the infos property; set it if necessary. - * - * @param bool $fallback Whether to set fallback infos or not. - * @return array An associative array of - * @see setInfos() - * \gtxt() - */ - - public function getInfos($fallback = true) - { - if ($this->infos && array_key_exists($this->getPlay(), $this->infos) || $this->setInfos()) { - return $this->infos; - } elseif ($fallback) { - $this->setFallbackInfos(); - - return $this->infos; - } - - return false; - } - - /** - * Whether a provided URL to play matches a provider URL scheme or not. - * - * @return bool - * @see getInfos() - */ - - public function isValid() - { - return $this->getInfos(false); - } - - /** - * Gets the infos property; set it if necessary. - * - * @param bool $fallback Whether to set fallback infos or not. - * @return array An associative array of - * @see setInfos() - * \gtxt() - */ - - public function getProvider($fallback = true) - { - if ($this->provider && array_key_exists($this->getPlay(), $this->infos) || $this->setInfos()) { - return $this->provider; - } elseif ($fallback) { - $this->setFallbackInfos(); - - return $this->provider; - } - - return false; - } - - /** - * Gets the play property. - * - * @throws \Exception - * @see \gtxt() - */ - - public function getPlay() - { - if ($this->play) { - return $this->play; - } - - throw new \Exception(gtxt('undefined_property')); - } - - /** - * Gets the player code - * - * @throws \Exception - * @see setInfos() - * getPlay() - * getInfos() - * \gtxt() - */ - - public function getPlayer() - { - if ($provider = $this->getProvider()) { - $class = __NAMESPACE__ . '\\' . $provider; - - return $class::getInstance( - $this->getPlay(), - $this->config, - $this->getInfos() - )->getPlayer(); - } - - throw new \Exception(gtxt('undefined_player')); - } - } - - if (txpinterface === 'public') { - Main::registerTags(); - } -} diff --git a/src/player/providers/Abcnews.php b/src/player/providers/Abcnews.php deleted file mode 100644 index a4888d9..0000000 --- a/src/player/providers/Abcnews.php +++ /dev/null @@ -1,42 +0,0 @@ - array( - 'scheme' => '#^(http|https)://(abcnews\.go\.com/([A-Z]+/)?video)/[^0-9]+([0-9]+)$#i', - 'id' => '4', - ), - ); - protected static $src = '//abcnews.go.com/'; - protected static $glue = array('video/embed?id=', '&', '&'); - } - - Abcnews::getInstance(); -} diff --git a/src/player/providers/Archive.php b/src/player/providers/Archive.php deleted file mode 100644 index 81f77fc..0000000 --- a/src/player/providers/Archive.php +++ /dev/null @@ -1,69 +0,0 @@ - array( - 'scheme' => '#^(http|https)://(www\.)?archive\.org/(details|embed)/([^&?/]+)$#i', - 'id' => '4', - ), - ); - protected static $src = '//archive.org/'; - protected static $glue = array('embed/', '&', '&'); - protected static $dims = array( - 'width' => array( - 'default' => '640', - ), - 'height' => array( - 'default' => '480', - ), - 'ratio' => array( - 'default' => '', - ), - ); - protected static $params = array( - 'autoplay' => array( - 'default' => '0', - 'valid' => array('0', '1'), - ), - 'playlist' => array( - 'default' => '0', - 'valid' => array('0', '1'), - ), - 'poster' => array( - 'default' => '', - 'valid' => 'url', - ), - ); - } - - if (txpinterface === 'admin') { - Archive::getInstance(); - } -} diff --git a/src/player/providers/Audio.php b/src/player/providers/Audio.php deleted file mode 100644 index 6f271f5..0000000 --- a/src/player/providers/Audio.php +++ /dev/null @@ -1,105 +0,0 @@ - player. - * - * @package Oui\Player - */ - -namespace Oui\Player { - - class Audio extends Video - { - protected static $patterns = array( - 'filename' => array( - 'scheme' => '#^((?!(http|https)://(www\.)?)\S+\.(mp3|ogg|oga|wav))$#i', - 'id' => '1', - ), - 'url' => array( - 'scheme' => '#^(((http|https):\/\/(www.)?)\S+\.(mp3|ogg|oga|wav))$#i', - 'id' => '1', - ), - ); - protected static $dims = array(); - protected static $params = array( - 'autoplay' => array( - 'default' => '0', - 'valid' => array('0', '1'), - ), - 'controls' => array( - 'default' => '0', - 'valid' => array('0', '1'), - ), - 'loop' => array( - 'default' => '0', - 'valid' => array('0', '1'), - ), - 'muted' => array( - 'default' => '0', - 'valid' => array('0', '1'), - ), - 'preload' => array( - 'default' => 'auto', - 'valid' => array('none', 'metadata', 'auto'), - ), - 'volume' => array( - 'default' => '', - 'valid' => 'number', - ), - ); - - /** - * {@inheritdoc} - */ - - public function getPlayer() - { - if ($sources = $this->getSources()) { - $src = $sources[0]; - - unset($sources[0]); - - $params = $this->getParams(); - - return sprintf( - '', - $src, - (empty($params) ? '' : ' ' . implode(static::$glue, $params)), - ($sources ? n . '' . n . '' : ''), - n . \gtxt( - 'oui_player_html_player_not_supported', - array( - '{player}' => '