From 03635f0a92f7fd206bd8dfb53ae5c8824a49ae51 Mon Sep 17 00:00:00 2001 From: Nicolas Morand Date: Thu, 19 Apr 2018 12:02:25 +0200 Subject: [PATCH 01/38] Initial changes to v2 --- .DS_Store | Bin 12292 -> 10244 bytes README.md | 61 ------ README.textile | 164 +++++++++++++++++ {docs/main => dev_docs}/Dev.textile | 4 - docs/main/Basics.textile | 79 -------- docs/main/Credits.textile | 53 ------ docs/main/Examples.textile | 43 ----- docs/main/Header.textile | 5 - docs/main/Menu.textile | 34 ---- docs/main/Prefs.textile | 29 --- docs/main/Tags.textile | 64 ------- docs/misc/_bottom.textile | 1 - docs/misc/_scripts.textile | 8 - docs/misc/_styles.textile | 3 - docs/misc/_text_bottom.textile | 1 - docs/misc/_text_top.textile | 1 - docs/misc/_top.textile | 1 - docs/providers/Abcnews.textile | 29 --- docs/providers/Archive.textile | 49 ----- docs/providers/Audio.textile | 51 ----- docs/providers/Bandcamp.textile | 62 ------- docs/providers/Dailymotion.textile | 110 ----------- docs/providers/Mixcloud.textile | 55 ------ docs/providers/Myspace.textile | 28 --- docs/providers/Soundcloud.textile | 107 ----------- docs/providers/Twitch.textile | 49 ----- docs/providers/Viddsee.textile | 29 --- docs/providers/Video.textile | 64 ------- docs/providers/Vimeo.textile | 74 -------- docs/providers/Vine.textile | 39 ---- docs/providers/Youtube.textile | 140 -------------- manifest.json | 51 +---- src/.DS_Store | Bin 8196 -> 6148 bytes src/{player => }/Admin.php | 128 ++++++++----- src/{player => }/Player.php | 10 +- src/{player/providers => }/Provider.php | 3 +- src/{player => }/Public.php | 2 +- src/player/providers/Abcnews.php | 42 ----- src/player/providers/Archive.php | 69 ------- src/player/providers/Audio.php | 105 ----------- src/player/providers/Bandcamp.php | 85 --------- src/player/providers/Dailymotion.php | 100 ---------- src/player/providers/Mixcloud.php | 78 -------- src/player/providers/Myspace.php | 44 ----- src/player/providers/Soundcloud.php | 117 ------------ src/player/providers/Twitch.php | 64 ------- src/player/providers/Viddsee.php | 44 ----- src/player/providers/Video.php | 176 ------------------ src/player/providers/Vimeo.php | 78 -------- src/player/providers/Vine.php | 92 ---------- src/player/providers/Youtube.php | 160 ---------------- src/tags.php | 2 +- textpacks/.DS_Store | Bin 6148 -> 6148 bytes textpacks/en-gb.textpack | 235 ------------------------ textpacks/fr-fr.textpack | 231 ----------------------- 55 files changed, 260 insertions(+), 3093 deletions(-) delete mode 100644 README.md create mode 100644 README.textile rename {docs/main => dev_docs}/Dev.textile (93%) delete mode 100644 docs/main/Basics.textile delete mode 100644 docs/main/Credits.textile delete mode 100644 docs/main/Examples.textile delete mode 100644 docs/main/Header.textile delete mode 100644 docs/main/Menu.textile delete mode 100644 docs/main/Prefs.textile delete mode 100644 docs/main/Tags.textile delete mode 100644 docs/misc/_bottom.textile delete mode 100644 docs/misc/_scripts.textile delete mode 100644 docs/misc/_styles.textile delete mode 100644 docs/misc/_text_bottom.textile delete mode 100644 docs/misc/_text_top.textile delete mode 100644 docs/misc/_top.textile delete mode 100644 docs/providers/Abcnews.textile delete mode 100644 docs/providers/Archive.textile delete mode 100644 docs/providers/Audio.textile delete mode 100644 docs/providers/Bandcamp.textile delete mode 100644 docs/providers/Dailymotion.textile delete mode 100644 docs/providers/Mixcloud.textile delete mode 100644 docs/providers/Myspace.textile delete mode 100644 docs/providers/Soundcloud.textile delete mode 100644 docs/providers/Twitch.textile delete mode 100644 docs/providers/Viddsee.textile delete mode 100644 docs/providers/Video.textile delete mode 100644 docs/providers/Vimeo.textile delete mode 100644 docs/providers/Vine.textile delete mode 100644 docs/providers/Youtube.textile rename src/{player => }/Admin.php (80%) rename src/{player => }/Player.php (92%) rename src/{player/providers => }/Provider.php (99%) rename src/{player => }/Public.php (99%) delete mode 100644 src/player/providers/Abcnews.php delete mode 100644 src/player/providers/Archive.php delete mode 100644 src/player/providers/Audio.php delete mode 100644 src/player/providers/Bandcamp.php delete mode 100644 src/player/providers/Dailymotion.php delete mode 100644 src/player/providers/Mixcloud.php delete mode 100644 src/player/providers/Myspace.php delete mode 100644 src/player/providers/Soundcloud.php delete mode 100644 src/player/providers/Twitch.php delete mode 100644 src/player/providers/Viddsee.php delete mode 100644 src/player/providers/Video.php delete mode 100644 src/player/providers/Vimeo.php delete mode 100644 src/player/providers/Vine.php delete mode 100644 src/player/providers/Youtube.php diff --git a/.DS_Store b/.DS_Store index 29521562af5b8cfa5ab9987dd43ed5025ac0c5af..7b5a44961183ef1114491ae98232d55cb14683d0 100644 GIT binary patch literal 10244 zcmeHMOK=oL82(l$yjWP}O)R}wQi@u7@!-LW7F;Y3`ghN4*z9hkJSbXBS55!j z|Es(I`KJHvUI4(ZwAuy`1OR~^M&$~siWDYiPeCd1I7^8l*+ZXU#bbsQqrP0A?KAuc z_!00U;77oZfFFVXLIfyhvmz{TsbBjM@FU1z-oXQd zTpcjvQor^i;76b^0_^Nw2J2xIba3*{@7qY$^an58a7ItH<3`M~491nR#^hiWOt2sY zTArgTd5#27L4yoLh*}T_J2q}7y^Dhzv818fPHXGeSW;RxZ+^KTNP@IbdNMp_jfb76 zleW8}sbj3yA9coJUVDJ1Gt-X7hIDN_BG+_VrW4goEyay>RU?(-!@8+j<6TzTRBi4j z>?)zG-So6lzzt?dUs^IDKaFnW?j{@Q?s{ z`w>*S{h9hzY89+AH*f_)W3(+Cw-U)27eyQxcBb16R7oNms9V`UiP8e4w`R8#k*hPb z{zFMew@iCTOW8yta-~f%>x)}ve@bKW;kad_6Q&)JtKv~3o;IS6w#zWW`Wek0akL4C zwT{|W%IW5cBRbhKUPPADwsu$}13jblkeMx`c&%b_V0mNHx(%J%LN^yKs+6T_sb)B% z+j`8<2FG>P89NfS}J=IBuhx#{Rn>sm^z!e(*6j3zX0rPM0*g4`&Kq+|N2wCuBZ6>@@w-zR)#^=oQRTuFD-~(Lrpd}tLFAm(Yb0sl zB)xmt7G2Kz7D*X2qA|^oRZ-wd?H!UboN*&2@AH_Ot0iTG-b{j~Y!i({LUx zz(sfsF2lR<9$be{;0AmKpTigMEqn*x!w>Ki`~ttiZMcJo5-z|Btiy-#QEbB1xCYyC zGj7FgxE*_OA0EJicnC-E1jaCqDkd<4<2Zrm@L7BwU%;2~b$lD&!7F$b-^c6jv`VsQ z-kSqLYT`#!6#~}IcwcSF;bLG6^wjj;Coq0f!Cq2T^+Pp_mo=_h+q!Y<&Y3ru_sV8L zDi=o_J}y2uZnC&=v8vS8)d!YHOXouPAR$eg5E!`S@|*Rwb;|N!ARsf$2)rw<2uOrz zk$0L_kgS9x%&oL8&>|9U+wxLa02?m3B&7M8dFK=1R9qj|l`-c|La(S|Uj@ zh~nSE+?#L>J|w(-3AYGkKf=$1v)>3~QS<2u|#NZUeK>n5b_ z#y!}NPhc1aa0nwF-ZV7P!c&++2dD5XP805)!}E9nFXD^%5?;c$@({Nt4{?`^AueI{ z^r&ek4)E3QZwx=qe)AQeGGVFr)Jcxrd#lZaQ>I~=qcjHlD#~F$^g%cD!a)c_@9YeR zw@D*6Rpx0Yo!I`g?WC9%41!Hxe2VH87^19cQ|&&jx-X20G0m2vAPC)-=wDb2S1b;@NamCBqc z_Yw)c<>e+?k5weSW+i@7^^@v-N~(7u=%-RYmHu<7)Wg}V1Uh}^>fIf4R@$5;DUvKb zZ+R(FLjJ7IGhAKcONbyF0v;V(V8{sNa|ynbWyFGyg#Q_k;Ra^2eXvA%MP;p z|K7R(|9>!pv-z0 xqZz;SAf9*U!RdkDI)c^#A_+|0m{eaUB2v literal 12292 zcmeHNYit}>6+XvaCo|riWb$wxPGW6v+c?Fky|LGhV`$c|IBuN8)UP;6TE>>=Zw z?ar*7)EHa|AsPzhS>7N@`k=f;(;@@~QmB9;e$Z5Eic}$$KOkrkAXEeb&b@bLJzlQ? zQ4%$DW;Ju?o^$V=nX_l+p6|N{0I)N!#Q^F6K%$+MY6Kuu2@nla#kVm%+m~$RBthD@ z(@y6qK-#pYvnkU`EomDF0t*Bdcx_prjBba$zaiSo!G@gw{VlsYl{F39X>5ER%gRF) zD^^N!WjLa&>OIiAA(A+1q^-=Lai>16uC^zwnLerx+I8!zHf-Fq{f0L-#`o^)I-0horu2+spVVlC z{-o_3$?6$hJI<Ids~{Xrt3&vHdk-i zx~(Rn3{x}x%o?RYiYlo;l0ra;R&sl$2O z$(7cU)O{^dGqyLaz2dzVmwm5AWw1;GG7~4tK3&^Aeqren7bLK z;hdFZ_8V6>&d$c#;`PyZ(_DRYwzajfKHA*WGB>AwT9UTV!?^~RispOL1Y2N%zyhy# z3$X7)ly+7o+;U!&{L?`P7D6yR3nBPM=Y#{eEb5jCx11Lx?@E1mS1LtUbRhT6jWz@1G{}FwCZ<5t2!8_z)S>h4gaHHZs96k0Ov{;o@aV6mocr( z1WDLOBjg5*jxU(|%e52CZJM3k9go#VceTU{(OgSYoT9l5MRPmj9f!uUbLZ~={P_nS zeCXjPe<=PCbibCcPSgv>r~C#X(q=%AHf8Vg4B`iUVP#ckSNF!A{UuS@)qsCKv{?f5 z$+Gmw>P_1?%4@s%5`%r=s_;e+fE5F?V-!MX90uWXGJ|Fu*@<4&%2t`+*kYK+##5@5 zs3iGuqUcboTrU$~cTh51kyNmGrDTGzwJ(662 zs6y7RyqUqpBD^Ye)k=pXjWI;pp=r8Sn;1&)|F;14eDKdj#WXoG{MQJb^ctQdgmf0( z1NU+KcL5%Q$KfJ84bQ-3coANLm*EfaM|g#hU>Sz60@vae+=|->5AMb$LWC{Yj@{Tp zxbOg>!V!)NkKyfT5F#{jiV)%3@f|o%NbrLk3Eqbf;8*ag_%-|%K8ZiYXYmE$j|Jq{ zE9%}6e@SPB*LHzgEc@^>UfO%0Prc>3*RGfPDT(WEY-nz~d4ZDPUg&qQ<%ozPUs&v` zjFM1l!qMe?Ur-eib9;3qXBomZ;p=2s1zu5hC_5#30n{>~t5M@#;(y|$|HemuLLT}Y{0e?e9{MNv z8-{TcZs#mT8?h7#>>{t+k4JC---3gjr5Go#OmUVXgBISwS&BLGPUf5E@E&|G-pg5v zPvWQWGn}P(1iy%1#>en+{HEuv!Yd2DdeHMyQF31{_-fJABlD@}3>~w?NTlI3*uF{V z+F}%%W3Bbkws>I^*=aLH z3lpqO2sB!0NiT|2t}VFS+Dws3Q@o9ZD)FW!TKtIZc~x-PHAqP-UE%1U@Nf85tO_#! zzg0Bwo`EwC-BNdjVKr?}|zU?Ve_VT>4xo*iIP*J^OpsM-KQno~uDAm1GG@kW0Rdf?|?s zeN`mlBa@1GCJ%#iWX}+{%z2y5)k)g+IgR z@G?G+FXC_UcjU0N6)=3CsC!3z`E`W<>7gscgV(Y3|DNUZ|2*>qWnh880{@2=z)<&K zcPBlV$J7-+BU@{a(tbPbY-8=_MajF+!Cj8$I=&Q7GI!B|%M#R_^_v$Z??!de?W!dK Yyt<6SVE$i}*ci 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..2effc6f --- /dev/null +++ b/README.textile @@ -0,0 +1,164 @@ +h1. oui_player (formerly oui_video) + +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 as extensions + +* "Abc News":http://abcnews.go.com/video: "oui_player_abcnews":https://github.com/oui-textpattern/oui_player_abcnews; +* "Archive":https://archive.org/: "oui_player_archive":https://github.com/oui-textpattern/oui_player_archive; +* "Bandcamp":https://bandcamp.com/: "oui_player_bandcamp":https://github.com/oui-textpattern/oui_player_bandcamp; +* "Dailymotion":http://www.dailymotion.com/: "oui_player_dailymotion":https://github.com/oui-textpattern/oui_player_dailymotion; +* "Mixcloud":https://www.mixcloud.com/: "oui_player_mixcloud":https://github.com/oui-textpattern/oui_player_mixcloud; +* "Myspace videos":https://myspace.com/myspace/videos: "oui_player_myspace":https://github.com/oui-textpattern/oui_player_myspace; +* "Soundcloud":https://soundcloud.com/: "oui_player_soundcloud":https://github.com/oui-textpattern/oui_player_soundcloud; +* "Twitch":https://www.twitch.tv/: "oui_player_twitch":https://github.com/oui-textpattern/oui_player_twitch; +* "Viddsee":https://www.viddsee.com/: "oui_player_viddsee":https://github.com/oui-textpattern/oui_player_viddsee; +* "Vimeo":http://www.vimeo.com/: "oui_player_vimeo":https://github.com/oui-textpattern/oui_player_vimeo; +* "Vine":http://vine.co/: "oui_player_vine":https://github.com/oui-textpattern/oui_player_vine; +* "Youtube":https://www.youtube.com/: "oui_player_youtube":https://github.com/oui-textpattern/oui_player_youtube. + +h2. Plugin requirements + +oui_player's minimum requirements: + +* "Textpattern CMS":http://textpattern.com/ 4.6+. + +h2. Installation + +h3. 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 enables, 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. + +h3. Via Composer + +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 oui/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. + +h2. Update + +h3. From the admin interface + +Follow the installation instruction above. +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 untouch. + +h3. Via Composer + +bc. $ composer update oui/oui_player + +h2. Uninstall + +h3. 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. + +h3. Via Composer + +bc. $ composer remove oui/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 =: +- @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. + +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 =: diff --git a/docs/main/Dev.textile b/dev_docs/Dev.textile similarity index 93% rename from docs/main/Dev.textile rename to dev_docs/Dev.textile index 427e592..776f1a1 100644 --- a/docs/main/Dev.textile +++ b/dev_docs/Dev.textile @@ -1,5 +1,3 @@ -notextile.
- h2. For Developpers h3. Using plugin classes and methods @@ -33,5 +31,3 @@ 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/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/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..bea4d4c 100755 --- a/manifest.json +++ b/manifest.json @@ -1,61 +1,22 @@ { "name" : "oui_player", "description" : "Embed customised players", - "version" : "1.4.0-dev", + "version" : "2.0.0-dev", "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" + "./docs/main/Tags.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 75a4a381a7bf248e7c04a1149c7bfdcbc5fd095c..d33c5a5a2d8e138f2cab28ae6fbdf0607e1a6153 100644 GIT binary patch literal 6148 zcmeHK!AiqG5Pe%Kq}4-?9`_3b{~#^(;7#xcG>zCoG^JX>TmD?%>_(WN z!abJwaDL6atecXn`D;hgCdRl#jT^k+7VGyj|2F2BF>5q60C7lj z63(TUkeFy#7`BRBp#%*jYG|+)BWO77(fkU-R#C$dtoaC*Iar4hQg*&SCU=BF(MM;% z8R#-_ppUuK|MRc=|89^!IRnnXzhWQ^XIHZ+w`8@ow>hb`k$O!P5x-V(8^TE{#q^a@ cd_qk^dz1;WFl-fRq4xI>;M1& literal 8196 zcmeHMTWl0n82`b?m z+PJ<6DlZZx8eY7BqKPj8Ufx8F3Hnww@L+t<7hg0{A9yhFKXYcA(%QGiG-1x>obSwk zIp^%RUuW`90RTJ3^@jnf0YIY8k(JT#AC3EYU(h0frGyYEAHaZYYQoK=EGM-fIy8g~ zgbaiXgbaiXgbXYP2I!g1o3zMtUwFeYWFTbVu4I7UAEMMb#ska?^lu$B_$2^gF`4~F zbE*UUoM?dY0P_OW2fy z1%_kDK*+#C26*jW3K_6KgUNaI`|VW5GF>kgyNQva;*!!8lDx8ve^|xJr~5{oi9S#B z#@!ArJM3SXx{(Uzy_z>#nD;x5H9OZ*M@(ZP$yRqdwx^l4k)4w|GGN-eGtuFU+qyf_ zC)OJswX`1?%uJto>+N^my?E)p>t6{TFu0dMmEtXA5lIn!}c&-qX?9wMN;KWUKh;4`w{mvE3s^)+J1`a+he_mv-#n+a*~=TC>vQ zmgX7lmepsTGTec*V~vm5E{{%U9n0!B5t?VXD+L9+SkfqDz)pZ*hw!~TeUBi zrb+!SokJ|KQQ0grSMEPSG7za-m4_sz%ZDv3Wmv-0q%=!xzdVo=913HV(k97?v@Sst$5{yRI9$B-O_U^S%b^;~Ra1dI11( zeLNP-C8&cY=z;_sgDgzJD{vk@fREuST!T;GI(!Q=a0`Bc-{BAV6aIqR7{MYe!BVWm zTCBtMxEZ%$Gj7LL+=<<|2lwJWd=dvRfkQZq8a|6Ba13qC;q#cs7w`t?1 zNBAjzhM(h?_#OU$KZ-L&3KH%qoL35Oq z43AdUD`m3mPt^u>qeOoKEFwHx)U90LtVnocN)y*ID-qrnrIm}F6$|eUWha+4D;1Z! z)pjmkCW+t%wOf`LE`?5SkV5NUD* zk79C;GBY@dr|>zPCWXF;r|~6x8PAeF&*K~TCSD+&Uc&eBGJc3x@G4#-&3=J5a0b5@ zx}4SPesNtG@u&HE&Glt%%dwA>y`b?zaEMF8K#^Fcn%Do`i@*P0n$5yhLIy$xmL&sN z+|}3BK}TEcM$2pMDD`91dE;?;fqn`NemPF)m*a%9|1hL^ltOtplugProviders(); - if (!empty($_POST[$pref]) || (!isset($_POST[$pref]) && \get_pref($pref))) { - \add_privs('prefs.' . $group, self::$privs); - } + if (static::$providers) { + $this->setPrefs(); + $this->deleteOldPrefs(); + } else { + $this->uninstall(); } } - /** - * Plugin lifecycle events handler. - * - * @param string $evt Textpattern event - * @param string $stp Textpattern step - * @see setPrefs() - * deleteOldPrefs() - * \safe_delete() - */ - - public function lifeCycle($evt, $stp) + public function uninstall() { - switch ($stp) { - case 'installed': - $this->setPrefs(); - $this->deleteOldPrefs(); - break; - case 'deleted': - \safe_delete('txp_prefs', "event LIKE '" . static::$plugin . "%'"); - \safe_delete('txp_lang', "owner = '" . static::$plugin . "'"); - break; - } + \safe_delete('txp_prefs', "event LIKE '" . static::$plugin . "%'"); } /** @@ -149,7 +141,7 @@ private static function prefWidget($options) * @param string $name The preference name (Txp var) * @param string $val The preference value (Txp var) * @return string HTML - * @see getPrefs() + * @see GetAllPrefs() * \gtxt() * \selectInput() * \fInput() @@ -157,7 +149,7 @@ private static function prefWidget($options) public static function prefFunction($name, $val) { - $prefs = self::getPrefs(); + $prefs = self::GetAllPrefs(); $valid = $prefs[$name]['valid']; if (is_array($valid)) { @@ -220,16 +212,34 @@ public static function truefalseradio($field, $checked = '', $tabindex = 0, $id } /** + * $allPrefs property setter * Collects plugin prefs * - * @return array Preferences - * @see getPrefs() + * @return array $allPrefs + * @see getAllPrefs() */ - public static function getPrefs() + public static function PlugProviders() + { + return static::$providers = \callback_event(static::$plugin, 'plug_providers', 0, 'Provider'); + } + + /** + * $allPrefs property setter + * Collects plugin prefs + * + * @return array $allPrefs + * @see getAllPrefs() + */ + + public static function SetAllPrefs() { $prefs = array(); + static::$prefs['provider']['valid'] = static::$providers; + static::$prefs['provider']['default'] = static::$prefs['provider']['valid'][0]; + static::$prefs['providers']['default'] = implode(', ', static::$prefs['provider']['valid']); + // Collects the plugin main prefs. foreach (static::$prefs as $pref => $options) { $options['group'] = static::$plugin; @@ -238,6 +248,14 @@ public static function getPrefs() } foreach (static::$providers as $provider) { + // Adds privilieges to provider prefs only if they are enabled. + $group = static::$plugin . '_' . strtolower($provider); + $pref = $group . '_prefs'; + + if (!empty($_POST[$pref]) || (!isset($_POST[$pref]) && \get_pref($pref))) { + \add_privs('prefs.' . $group, self::$privs); + } + // Adds a pref per provider to display/hide its own prefs group. $options = array( 'default' => '0', @@ -249,24 +267,38 @@ public static function getPrefs() // Collects provider prefs. $class = __NAMESPACE__ . '\\' . $provider; - $prefs = $class::getPrefs($prefs); + $prefs = $class::GetPrefs($prefs); } - return $prefs; + return static::$allPrefs = $prefs; + } + + /** + * $allPrefs property getter + * + * @return array $allPrefs + * @see setAllPrefs() + */ + + public static function GetAllPrefs() + { + static::$allPrefs or self::SetAllPrefs(); + + return static::$allPrefs; } /** * Set plugin prefs. * - * @see getPrefs() + * @see GetAllPrefs() * \get_pref() * \set_pref() * prefWidget() */ - private function setPrefs() + public function setPrefs() { - $prefs = $this->getPrefs(); + $prefs = $this->GetAllPrefs(); $position = 250; foreach ($prefs as $pref => $options) { @@ -296,13 +328,13 @@ private function setPrefs() /** * Deletes old unused plugin prefs. * - * @see getPrefs() + * @see GetAllPrefs() * \safe_delete() */ private function deleteOldPrefs() { - $prefs = $this->getPrefs(); + $prefs = $this->GetAllPrefs(); \safe_delete( 'txp_prefs', diff --git a/src/player/Player.php b/src/Player.php similarity index 92% rename from src/player/Player.php rename to src/Player.php index 94e319b..f1837d4 100644 --- a/src/player/Player.php +++ b/src/Player.php @@ -7,7 +7,7 @@ * * https://github.com/NicolasGraph/oui_player * - * Copyright (C) 2016-2017 Nicolas Morand + * Copyright (C) 2016-2018 Nicolas Morand * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES @@ -104,8 +104,12 @@ class Player 'widget' => 'Oui\Player\Admin::customFields', 'default' => 'article_image', ), - 'provider' => array(), - 'providers' => array(), + 'provider' => array( + 'default' => '', + ), + 'providers' => array( + 'default' => '', + ), ); } } diff --git a/src/player/providers/Provider.php b/src/Provider.php similarity index 99% rename from src/player/providers/Provider.php rename to src/Provider.php index 7640055..1ba465a 100644 --- a/src/player/providers/Provider.php +++ b/src/Provider.php @@ -7,7 +7,7 @@ * * https://github.com/NicolasGraph/oui_player * - * Copyright (C) 2016-2017 Nicolas Morand + * Copyright (C) 2016-2018 Nicolas Morand * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES @@ -200,7 +200,6 @@ public function getProvider() return array(substr(strrchr(get_class($this), '\\'), 1)); } - /** * Embeds the provider script. */ diff --git a/src/player/Public.php b/src/Public.php similarity index 99% rename from src/player/Public.php rename to src/Public.php index 1e29ff9..fbe42d5 100644 --- a/src/player/Public.php +++ b/src/Public.php @@ -7,7 +7,7 @@ * * https://github.com/NicolasGraph/oui_player * - * Copyright (C) 2016-2017 Nicolas Morand + * Copyright (C) 2016-2018 Nicolas Morand * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 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}' => '