diff options
72 files changed, 37116 insertions, 0 deletions
@@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. 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 +them 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 prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. 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. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/README.md b/README.md new file mode 100644 index 0000000..374d027 --- /dev/null +++ b/README.md @@ -0,0 +1,158 @@ +LibreVideoJS +================== + +LibreVideoJS es un reproductor de Vídeo escrito en JavaScript compatible con [LibreJS](https://www.gnu.org/software/librejs/index.html), construido con una tipografía personalizada en Material Desing para un mundo Libre. + +Repositorio de los archivos bases sin modificación. + +* [Base en VideoJS](https://github.com/videojs/video.js) + +## Guía de inicio rápido + +1. Para poder utilizar el programa en Internet deberás tener un servidor GLAMP, WAMP o MAMP, o si deseas solo probarlo, puedes descargar [LibreVideoJS](https://notabug.org/Heckyel/LibreVideoJS/archive/master.tar.gz) y ejecutar un [demo](demo-mix-multicolors.html) con tu Navegador Libre Favorito. +2. Clona el repositorio en cualquier carpeta del servidor o en tu directorio local (e.g. git clone https://notabug.org/Heckyel/LibreVideoJS.git /var/www/html/LibreVideoJS). +3. Agrega o combina los directorios `css`, `fonts` y `js` en la raíz del servidor web. +4. Agrega los enlaces de los archivos CSS y JavaScript en la cabecera del archivo HTML o PHP de la siguiente forma: + +`<head>`: + +```html +<link href="https://tudominio.example/css/librevideojs-material/libre-skin-teal.css" rel="stylesheet"/> +<link href="https://tudominio.example/css/selector/video-quality-selector.css" rel="stylesheet"> +<script src="https://tudominio.example/js/cliplibrejs.dev.js"></script> +``` +* Puedes usar ```https``` o ```http```, según sea el caso de tu sitio web. + +Entonces, cada vez que desee utilizar LibreVideoJS puede simplemente usar la etiqueta ` '<video>' ` como lo haría normalmente. +Soporta los formatos más utilizados como WEBM, OGV y MP4 (No romendado el formato MP4 por cuestiones de patentes). + +```html +<video id="example" controls preload="none" poster="images/poster.jpg" data-setup="{}"> + <source data-res="1080p" src="video/libre1920x1080.ogv" type="video/ogg"> + <source data-res="720p" src="video/libre1280x720.ogv" type="video/ogg"> + <source data-res="480p" src="video/libre640x480.ogv" type="video/ogg"> + <source data-res="240p" src="video/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="video/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="subtitles/libre_en.vtt" srclang="en" label="English"/> + <track kind="captions" src="subtitles/libre_es.vtt" srclang="es" label="Español" default/> + <track kind="subtitles" src="subtitles/libre_en.vtt" srclang="en" label="English"/> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> +</video> +``` +Debajo, el siguiente script añade los estilos al reproductor de vídeo solo cuando JavaScript esta habilitado, y sino esta habilitado muestra +el reproductor de vídeo por defecto del navegador. + +```html +<script> +// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later +var estilos = document.getElementById("example"); +estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-default-skin"; +// @license-end +</script> +``` + +Si desea que el reproductor pueda cambiar de resoluciones puede ingresar más abajo el siguiente código JavaScript + +```html +<script> +// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later +cliplibrejs('#example',{plugins:{resolutionSelector:{force_types:['video/webm','video/ogg'],default_res:"360p"}},nativeControlsForTouch: false}); +// @license-end +</script> +``` +¡Funcionalidad de Responsive Web Desing es automático desde CSS! + +Si desea funcionalidad de hotkeys ingrese este código: +```html +<script> +// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later +cliplibrejs('#example').ready(function(){this.hotkeys({volumeStep: 0.1,seekStep: 5,enableMute: true,enableFullscreen: true,enableNumbers: true});}); +// @license-end +</script> +``` + +Si desea combinar las dos funciones anteriores, puede usar el código simplificado: +```html +<script> +// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later +cliplibrejs('#example',{plugins:{resolutionSelector:{force_types:['video/webm','video/ogg'],default_res:"480p",}}, nativeControlsForTouch:false}).ready(function(){this.hotkeys({volumeStep:0.1,seekStep:5,enableMute:true, enableFullscreen:true,enableNumbers:true,});}); +// @license-end +</script> +``` +### Instalación vía Bower + +```html +bower install librevideojs +``` + +### ProgreesTips +Es el __globo de tiempo__ que aparece al pasar el cursor en la barra de progreso de LibreVideoJS, esta funcionalidad +solo es posible con [jQuery 2.1.1 o superior](https://jquery.com/). Tiene un [demo](demo-progreestips.html) para observar su funcionamiento. + +También hay un screenshot para pre-visualizar ProgreesTips. + + +Para hacer funcionar ProgreesTips es necesario tener el archivo JavaScript [cliplibrejs.developer.js](js/cliplibrejs.developer.js) reemplazando al archivo JavaScript __cliplibrejs.dev.js__. + +Para implementarlo agregamos en el `<head>` lo siguiente: + +```html +<link rel="stylesheet" href="https://tudominio.example/css/proggrestips/proggrestips.css"> +<script src="https://tudominio.example/js/cliplibrejs.developer.js"></script> +``` + +Y luego agregamos antes de la etiqueta ``</body>`` el siguiente código JavaScript +```html +<script> +// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later +cliplibrejs( '#example', {}, function() {this.progressTips();} ); +// @license-end +</script> +``` +Si desea combinar dos funciones `Hotkeys + ProgreesTips`, puede usar el código simplificado: + +```html +<script> +// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later +cliplibrejs("#example",{plugins:{resolutionSelector:{force_types:["video/webm","video/ogg"],default_res:"480p"}},nativeControlsForTouch:false}).ready(function(){this.hotkeys({volumeStep:0.1,seekStep:5,enableMute:true,enableFullscreen:true,enableNumbers:true}),this.progressTips()}); +// @license-end +</script> +``` + +Si desea combinar las Tres funciones `Quality Selector + Hotkeys + ProgreesTips`, puede usar el código simplificado: +```html +<script> +// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later +cliplibrejs("#example",{plugins:{resolutionSelector:{force_types:["video/webm","video/ogg"],default_res:"480p",}},nativeControlsForTouch:false}).ready(function(){this.hotkeys({volumeStep:0.1,seekStep:5,enableMute:true,enableFullscreen:true,enableNumbers:true,}),this.progressTips()}); +// @license-end +</script> +``` + +_Si desea ver una demostración de LibreVideoJS puede visitar [ConocimientosLibres](https://www.conocimientoslibres.tuxfamily.org), [Freakspot.net](https://www.freakspot.net/locutus-de-gnu/)_ + +## Demos ++ [demo](demo.html) ++ [demo-custom-material-multicolors](demo-custom-material-multicolors.html) ++ [demo-custom-material](demo-custom-material.html) ++ [demo-custom-skin](demo-custom-skin.html) ++ [demo-default-progreestips](demo-default-progreestips.html) ++ [demo-mix-material](demo-mix-material.html) ++ [demo-mix-multicolors](demo-mix-multicolors.html) ++ [demo-progreestips-multicolors](demo-progreestips-multicolors.html) ++ [demo-progreestips](demo-progreestips.html) ++ [example-hotkeys](example-hotkeys.html) + +## Contribuir +LibreVideoJS es una librería de [Software Libre](https://www.gnu.org/), y apreciamos cualquier ayuda que estés dispuesto a dar. + +También puede visitar [goblinrefuge](https://goblinrefuge.com/mediagoblin/u/cybersy/m/librevideojs/), donde encontrará un vídeo mostrando su funcionalidad. + +## Licencia + +LibreVideoJS esta bajo la licencia GNU GPLv3+ [Ver el archivo de licencia](LICENSE) + +[Escrito en GNU/Linux-Libre](https://www.gnu.org/distros/free-distros.es.html) +* Contributor: Jesús Eduardo +* City: Tumbes +* Country: Perú +* FullYear: 2017 diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..fe4f626 --- /dev/null +++ b/bower.json @@ -0,0 +1,19 @@ +{ + "name": "librevideojs", + "authors": [ + "Jesús Eduardo <heckyel@hyperbola.info>" + ], + "description": "Un reproductor de vídeo HTML5 y con un tema en material desing.", + "version": "2.1.0", + "main": [ + "./js/cliplibrejs.developer.js", + "./js/cliplibre-js.dev.css" + ], + "keywords": [ + "html5", + "video", + "player" + ], + "license": "GPL3", + "homepage": "https://git.tuxfamily.org/lablibre/security.git" +} diff --git a/css/default/cliplibre-js-progreestips.dev.css b/css/default/cliplibre-js-progreestips.dev.css new file mode 100644 index 0000000..83691c5 --- /dev/null +++ b/css/default/cliplibre-js-progreestips.dev.css @@ -0,0 +1,730 @@ +/*! +Video.js Default Styles (http://videojs.com) +Version 4.3.1 +Create your own skin at http://designer.videojs.com +*/ + +.librevjs-default-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"VideoJS"; + src: url("../../fonts/default/vjs.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/default/vjs.woff") format("woff"), + url("../../fonts/default/vjs.ttf") format("truetype"), + url("../../fonts/default/vjs.svg") format("svg"); + font-weight:400; + font-style:normal +} + +.librevjs-default-skin .librevjs-slider { + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + background-color: #333; + background-color: rgba(51, 51, 51, .9) +} + +.librevjs-default-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + +.librevjs-default-skin .librevjs-slider-handle { + position: absolute; + left: 0; + top: 0 +} + +.librevjs-default-skin .librevjs-slider-handle:before { + content: "\e009"; + font-family: VideoJS; + font-size: 1em; + line-height: 1; + text-align: center; + text-shadow: 0 0 1em #fff; + position: absolute; + top: 0; + left: 0; + -webkit-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg) +} + +.librevjs-default-skin .librevjs-control-bar { + display: none; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 3em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7) +} + +.librevjs-default-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-default-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-default-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-default-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-default-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-default-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-default-skin .librevjs-control:before { + font-family: VideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + +.librevjs-default-skin .librevjs-control:focus:before, .librevjs-default-skin .librevjs-control:hover:before { + text-shadow: 0 0 1em #fff +} + +.librevjs-default-skin .librevjs-control:focus {} + +.librevjs-default-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + +.librevjs-default-skin .librevjs-play-control { + width: 5em; + cursor: pointer +} + +.librevjs-default-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-default-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + +.librevjs-default-skin .librevjs-mute-control, .librevjs-default-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-default-skin .librevjs-mute-control:before, .librevjs-default-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-default-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-default-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-default-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-default-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-default-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-default-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-default-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-default-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-default-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + +.librevjs-default-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: .5em; + background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat +} + +.librevjs-default-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-default-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-default-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-default-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-default-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-default-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-default-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-default-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-default-skin .librevjs-play-progress { + background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat +} + +.librevjs-default-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-default-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-default-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-default-skin .librevjs-time-controls { + font-size: 1em; + line-height: 3em +} + +.librevjs-default-skin .librevjs-current-time { + float: left +} + +.librevjs-default-skin .librevjs-duration { + float: left +} + +.librevjs-default-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-default-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-default-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-default-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play*/ + +.librevjs-default-skin .librevjs-big-play-button { + left: 50%; + /*por defecto left:.5em;*/ + top: 50%; + /*por defecto top:.5em;*/ + margin: -1.5em auto auto -2em; + /*por defecto esta linea no existe*/ + font-size: 3em; + display: block; + z-index: 2; + position: absolute; + width: 4em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + border: .1em solid #3b4249; + -webkit-border-radius: .8em; + -moz-border-radius: .8em; + border-radius: .8em; + -webkit-box-shadow: 0 0 1em rgba(255, 255, 255, .25); + -moz-box-shadow: 0 0 1em rgba(255, 255, 255, .25); + box-shadow: 0 0 1em rgba(255, 255, 255, .25); + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-default-skin.librevjs-big-play-centered .librevjs-big-play-button { + left: 50%; + margin-left: -2.1em; + top: 50%; + margin-top: -1.4000000000000001em +} + +.librevjs-default-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none +} + +.librevjs-default-skin.librevjs-has-started .librevjs-big-play-button { + display: none +} + +.librevjs-default-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none +} + +.librevjs-default-skin:hover .librevjs-big-play-button, .librevjs-default-skin .librevjs-big-play-button:focus { + outline: 0; + border-color: #fff; + background-color: #505050; + background-color: rgba(50, 50, 50, .75); + -webkit-box-shadow: 0 0 3em #fff; + -moz-box-shadow: 0 0 3em #fff; + box-shadow: 0 0 3em #fff; + -webkit-transition: all 0s; + -moz-transition: all 0s; + -o-transition: all 0s; + transition: all 0s +} + +.librevjs-default-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: VideoJS; + line-height: 2.6em; + text-shadow: .05em .05em .1em #000; + text-align: center; + position: absolute; + left: 0; + width: 100%; + height: 100% +} + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-default-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: VideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-default-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-default-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-default-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-default-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-default-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + +.librevjs-default-skin .librevjs-menu-button ul li.librevjs-selected { + background-color: #000 +} + +.librevjs-default-skin .librevjs-menu-button ul li:focus, .librevjs-default-skin .librevjs-menu-button ul li:hover, .librevjs-default-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-default-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #111; + background-color: #fff; + background-color: rgba(255, 255, 255, .75); + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.librevjs-default-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-default-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-default-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-default-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-default-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 400; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.5em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-default-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + +ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #fff; +} + +ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #fff; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} +.librevjs-progress-tip { + visibility: hidden; + display: block; + opacity: 0.8; + padding: 5px; + font-size: 10px; + position: absolute; + z-index: 100000; +} + +.librevjs-progress-tip-arrow { + background: url(data:image/gif;base64,R0lGODlhCQAJAIABAAAAAAAAACH5BAEAAAEALAAAAAAJAAkAAAIRjAOnwIrcDJxvwkplPtchVQAAOw==) no-repeat top left; + bottom: 0; + left: 50%; + margin-left: -4px; + background-position: bottom left; + position: absolute; + width: 9px; + height: 5px; +} + +.librevjs-progress-tip-inner { + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + padding: 5px 8px 4px 8px; + background-color: black; + color: white; + max-width: 200px; + text-align: center; +} + diff --git a/css/default/cliplibre-js.dev.css b/css/default/cliplibre-js.dev.css new file mode 100644 index 0000000..d14d4a6 --- /dev/null +++ b/css/default/cliplibre-js.dev.css @@ -0,0 +1,698 @@ +/*! +Video.js Default Styles (http://videojs.com) +Version 4.3.1 +Create your own skin at http://designer.videojs.com +*/ + +.librevjs-default-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"VideoJS"; + src: url("../../fonts/default/vjs.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/default/vjs.woff") format("woff"), + url("../../fonts/default/vjs.ttf") format("truetype"), + url("../../fonts/default/vjs.svg") format("svg"); + font-weight:400; + font-style:normal +} + +.librevjs-default-skin .librevjs-slider { + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + background-color: #333; + background-color: rgba(51, 51, 51, .9) +} + +.librevjs-default-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + +.librevjs-default-skin .librevjs-slider-handle { + position: absolute; + left: 0; + top: 0 +} + +.librevjs-default-skin .librevjs-slider-handle:before { + content: "\e009"; + font-family: VideoJS; + font-size: 1em; + line-height: 1; + text-align: center; + text-shadow: 0 0 1em #fff; + position: absolute; + top: 0; + left: 0; + -webkit-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg) +} + +.librevjs-default-skin .librevjs-control-bar { + display: none; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 3em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7) +} + +.librevjs-default-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-default-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-default-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-default-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-default-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-default-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-default-skin .librevjs-control:before { + font-family: VideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + +.librevjs-default-skin .librevjs-control:focus:before, .librevjs-default-skin .librevjs-control:hover:before { + text-shadow: 0 0 1em #fff +} + +.librevjs-default-skin .librevjs-control:focus {} + +.librevjs-default-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + +.librevjs-default-skin .librevjs-play-control { + width: 5em; + cursor: pointer +} + +.librevjs-default-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-default-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + +.librevjs-default-skin .librevjs-mute-control, .librevjs-default-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-default-skin .librevjs-mute-control:before, .librevjs-default-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-default-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-default-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-default-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-default-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-default-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-default-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-default-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-default-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-default-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + +.librevjs-default-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: .5em; + background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat +} + +.librevjs-default-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-default-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-default-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-default-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-default-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-default-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-default-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-default-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-default-skin .librevjs-play-progress { + background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat +} + +.librevjs-default-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-default-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-default-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-default-skin .librevjs-time-controls { + font-size: 1em; + line-height: 3em +} + +.librevjs-default-skin .librevjs-current-time { + float: left +} + +.librevjs-default-skin .librevjs-duration { + float: left +} + +.librevjs-default-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-default-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-default-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-default-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play*/ + +.librevjs-default-skin .librevjs-big-play-button { + left: 50%; + /*por defecto left:.5em;*/ + top: 50%; + /*por defecto top:.5em;*/ + margin: -1.5em auto auto -2em; + /*por defecto esta linea no existe*/ + font-size: 3em; + display: block; + z-index: 2; + position: absolute; + width: 4em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + border: .1em solid #3b4249; + -webkit-border-radius: .8em; + -moz-border-radius: .8em; + border-radius: .8em; + -webkit-box-shadow: 0 0 1em rgba(255, 255, 255, .25); + -moz-box-shadow: 0 0 1em rgba(255, 255, 255, .25); + box-shadow: 0 0 1em rgba(255, 255, 255, .25); + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-default-skin.librevjs-big-play-centered .librevjs-big-play-button { + left: 50%; + margin-left: -2.1em; + top: 50%; + margin-top: -1.4000000000000001em +} + +.librevjs-default-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none +} + +.librevjs-default-skin.librevjs-has-started .librevjs-big-play-button { + display: none +} + +.librevjs-default-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none +} + +.librevjs-default-skin:hover .librevjs-big-play-button, .librevjs-default-skin .librevjs-big-play-button:focus { + outline: 0; + border-color: #fff; + background-color: #505050; + background-color: rgba(50, 50, 50, .75); + -webkit-box-shadow: 0 0 3em #fff; + -moz-box-shadow: 0 0 3em #fff; + box-shadow: 0 0 3em #fff; + -webkit-transition: all 0s; + -moz-transition: all 0s; + -o-transition: all 0s; + transition: all 0s +} + +.librevjs-default-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: VideoJS; + line-height: 2.6em; + text-shadow: .05em .05em .1em #000; + text-align: center; + position: absolute; + left: 0; + width: 100%; + height: 100% +} + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-default-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: VideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-default-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-default-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-default-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-default-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-default-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + +.librevjs-default-skin .librevjs-menu-button ul li.librevjs-selected { + background-color: #000 +} + +.librevjs-default-skin .librevjs-menu-button ul li:focus, .librevjs-default-skin .librevjs-menu-button ul li:hover, .librevjs-default-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-default-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #111; + background-color: #fff; + background-color: rgba(255, 255, 255, .75); + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.librevjs-default-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-default-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-default-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-default-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-default-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 400; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.5em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-default-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + +ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #fff; +} + +ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #fff; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} diff --git a/css/libre-custom-skin/custom_skin.azul.css b/css/libre-custom-skin/custom_skin.azul.css new file mode 100644 index 0000000..8e94cc4 --- /dev/null +++ b/css/libre-custom-skin/custom_skin.azul.css @@ -0,0 +1,725 @@ +/*! +LibreVideoJS. custom Styles +Version 0.2 +*/ + +.librevjs-custom-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"VideoJS"; + src: url("../../fonts/default/vjs.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/default/vjs.woff") format("woff"), + url("../../fonts/default/vjs.ttf") format("truetype"), + url("../../fonts/default/vjs.svg") format("svg"); + font-weight:400; + font-style:normal +} + +.librevjs-custom-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-custom-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-custom-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-custom-skin .librevjs-slider-handle:before { + width: 0; + height: 0; +} + + +/* control bar + * */ + +.librevjs-custom-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-custom-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-custom-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-custom-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-custom-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-custom-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-custom-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-custom-skin .librevjs-control:before { + font-family: VideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + +.librevjs-custom-skin .librevjs-control:focus:before, .librevjs-custom-skin .librevjs-control:hover:before { + text-shadow: 0 0 1em #fff +} + +.librevjs-custom-skin .librevjs-control:focus {} + +.librevjs-custom-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + +.librevjs-custom-skin .librevjs-play-control { + width: 5em; + cursor: pointer +} + +.librevjs-custom-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-custom-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + +.librevjs-custom-skin .librevjs-mute-control, .librevjs-custom-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-custom-skin .librevjs-mute-control:before, .librevjs-custom-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-custom-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-custom-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-custom-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-custom-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #005df3 url() -50% 0 repeat; +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-custom-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-custom-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-custom-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-custom-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-custom-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-custom-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-custom-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-custom-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color azul */ + +.librevjs-custom-skin .librevjs-play-progress { + background: #005df3 url() -50% 0 repeat; +} + +.librevjs-custom-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-custom-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-custom-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-custom-skin .librevjs-time-controls { + font-size: 1em; + line-height: 3em +} + +.librevjs-custom-skin .librevjs-current-time { + float: left +} + +.librevjs-custom-skin .librevjs-duration { + float: left +} + +.librevjs-custom-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-custom-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-custom-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-custom-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-custom-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.4em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 2.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Optionally center */ + +.librevjs-custom-skin.librevjs-big-play-centered .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.4em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; +} + + +/* Hide if controls are disabled */ + +.librevjs-custom-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-custom-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-custom-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-custom-skin:hover .librevjs-big-play-button, .librevjs-custom-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: #005DF3; + color: #FFFFFF; +} + +.librevjs-custom-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: VideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-custom-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: VideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-custom-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-custom-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-custom-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-custom-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-custom-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(255, 255, 255); + background-color: rgb(0, 93, 243); +} + +.librevjs-custom-skin .librevjs-menu-button ul li:focus, .librevjs-custom-skin .librevjs-menu-button ul li:hover, .librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #ffffff; + background-color: #005DF3; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-custom-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-custom-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-custom-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-custom-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-custom-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 400; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.5em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-custom-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} diff --git a/css/libre-custom-skin/custom_skin.rojo.css b/css/libre-custom-skin/custom_skin.rojo.css new file mode 100644 index 0000000..32ee409 --- /dev/null +++ b/css/libre-custom-skin/custom_skin.rojo.css @@ -0,0 +1,726 @@ +/*! +LibreVideoJS. custom Styles +Version 0.2 +*/ + +.librevjs-custom-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"VideoJS"; + src: url("../../fonts/default/vjs.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/default/vjs.woff") format("woff"), + url("../../fonts/default/vjs.ttf") format("truetype"), + url("../../fonts/default/vjs.svg") format("svg"); + font-weight:400; + font-style:normal +} + +.librevjs-custom-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-custom-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-custom-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-custom-skin .librevjs-slider-handle:before { + width: 0; + height: 0; +} + + +/* control bar + * */ + +.librevjs-custom-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-custom-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-custom-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-custom-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-custom-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-custom-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-custom-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-custom-skin .librevjs-control:before { + font-family: VideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + +.librevjs-custom-skin .librevjs-control:focus:before, .librevjs-custom-skin .librevjs-control:hover:before { + text-shadow: 0 0 1em #fff +} + +.librevjs-custom-skin .librevjs-control:focus {} + +.librevjs-custom-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + +.librevjs-custom-skin .librevjs-play-control { + width: 5em; + cursor: pointer +} + +.librevjs-custom-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-custom-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + +.librevjs-custom-skin .librevjs-mute-control, .librevjs-custom-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-custom-skin .librevjs-mute-control:before, .librevjs-custom-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-custom-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-custom-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-custom-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-custom-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #f44336 url() -50% 0 repeat; +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-custom-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-custom-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-custom-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-custom-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-custom-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-custom-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-custom-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-custom-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color rojo */ + +.librevjs-custom-skin .librevjs-play-progress { + background: #f44336 url() -50% 0 repeat; +} + +.librevjs-custom-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-custom-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-custom-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-custom-skin .librevjs-time-controls { + font-size: 1em; + line-height: 3em +} + +.librevjs-custom-skin .librevjs-current-time { + float: left +} + +.librevjs-custom-skin .librevjs-duration { + float: left +} + +.librevjs-custom-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-custom-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-custom-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-custom-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-custom-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.4em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 2.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Optionally center */ + +.librevjs-custom-skin.librevjs-big-play-centered .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.4em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; +} + + +/* Hide if controls are disabled */ + +.librevjs-custom-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-custom-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-custom-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-custom-skin:hover .librevjs-big-play-button, .librevjs-custom-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: #f44336; + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-custom-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: VideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-custom-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: VideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-custom-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-custom-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-custom-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-custom-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-custom-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(255, 255, 255); + background-color: rgb(244, 67, 54); +} + +.librevjs-custom-skin .librevjs-menu-button ul li:focus, .librevjs-custom-skin .librevjs-menu-button ul li:hover, .librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #ffffff; + background-color: #f44336; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-custom-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-custom-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-custom-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-custom-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-custom-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 400; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.5em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-custom-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} diff --git a/css/libre-custom-skin/custom_skin.teal.css b/css/libre-custom-skin/custom_skin.teal.css new file mode 100644 index 0000000..73ae76e --- /dev/null +++ b/css/libre-custom-skin/custom_skin.teal.css @@ -0,0 +1,726 @@ +/*! +LibreVideoJS. custom Styles +Version 0.2 +*/ + +.librevjs-custom-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"VideoJS"; + src: url("../../fonts/default/vjs.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/default/vjs.woff") format("woff"), + url("../../fonts/default/vjs.ttf") format("truetype"), + url("../../fonts/default/vjs.svg") format("svg"); + font-weight:400; + font-style:normal +} + +.librevjs-custom-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-custom-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-custom-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-custom-skin .librevjs-slider-handle:before { + width: 0; + height: 0; +} + + +/* control bar + * */ + +.librevjs-custom-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-custom-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-custom-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-custom-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-custom-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-custom-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-custom-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-custom-skin .librevjs-control:before { + font-family: VideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + +.librevjs-custom-skin .librevjs-control:focus:before, .librevjs-custom-skin .librevjs-control:hover:before { + text-shadow: 0 0 1em #fff +} + +.librevjs-custom-skin .librevjs-control:focus {} + +.librevjs-custom-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + +.librevjs-custom-skin .librevjs-play-control { + width: 5em; + cursor: pointer +} + +.librevjs-custom-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-custom-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + +.librevjs-custom-skin .librevjs-mute-control, .librevjs-custom-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-custom-skin .librevjs-mute-control:before, .librevjs-custom-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-custom-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-custom-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-custom-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-custom-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-custom-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-custom-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #1de9b6 url() -50% 0 repeat; +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-custom-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-custom-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-custom-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-custom-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-custom-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-custom-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-custom-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-custom-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color azul */ + +.librevjs-custom-skin .librevjs-play-progress { + background: #1de9b6 url() -50% 0 repeat; +} + +.librevjs-custom-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-custom-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-custom-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-custom-skin .librevjs-time-controls { + font-size: 1em; + line-height: 3em +} + +.librevjs-custom-skin .librevjs-current-time { + float: left +} + +.librevjs-custom-skin .librevjs-duration { + float: left +} + +.librevjs-custom-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-custom-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-custom-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-custom-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-custom-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.4em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 2.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Optionally center */ + +.librevjs-custom-skin.librevjs-big-play-centered .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.4em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; +} + + +/* Hide if controls are disabled */ + +.librevjs-custom-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-custom-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-custom-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-custom-skin:hover .librevjs-big-play-button, .librevjs-custom-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: #1de9b6; + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-custom-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: VideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-custom-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: VideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-custom-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-custom-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-custom-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-custom-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-custom-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(1, 56, 47); + background-color: rgb(29, 233, 182); +} + +.librevjs-custom-skin .librevjs-menu-button ul li:focus, .librevjs-custom-skin .librevjs-menu-button ul li:hover, .librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-custom-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #004d40; + background-color: #1de9b6; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-custom-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-custom-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-custom-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-custom-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-custom-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 400; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.5em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-custom-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} diff --git a/css/librevideojs-material/libre-skin-blue.css b/css/librevideojs-material/libre-skin-blue.css new file mode 100644 index 0000000..35e6322 --- /dev/null +++ b/css/librevideojs-material/libre-skin-blue.css @@ -0,0 +1,788 @@ +/*! +LibreVideoJS Estilos personalizados = blue +Version 1.2 +Escrito por Jesús Eduardo +*/ + +.librevjs-libre-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + +.librevjs-libre-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* control bar */ + +.librevjs-libre-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. + */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-libre-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-libre-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-libre-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-libre-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/*COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus:before, .librevjs-libre-skin .librevjs-control:hover:before { + color: #2196F3; +} + + +/*END COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus {} + +.librevjs-libre-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/*Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(33, 150, 244); +} + +.librevjs-libre-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-skin .librevjs-play-control:hover:before { + color: #2980b9; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/*END Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-mute-control, .librevjs-libre-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-mute-control:before, .librevjs-libre-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #2196F3 url() -50% 0 repeat; + /*color de barra volumen*/ +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-libre-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-libre-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-libre-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-libre-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color azul */ + +.librevjs-libre-skin .librevjs-play-progress { + background: #2196F3 url() -50% 0 repeat; +} + +.librevjs-libre-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-libre-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em; +} + +.librevjs-libre-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-skin .librevjs-duration { + float: left +} + +.librevjs-libre-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-libre-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-libre-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-libre-skin .librevjs-big-play-button { + left: 50%; + top: 50%; + font-size: 10em; + display: block; + z-index: 2; + position: absolute; + width: 1em; + height: 1em; + margin-left: -0.5em; + margin-top: -0.5em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + color: #2196F3; + line-height: normal; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-skin:hover .librevjs-big-play-button, .librevjs-libre-skin .librevjs-big-play-button:focus { + color: #0289f4; + /*color boton focus*/ +} + +.librevjs-libre-skin .librevjs-big-play-button:before { + content: "\e007"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-libre-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-libre-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-libre-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-libre-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-libre-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(11, 21, 42); + background-color: rgb(33, 150, 244); +} + +.librevjs-libre-skin .librevjs-menu-button ul li:focus, .librevjs-libre-skin .librevjs-menu-button ul li:hover, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: rgb(11, 21, 42); + background-color: #2196F3; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-libre-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-libre-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-libre-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.8em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-libre-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*title de resolucion | subtitles y Caption*/ + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: rgb(33, 150, 244); +} + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: rgb(11, 137, 237); + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 0.9em; + } + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 5em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 3em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 2em; + } +} diff --git a/css/librevideojs-material/libre-skin-grey.css b/css/librevideojs-material/libre-skin-grey.css new file mode 100644 index 0000000..73fc9d5 --- /dev/null +++ b/css/librevideojs-material/libre-skin-grey.css @@ -0,0 +1,789 @@ +/*! +LibreVideoJS Estilos personalizados = Grey +Version 1.2 +Escrito por Jesús Eduardo +*/ + +.librevjs-libre-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + +.librevjs-libre-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* control bar */ + +.librevjs-libre-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. + */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-libre-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-libre-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-libre-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-libre-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/*COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus:before, .librevjs-libre-skin .librevjs-control:hover:before { + color: #9e9e9e; +} + + +/*END COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus {} + +.librevjs-libre-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/*Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(158, 158, 158); +} + +.librevjs-libre-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-skin .librevjs-play-control:hover:before { + color: #7c7c7c; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/*END Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-mute-control, .librevjs-libre-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-mute-control:before, .librevjs-libre-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #9e9e9e url() -50% 0 repeat; + /*color de barra volumen*/ +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-libre-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-libre-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-libre-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-libre-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color plata */ + +.librevjs-libre-skin .librevjs-play-progress { + background: #9e9e9e url() -50% 0 repeat; +} + +.librevjs-libre-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-libre-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em; +} + +.librevjs-libre-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-skin .librevjs-duration { + float: left +} + +.librevjs-libre-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-libre-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-libre-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-libre-skin .librevjs-big-play-button { + left: 50%; + top: 50%; + font-size: 10em; + display: block; + z-index: 2; + position: absolute; + width: 1em; + height: 1em; + margin-left: -0.5em; + margin-top: -0.5em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + color: #9e9e9e; + line-height: normal; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile +*/ + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-skin:hover .librevjs-big-play-button, .librevjs-libre-skin .librevjs-big-play-button:focus { + color: rgb(115, 115, 115); + /*color boton focus purpura oscuro*/ +} + +.librevjs-libre-skin .librevjs-big-play-button:before { + content: "\e007"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-libre-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-libre-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-libre-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-libre-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-libre-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected { + color: #ffffff; + background-color: rgb(158, 158, 158); +} + +.librevjs-libre-skin .librevjs-menu-button ul li:focus, .librevjs-libre-skin .librevjs-menu-button ul li:hover, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #9e9e9e; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-libre-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-libre-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-libre-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.8em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-libre-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*title de resolucion | subtitles y Caption*/ + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #737373; +} + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #9e9e9e; + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 0.9em; + } + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 5em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 3em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 2em; + } +} diff --git a/css/librevideojs-material/libre-skin-purple.css b/css/librevideojs-material/libre-skin-purple.css new file mode 100644 index 0000000..9b6b6af --- /dev/null +++ b/css/librevideojs-material/libre-skin-purple.css @@ -0,0 +1,789 @@ +/*! +LibreVideoJS Estilos personalizados = Purple +Version 1.2 +Escrito por Jesús Eduardo +*/ + +.librevjs-libre-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + +.librevjs-libre-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* control bar */ + +.librevjs-libre-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. + */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-libre-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-libre-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-libre-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-libre-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/*COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus:before, .librevjs-libre-skin .librevjs-control:hover:before { + color: #9c27b0; +} + + +/*END COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus {} + +.librevjs-libre-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/*Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(156, 39, 176); +} + +.librevjs-libre-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-skin .librevjs-play-control:hover:before { + color: #8e44ad; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/*END Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-mute-control, .librevjs-libre-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-mute-control:before, .librevjs-libre-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #9c27b0 url() -50% 0 repeat; + /*color de barra volumen*/ +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-libre-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-libre-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-libre-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-libre-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color purpura */ + +.librevjs-libre-skin .librevjs-play-progress { + background: #9c27b0 url() -50% 0 repeat; +} + +.librevjs-libre-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-libre-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em; +} + +.librevjs-libre-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-skin .librevjs-duration { + float: left +} + +.librevjs-libre-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-libre-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-libre-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-libre-skin .librevjs-big-play-button { + left: 50%; + top: 50%; + font-size: 10em; + display: block; + z-index: 2; + position: absolute; + width: 1em; + height: 1em; + margin-left: -0.5em; + margin-top: -0.5em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + color: #9c27b0; + line-height: normal; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile +*/ + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-skin:hover .librevjs-big-play-button, .librevjs-libre-skin .librevjs-big-play-button:focus { + color: rgb(142, 68, 173); + /*color boton focus purpura oscuro*/ +} + +.librevjs-libre-skin .librevjs-big-play-button:before { + content: "\e007"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-libre-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + +.librevjs-libre-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected { + color: #fff; + background-color: rgb(156, 39, 176); +} + +.librevjs-libre-skin .librevjs-menu-button ul li:focus, .librevjs-libre-skin .librevjs-menu-button ul li:hover, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #9c27b0; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + +.librevjs-libre-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-libre-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-libre-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute; +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.8em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-libre-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*title de resolucion | subtitles y Caption*/ + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #9c27b0; +} + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #8e44ad; + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 0.9em; + } + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 5em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 3em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 2em; + } +} diff --git a/css/librevideojs-material/libre-skin-red.css b/css/librevideojs-material/libre-skin-red.css new file mode 100644 index 0000000..00b0e7b --- /dev/null +++ b/css/librevideojs-material/libre-skin-red.css @@ -0,0 +1,788 @@ +/*! +LibreVideoJS Estilos personalizados = Red +Version 1.2 +Escrito por Jesús Eduardo +*/ + +.librevjs-libre-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + +.librevjs-libre-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* control bar */ + +.librevjs-libre-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. + */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-libre-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-libre-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-libre-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-libre-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/*COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus:before, .librevjs-libre-skin .librevjs-control:hover:before { + color: #f44336; +} + + +/*END COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus {} + +.librevjs-libre-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/*Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(244, 67, 54); +} + +.librevjs-libre-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-skin .librevjs-play-control:hover:before { + color: #f22e1f; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/*END Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-mute-control, .librevjs-libre-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-mute-control:before, .librevjs-libre-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #f44336 url() -50% 0 repeat; + /*color de barra volumen*/ +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-libre-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s +} + +.librevjs-libre-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-libre-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-libre-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color rojo */ + +.librevjs-libre-skin .librevjs-play-progress { + background: #f44336 url() -50% 0 repeat; +} + +.librevjs-libre-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-libre-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-skin .librevjs-duration { + float: left +} + +.librevjs-libre-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-libre-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-libre-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-libre-skin .librevjs-big-play-button { + left: 50%; + top: 50%; + font-size: 10em; + display: block; + z-index: 2; + position: absolute; + width: 1em; + height: 1em; + margin-left: -0.5em; + margin-top: -0.5em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + color: #f44336; + line-height: normal; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-skin:hover .librevjs-big-play-button, .librevjs-libre-skin .librevjs-big-play-button:focus { + color: rgba(244, 67, 54, 0.89); + /*color boton focus*/ +} + +.librevjs-libre-skin .librevjs-big-play-button:before { + content: "\e007"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear; +} + +.librevjs-libre-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000; +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-libre-skin .librevjs-menu-button { + float: right; + cursor: pointer +} + +.librevjs-libre-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5) +} + +.librevjs-libre-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2) +} + +.librevjs-libre-skin .librevjs-menu-button:hover .librevjs-menu { + display: block +} + +.librevjs-libre-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected { + color: #fff; + background-color: rgb(244, 67, 54); +} + +.librevjs-libre-skin .librevjs-menu-button ul li:focus, .librevjs-libre-skin .librevjs-menu-button ul li:hover, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #f44336; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default +} + +.librevjs-libre-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-libre-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-libre-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.cliplibre-js:-moz-full-screen { + position: absolute; +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.8em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-libre-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*title de resolucion | subtitles y Caption*/ + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: rgb(246, 44, 30); +} + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: rgb(244, 67, 54); + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 5em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 3em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 2em; + } +} diff --git a/css/librevideojs-material/libre-skin-teal.css b/css/librevideojs-material/libre-skin-teal.css new file mode 100644 index 0000000..a6a77bf --- /dev/null +++ b/css/librevideojs-material/libre-skin-teal.css @@ -0,0 +1,786 @@ +/*! +LibreVideoJS Estilos personalizados = Teal +Version 1.2 +Escrito por Jesús Eduardo +*/ + +.librevjs-libre-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + +.librevjs-libre-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* control bar */ + +.librevjs-libre-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. + */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-libre-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-libre-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-libre-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-libre-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/*COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus:before, .librevjs-libre-skin .librevjs-control:hover:before { + color: #1de9b6; +} + + +/*END COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus {} + +.librevjs-libre-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/*Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(29, 233, 182); +} + +.librevjs-libre-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-skin .librevjs-play-control:hover:before { + color: #007c5d; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/*END Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-mute-control, .librevjs-libre-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-mute-control:before, .librevjs-libre-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #1de9b6 url() -50% 0 repeat; +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + +.librevjs-libre-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + +.librevjs-libre-skin .librevjs-progress-holder { + height: 100%; +} + +.librevjs-libre-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + + +/* Personalización de barra de progreso a color azul */ + +.librevjs-libre-skin .librevjs-play-progress { + background: #1de9b6 url() -50% 0 repeat; +} + +.librevjs-libre-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-libre-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-skin .librevjs-duration { + float: left +} + +.librevjs-libre-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-libre-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-libre-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-libre-skin .librevjs-big-play-button { + left: 50%; + top: 50%; + font-size: 10em; + display: block; + z-index: 2; + position: absolute; + width: 1em; + height: 1em; + margin-left: -0.5em; + margin-top: -0.5em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + color: #1abc9c; + line-height: normal; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-skin:hover .librevjs-big-play-button, .librevjs-libre-skin .librevjs-big-play-button:focus { + color: #16a085; +} + +.librevjs-libre-skin .librevjs-big-play-button:before { + content: "\e007"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-libre-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + +.librevjs-libre-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(1, 56, 47); + background-color: rgb(29, 233, 182); +} + +.librevjs-libre-skin .librevjs-menu-button ul li:focus, .librevjs-libre-skin .librevjs-menu-button ul li:hover, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #004d40; + background-color: #1de9b6; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + +.librevjs-libre-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-libre-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-libre-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.8em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-libre-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*title de resolucion | subtitles y Caption*/ + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: rgb(26, 187, 156); +} + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: rgb(29, 233, 182); + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 5em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 3em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 2em; + } +} diff --git a/css/librevideojs-material/libre-skin-yellow.css b/css/librevideojs-material/libre-skin-yellow.css new file mode 100644 index 0000000..6c93b95 --- /dev/null +++ b/css/librevideojs-material/libre-skin-yellow.css @@ -0,0 +1,788 @@ +/*! +LibreVideoJS Estilos personalizados = Yellow +Version 1.2 +Escrito por Jesús Eduardo +*/ + +.librevjs-libre-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + +.librevjs-libre-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* control bar */ + +.librevjs-libre-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. + */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + +.librevjs-libre-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + +.librevjs-libre-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + +.librevjs-libre-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + +.librevjs-libre-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/*COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus:before, .librevjs-libre-skin .librevjs-control:hover:before { + color: #f1c40f; +} + + +/*END COLOR AL PASAR EL CURSOR EN LOS BOTONES DE VOLUMEN y SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-control:focus {} + +.librevjs-libre-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/*Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(241, 196, 14); +} + +.librevjs-libre-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-skin .librevjs-play-control:hover:before { + color: #f39c12; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/*END Color y diseño de boton play control*/ + +.librevjs-libre-skin .librevjs-mute-control, .librevjs-libre-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-skin .librevjs-mute-control:before, .librevjs-libre-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0; +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em; +} + + +/*PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #f1c40f url() -50% 0 repeat; + /*color de barra volumen*/ +} + + +/*END PERSONALIZACION DE NIVEL DE VOLUMEN*/ + +.librevjs-libre-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em; +} + +.librevjs-libre-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em +} + +.librevjs-libre-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em +} + +.librevjs-libre-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s +} + +.librevjs-libre-skin .librevjs-progress-holder { + height: 100% +} + +.librevjs-libre-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0; +} + + +/* Personalización de barra de progreso a color amarillo */ + +.librevjs-libre-skin .librevjs-play-progress { + background: #f1c40f url() -50% 0 repeat; +} + +.librevjs-libre-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4); +} + +.librevjs-libre-skin .librevjs-seek-handle { + width: 1.5em; + height: 100%; +} + +.librevjs-libre-skin .librevjs-seek-handle:before { + padding-top: .1em +} + +.librevjs-libre-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em; +} + +.librevjs-libre-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-skin .librevjs-duration { + float: left +} + +.librevjs-libre-skin .librevjs-remaining-time { + display: none; + float: left; +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + +.librevjs-libre-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right; +} + +.librevjs-libre-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + +.librevjs-libre-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/*Centrado del button Play y personalizado*/ + +.librevjs-libre-skin .librevjs-big-play-button { + left: 50%; + top: 50%; + font-size: 10em; + display: block; + z-index: 2; + position: absolute; + width: 1em; + height: 1em; + margin-left: -0.5em; + margin-top: -0.5em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + color: #f1c40f; + line-height: normal; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-skin:hover .librevjs-big-play-button, .librevjs-libre-skin .librevjs-big-play-button:focus { + color: rgb(244, 156, 18); + /*color boton focus amarillo oscuro*/ +} + +.librevjs-libre-skin .librevjs-big-play-button:before { + content: "\e007"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/*END PERSONALIZAR BIG PLAY BUTTON*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear; +} + +.librevjs-libre-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000; +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + +.librevjs-libre-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + +.librevjs-libre-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + overflow: auto; + left: -5em; + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/*COLOR DE SELECCION DE SUBTIULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected { + color: #fff; + background-color: rgb(241, 196, 14); +} + +.librevjs-libre-skin .librevjs-menu-button ul li:focus, .librevjs-libre-skin .librevjs-menu-button ul li:hover, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #f1c40f; +} + + +/*END COLOR SELECCION DE SUBTITULOS*/ + +.librevjs-libre-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + +.librevjs-libre-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + +.librevjs-libre-skin .librevjs-captions-button:before { + content: "\e008" +} + +.librevjs-libre-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff +} + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em; +} + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.8em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + +.librevjs-libre-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible; +} + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*title de resolucion | subtitles y Caption*/ + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #f1c40f; +} + +.librevjs-libre-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #f39c12; + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 0.9em; + } + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 5em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 3em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-skin .librevjs-big-play-button { + font-size: 2em; + } +} diff --git a/css/mediagoblin/librevideo-js.css b/css/mediagoblin/librevideo-js.css new file mode 100644 index 0000000..36f5f46 --- /dev/null +++ b/css/mediagoblin/librevideo-js.css @@ -0,0 +1,997 @@ +/*! +LibreVideoJS Estilos personalizados = Teal +Version 1.2 +Written by Jesus Eduardo for Mediagoblin +*/ + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'librevjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g. <video class="librevideo-js librevjs-libre-mix-skin"> +*/ + + +/* Custom Icon Font +-------------------------------------------------------------------------------- +The control icons are from a custom font. Each icon corresponds to a character +(e.g. "\e002"). Font icons allow for easy scaling and coloring of icons. +*/ + +.librevjs-libre-mix-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + + +/* Base UI Component Classes +--------------------------------------------------------------------------------*/ +/* Slider - used for Volume bar and Seek bar */ + +.librevjs-libre-mix-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-mix-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-mix-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-mix-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* Control Bar +-------------------------------------------------------------------------------- +The default control bar that is a container for most of the controls. +*/ + +.librevjs-libre-mix-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + + +/* Show the control bar only once the video has started playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + + +/* Hide the control bar when the video is playing and the user is inactive */ + +.librevjs-libre-mix-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-mix-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + + +/* General styles for individual controls. */ + +.librevjs-libre-mix-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + + +/* FreeArt button icons: http://artlibre.org/licence/lal */ + +.librevjs-libre-mix-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-control:focus:before, .librevjs-libre-mix-skin .librevjs-control:hover:before { + color: #1de9b6; +} + +.librevjs-libre-mix-skin .librevjs-control:focus { + /* outline: 0; */ + /* keyboard-only users cannot see the focus on several of the UI elements when this is set to 0 */ +} + + +/* Hide control text visually, but have it available for screenreaders */ + +.librevjs-libre-mix-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/* Play/Pause +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(29, 233, 182); +} + +.librevjs-libre-mix-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-mix-skin .librevjs-play-control:hover:before { + color: #007c5d; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-mix-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/* Volume/Mute +-------------------------------------------------------------------------------- */ + +.librevjs-libre-mix-skin .librevjs-mute-control, .librevjs-libre-mix-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-mute-control:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-mix-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-mix-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*Personalización del nivel de volumen*/ + +.librevjs-libre-mix-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #1de9b6 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-mix-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + + +/* Progress +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-mix-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + + +/* Box containing play and load progress. Also acts as seek scrubber. */ + +.librevjs-libre-mix-skin .librevjs-progress-holder { + height: 100%; +} + + +/* Progress Bars */ + +.librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-libre-mix-skin .librevjs-play-progress { + background: #1de9b6 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-mix-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-mix-skin .librevjs-seek-handle:before { + padding-top: .1em +} + + +/* Time Display +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-mix-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-mix-skin .librevjs-duration { + float: left +} + +.librevjs-libre-mix-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + + +/* Fullscreen +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + + +/* Switch to the exit icon when the player is in fullscreen */ + +.librevjs-libre-mix-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/* Big Play Button (play button at start) +-------------------------------------------------------------------------------- +Positioning of the play button in the center or other corners can be done more +easily in the skin designer by LibreVideoJS FreeArts. +*/ + +.librevjs-libre-mix-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.85em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 3.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-mix-skin:hover .librevjs-big-play-button, .librevjs-libre-mix-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: #1de9b6; + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-libre-mix-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/* Loading Spinner +-------------------------------------------------------------------------------- +*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-mix-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + + +/* Menu Buttons (Captions/Subtitles/etc.) +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-mix-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + + +/* Button Pop-up Menu */ + +.librevjs-libre-mix-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + /* Same bottom as librevjs-menu border-top */ + max-height: 15em; + overflow: auto; + left: -5em; + /* Width of menu - width of button / 2 */ + /* background-color-with-alpha */ + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-mix-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/* Select color menu subtitles/captions */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(1, 56, 47); + background-color: rgb(29, 233, 182); +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li:hover, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #004d40; + background-color: #1de9b6; +} + + +/*End Select color menu subtitles/caption */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + + +/* Subtitles Button */ + +.librevjs-libre-mix-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + + +/* Captions Button */ + +.librevjs-libre-mix-skin .librevjs-captions-button:before { + content: "\e008" +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-mix-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + + +/* +REQUIRED STYLES (be careful overriding) +================================================================================ +When loading the player, the video tag is replaced with a DIV, +that will hold the video tag or object tag for other playback methods. +The div contains the video playback element (HTML5) and controls, +and sets the width and height of the video. +** If you want to add some kind of border/padding (e.g. a frame), or special +positioning, use another containing element. Otherwise you risk messing up +control positioning and full window mode. ** +*/ + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + + +/* Playback technology elements expand to the width/height of the containing div <video> */ + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + + +/* Fullscreen Styles */ + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + + +/* Poster Styles */ + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + + +/* Hide the poster when native controls are used otherwise it covers them */ + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + + +/* Text Track Styles */ + + +/* Overall track holder for both captions and subtitles */ + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + + +/* Individual tracks */ + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.7em; + text-align: center; + margin-bottom: .1em; + /* Transparent black background, or fallback to all black (oldIE) */ + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + + +/* Hide disabled or unsupported controls */ + +.librevjs-libre-mix-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/* Opctional Styles No support HTML5*/ + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*Title Resolution | subtitles and Caption*/ + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: rgb(26, 187, 156); + background-color: inherit; +} + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: rgb(29, 233, 182); + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +/* Resolution + *************************************************/ +/* Position the button */ + +.librevjs-res-button { + font-weight: bold; + float: right; + line-height: 3em; +} + + +/* Don't show hover effects on title */ + +ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + cursor: default; + background-color: transparent; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + + +/* Needed to keep text visible in LibreVideoJS */ + +.librevjs-res-button .librevjs-control-text { + width: auto; + height: auto; + clip: auto; +} + +/*ProgressTip + **********************************************/ +.librevjs-progress-tip { + visibility: hidden; + display: block; + opacity: 0.8; + padding: 5px; + font-size: 10px; + position: absolute; + z-index: 100000; +} + +.librevjs-progress-tip-arrow { + background: url(data:image/gif;base64,R0lGODlhCQAJAIABAAAAAAAAACH5BAEAAAEALAAAAAAJAAkAAAIRjAOnwIrcDJxvwkplPtchVQAAOw==) no-repeat top left; + bottom: 0; + left: 50%; + margin-left: -4px; + background-position: bottom left; + position: absolute; + width: 9px; + height: 5px; +} + +.librevjs-progress-tip-inner { + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + padding: 5px 8px 4px 8px; + background-color: black; + color: white; + max-width: 200px; + text-align: center; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.8em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.4em; + } +} diff --git a/css/mix-material/mix-blue.css b/css/mix-material/mix-blue.css new file mode 100644 index 0000000..a24ca0f --- /dev/null +++ b/css/mix-material/mix-blue.css @@ -0,0 +1,934 @@ +/*! +LibreVideoJS Estilos personalizados = Blue +Version 1.4 +Escrito por Jesús Eduardo +*/ + + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'librevjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g. <video class="librevideo-js my-skin-name"> +*/ + + +/* Custom Icon Font +-------------------------------------------------------------------------------- +The control icons are from a custom font. Each icon corresponds to a character +(e.g. "\e002"). Font icons allow for easy scaling and coloring of icons. +*/ + +.librevjs-libre-mix-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + + +/* Base UI Component Classes +--------------------------------------------------------------------------------*/ +/* Slider - used for Volume bar and Seek bar */ + +.librevjs-libre-mix-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-mix-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-mix-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-mix-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* Control Bar +-------------------------------------------------------------------------------- +The default control bar that is a container for most of the controls. +*/ + +.librevjs-libre-mix-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + + +/* Show the control bar only once the video has started playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + + +/* Hide the control bar when the video is playing and the user is inactive */ + +.librevjs-libre-mix-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-mix-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + + +/* General styles for individual controls. */ + +.librevjs-libre-mix-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + + +/* FreeArt button icons: http://artlibre.org/licence/lal */ + +.librevjs-libre-mix-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-control:focus:before, .librevjs-libre-mix-skin .librevjs-control:hover:before { + color: #2196F3; +} + +.librevjs-libre-mix-skin .librevjs-control:focus { + /* outline: 0; */ + /* keyboard-only users cannot see the focus on several of the UI elements when this is set to 0 */ +} + + +/* Hide control text visually, but have it available for screenreaders */ + +.librevjs-libre-mix-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/* Play/Pause +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(33, 150, 244); +} + +.librevjs-libre-mix-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-mix-skin .librevjs-play-control:hover:before { + color: #2980b9; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-mix-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/* Volume/Mute +-------------------------------------------------------------------------------- */ + +.librevjs-libre-mix-skin .librevjs-mute-control, .librevjs-libre-mix-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-mute-control:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-mix-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-mix-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*Personalización del nivel de volumen*/ + +.librevjs-libre-mix-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #2196F3 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-mix-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + + +/* Progress +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-mix-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + + +/* Box containing play and load progress. Also acts as seek scrubber. */ + +.librevjs-libre-mix-skin .librevjs-progress-holder { + height: 100%; +} + + +/* Progress Bars */ + +.librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-libre-mix-skin .librevjs-play-progress { + background: #2196F3 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-mix-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-mix-skin .librevjs-seek-handle:before { + padding-top: .1em +} + + +/* Time Display +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-mix-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-mix-skin .librevjs-duration { + float: left +} + +.librevjs-libre-mix-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + + +/* Fullscreen +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + + +/* Switch to the exit icon when the player is in fullscreen */ + +.librevjs-libre-mix-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/* Big Play Button (play button at start) +-------------------------------------------------------------------------------- +Positioning of the play button in the center or other corners can be done more +easily in the skin designer by LibreVideoJS FreeArts. +*/ + +.librevjs-libre-mix-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.85em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 3.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-mix-skin:hover .librevjs-big-play-button, .librevjs-libre-mix-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: #2196F3; + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-libre-mix-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/* Loading Spinner +-------------------------------------------------------------------------------- +*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-mix-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + + +/* Menu Buttons (Captions/Subtitles/etc.) +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-mix-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + + +/* Button Pop-up Menu */ + +.librevjs-libre-mix-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + /* Same bottom as librevjs-menu border-top */ + max-height: 15em; + overflow: auto; + left: -5em; + /* Width of menu - width of button / 2 */ + /* background-color-with-alpha */ + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-mix-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/* Select color menu subtitles/captions */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(11, 21, 42); + background-color: rgb(33, 150, 244); +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li:hover, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: rgb(11, 21, 42); + background-color: #2196F3; +} + + +/*End Select color menu subtitles/caption */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + + +/* Subtitles Button */ + +.librevjs-libre-mix-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + + +/* Captions Button */ + +.librevjs-libre-mix-skin .librevjs-captions-button:before { + content: "\e008" +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-mix-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + + +/* +REQUIRED STYLES (be careful overriding) +================================================================================ +When loading the player, the video tag is replaced with a DIV, +that will hold the video tag or object tag for other playback methods. +The div contains the video playback element (HTML5) and controls, +and sets the width and height of the video. +** If you want to add some kind of border/padding (e.g. a frame), or special +positioning, use another containing element. Otherwise you risk messing up +control positioning and full window mode. ** +*/ + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + + +/* Playback technology elements expand to the width/height of the containing div <video> */ + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + + +/* Fullscreen Styles */ + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + + +/* Poster Styles */ + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + + +/* Hide the poster when native controls are used otherwise it covers them */ + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + + +/* Text Track Styles */ + + +/* Overall track holder for both captions and subtitles */ + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + + +/* Individual tracks */ + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.7em; + text-align: center; + margin-bottom: .1em; + /* Transparent black background, or fallback to all black (oldIE) */ + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + + +/* Hide disabled or unsupported controls */ + +.librevjs-libre-mix-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/* Opctional Styles No support HTML5*/ + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*Title Resolution | subtitles and Caption*/ + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: rgb(33, 150, 244); + background-color: inherit; +} + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: rgb(11, 137, 237); + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.8em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.4em; + } +} diff --git a/css/mix-material/mix-grey.css b/css/mix-material/mix-grey.css new file mode 100644 index 0000000..7091a3c --- /dev/null +++ b/css/mix-material/mix-grey.css @@ -0,0 +1,934 @@ +/*! +LibreVideoJS Estilos personalizados = Grey +Version 1.4 +Escrito por Jesús Eduardo +*/ + + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'librevjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g. <video class="librevideo-js my-skin-name"> +*/ + + +/* Custom Icon Font +-------------------------------------------------------------------------------- +The control icons are from a custom font. Each icon corresponds to a character +(e.g. "\e002"). Font icons allow for easy scaling and coloring of icons. +*/ + +.librevjs-libre-mix-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + + +/* Base UI Component Classes +--------------------------------------------------------------------------------*/ +/* Slider - used for Volume bar and Seek bar */ + +.librevjs-libre-mix-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-mix-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-mix-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-mix-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* Control Bar +-------------------------------------------------------------------------------- +The default control bar that is a container for most of the controls. +*/ + +.librevjs-libre-mix-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + + +/* Show the control bar only once the video has started playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + + +/* Hide the control bar when the video is playing and the user is inactive */ + +.librevjs-libre-mix-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-mix-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + + +/* General styles for individual controls. */ + +.librevjs-libre-mix-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + + +/* FreeArt button icons: http://artlibre.org/licence/lal */ + +.librevjs-libre-mix-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-control:focus:before, .librevjs-libre-mix-skin .librevjs-control:hover:before { + color: #9e9e9e; +} + +.librevjs-libre-mix-skin .librevjs-control:focus { + /* outline: 0; */ + /* keyboard-only users cannot see the focus on several of the UI elements when this is set to 0 */ +} + + +/* Hide control text visually, but have it available for screenreaders */ + +.librevjs-libre-mix-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/* Play/Pause +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(158, 158, 158); +} + +.librevjs-libre-mix-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-mix-skin .librevjs-play-control:hover:before { + color: #7c7c7c; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-mix-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/* Volume/Mute +-------------------------------------------------------------------------------- */ + +.librevjs-libre-mix-skin .librevjs-mute-control, .librevjs-libre-mix-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-mute-control:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-mix-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-mix-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*Personalización del nivel de volumen*/ + +.librevjs-libre-mix-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #9e9e9e url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-mix-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + + +/* Progress +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-mix-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + + +/* Box containing play and load progress. Also acts as seek scrubber. */ + +.librevjs-libre-mix-skin .librevjs-progress-holder { + height: 100%; +} + + +/* Progress Bars */ + +.librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-libre-mix-skin .librevjs-play-progress { + background: #9e9e9e url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-mix-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-mix-skin .librevjs-seek-handle:before { + padding-top: .1em +} + + +/* Time Display +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-mix-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-mix-skin .librevjs-duration { + float: left +} + +.librevjs-libre-mix-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + + +/* Fullscreen +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + + +/* Switch to the exit icon when the player is in fullscreen */ + +.librevjs-libre-mix-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/* Big Play Button (play button at start) +-------------------------------------------------------------------------------- +Positioning of the play button in the center or other corners can be done more +easily in the skin designer by LibreVideoJS FreeArts. +*/ + +.librevjs-libre-mix-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.85em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 3.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-mix-skin:hover .librevjs-big-play-button, .librevjs-libre-mix-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: rgb(115, 115, 115); + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-libre-mix-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/* Loading Spinner +-------------------------------------------------------------------------------- +*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-mix-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + + +/* Menu Buttons (Captions/Subtitles/etc.) +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-mix-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + + +/* Button Pop-up Menu */ + +.librevjs-libre-mix-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + /* Same bottom as librevjs-menu border-top */ + max-height: 15em; + overflow: auto; + left: -5em; + /* Width of menu - width of button / 2 */ + /* background-color-with-alpha */ + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-mix-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/* Select color menu subtitles/captions */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected { + color: #fff; + background-color: rgb(158, 158, 158); +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li:hover, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #9e9e9e; +} + + +/*End Select color menu subtitles/caption */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + + +/* Subtitles Button */ + +.librevjs-libre-mix-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + + +/* Captions Button */ + +.librevjs-libre-mix-skin .librevjs-captions-button:before { + content: "\e008" +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-mix-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + + +/* +REQUIRED STYLES (be careful overriding) +================================================================================ +When loading the player, the video tag is replaced with a DIV, +that will hold the video tag or object tag for other playback methods. +The div contains the video playback element (HTML5) and controls, +and sets the width and height of the video. +** If you want to add some kind of border/padding (e.g. a frame), or special +positioning, use another containing element. Otherwise you risk messing up +control positioning and full window mode. ** +*/ + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + + +/* Playback technology elements expand to the width/height of the containing div <video> */ + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + + +/* Fullscreen Styles */ + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + + +/* Poster Styles */ + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + + +/* Hide the poster when native controls are used otherwise it covers them */ + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + + +/* Text Track Styles */ + + +/* Overall track holder for both captions and subtitles */ + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + + +/* Individual tracks */ + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.7em; + text-align: center; + margin-bottom: .1em; + background-color: #000; + /* Transparent black background, or fallback to all black (oldIE) */ + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + + +/* Hide disabled or unsupported controls */ + +.librevjs-libre-mix-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/* Opctional Styles No support HTML5*/ + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*Title Resolution | subtitles and Caption*/ + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #737373; + background-color: inherit; +} + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #9e9e9e; + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.8em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.4em; + } +} diff --git a/css/mix-material/mix-purple.css b/css/mix-material/mix-purple.css new file mode 100644 index 0000000..475a0c2 --- /dev/null +++ b/css/mix-material/mix-purple.css @@ -0,0 +1,934 @@ +/*! +LibreVideoJS Estilos personalizados = Purple +Version 1.4 +Escrito por Jesús Eduardo +*/ + + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'librevjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g. <video class="librevideo-js my-skin-name"> +*/ + + +/* Custom Icon Font +-------------------------------------------------------------------------------- +The control icons are from a custom font. Each icon corresponds to a character +(e.g. "\e002"). Font icons allow for easy scaling and coloring of icons. +*/ + +.librevjs-libre-mix-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + + +/* Base UI Component Classes +--------------------------------------------------------------------------------*/ +/* Slider - used for Volume bar and Seek bar */ + +.librevjs-libre-mix-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-mix-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-mix-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-mix-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* Control Bar +-------------------------------------------------------------------------------- +The default control bar that is a container for most of the controls. +*/ + +.librevjs-libre-mix-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + + +/* Show the control bar only once the video has started playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + + +/* Hide the control bar when the video is playing and the user is inactive */ + +.librevjs-libre-mix-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-mix-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + + +/* General styles for individual controls. */ + +.librevjs-libre-mix-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + + +/* FreeArt button icons: http://artlibre.org/licence/lal */ + +.librevjs-libre-mix-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-control:focus:before, .librevjs-libre-mix-skin .librevjs-control:hover:before { + color: #9c27b0; +} + +.librevjs-libre-mix-skin .librevjs-control:focus { + /* outline: 0; */ + /* keyboard-only users cannot see the focus on several of the UI elements when this is set to 0 */ +} + + +/* Hide control text visually, but have it available for screenreaders */ + +.librevjs-libre-mix-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/* Play/Pause +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(156, 39, 176); +} + +.librevjs-libre-mix-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-mix-skin .librevjs-play-control:hover:before { + color: #8e44ad; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-mix-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/* Volume/Mute +-------------------------------------------------------------------------------- */ + +.librevjs-libre-mix-skin .librevjs-mute-control, .librevjs-libre-mix-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-mute-control:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-mix-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-mix-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*Personalización del nivel de volumen*/ + +.librevjs-libre-mix-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #9c27b0 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-mix-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + + +/* Progress +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-mix-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + + +/* Box containing play and load progress. Also acts as seek scrubber. */ + +.librevjs-libre-mix-skin .librevjs-progress-holder { + height: 100%; +} + + +/* Progress Bars */ + +.librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-libre-mix-skin .librevjs-play-progress { + background: #9c27b0 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-mix-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-mix-skin .librevjs-seek-handle:before { + padding-top: .1em +} + + +/* Time Display +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-mix-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-mix-skin .librevjs-duration { + float: left +} + +.librevjs-libre-mix-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + + +/* Fullscreen +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + + +/* Switch to the exit icon when the player is in fullscreen */ + +.librevjs-libre-mix-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/* Big Play Button (play button at start) +-------------------------------------------------------------------------------- +Positioning of the play button in the center or other corners can be done more +easily in the skin designer by LibreVideoJS FreeArts. +*/ + +.librevjs-libre-mix-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.85em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 3.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-mix-skin:hover .librevjs-big-play-button, .librevjs-libre-mix-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: rgb(142, 68, 173); + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-libre-mix-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/* Loading Spinner +-------------------------------------------------------------------------------- +*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-mix-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + + +/* Menu Buttons (Captions/Subtitles/etc.) +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-mix-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + + +/* Button Pop-up Menu */ + +.librevjs-libre-mix-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + /* Same bottom as librevjs-menu border-top */ + max-height: 15em; + overflow: auto; + left: -5em; + /* Width of menu - width of button / 2 */ + /* background-color-with-alpha */ + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-mix-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/* Select color menu subtitles/captions */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected { + color: #fff; + background-color: rgb(156, 39, 176); +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li:hover, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #9c27b0; +} + + +/*End Select color menu subtitles/caption */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + + +/* Subtitles Button */ + +.librevjs-libre-mix-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + + +/* Captions Button */ + +.librevjs-libre-mix-skin .librevjs-captions-button:before { + content: "\e008" +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-mix-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + + +/* +REQUIRED STYLES (be careful overriding) +================================================================================ +When loading the player, the video tag is replaced with a DIV, +that will hold the video tag or object tag for other playback methods. +The div contains the video playback element (HTML5) and controls, +and sets the width and height of the video. +** If you want to add some kind of border/padding (e.g. a frame), or special +positioning, use another containing element. Otherwise you risk messing up +control positioning and full window mode. ** +*/ + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + + +/* Playback technology elements expand to the width/height of the containing div <video> */ + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + + +/* Fullscreen Styles */ + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + + +/* Poster Styles */ + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + + +/* Hide the poster when native controls are used otherwise it covers them */ + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + + +/* Text Track Styles */ + + +/* Overall track holder for both captions and subtitles */ + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + + +/* Individual tracks */ + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.7em; + text-align: center; + margin-bottom: .1em; + /* Transparent black background, or fallback to all black (oldIE) */ + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + + +/* Hide disabled or unsupported controls */ + +.librevjs-libre-mix-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/* Opctional Styles No support HTML5*/ + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*Title Resolution | subtitles and Caption*/ + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #9c27b0; + background-color: inherit; +} + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #8e44ad; + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.8em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.4em; + } +} diff --git a/css/mix-material/mix-red.css b/css/mix-material/mix-red.css new file mode 100644 index 0000000..a37b273 --- /dev/null +++ b/css/mix-material/mix-red.css @@ -0,0 +1,934 @@ +/*! +LibreVideoJS Estilos personalizados = Red +Version 1.4 +Escrito por Jesús Eduardo +*/ + + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'librevjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g. <video class="librevideo-js my-skin-name"> +*/ + + +/* Custom Icon Font +-------------------------------------------------------------------------------- +The control icons are from a custom font. Each icon corresponds to a character +(e.g. "\e002"). Font icons allow for easy scaling and coloring of icons. +*/ + +.librevjs-libre-mix-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + + +/* Base UI Component Classes +--------------------------------------------------------------------------------*/ +/* Slider - used for Volume bar and Seek bar */ + +.librevjs-libre-mix-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-mix-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-mix-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-mix-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* Control Bar +-------------------------------------------------------------------------------- +The default control bar that is a container for most of the controls. +*/ + +.librevjs-libre-mix-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + + +/* Show the control bar only once the video has started playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + + +/* Hide the control bar when the video is playing and the user is inactive */ + +.librevjs-libre-mix-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-mix-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + + +/* General styles for individual controls. */ + +.librevjs-libre-mix-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + + +/* FreeArt button icons: http://artlibre.org/licence/lal */ + +.librevjs-libre-mix-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-control:focus:before, .librevjs-libre-mix-skin .librevjs-control:hover:before { + color: #f44336; +} + +.librevjs-libre-mix-skin .librevjs-control:focus { + /* outline: 0; */ + /* keyboard-only users cannot see the focus on several of the UI elements when this is set to 0 */ +} + + +/* Hide control text visually, but have it available for screenreaders */ + +.librevjs-libre-mix-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/* Play/Pause +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(244, 67, 54); +} + +.librevjs-libre-mix-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-mix-skin .librevjs-play-control:hover:before { + color: #f22e1f; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-mix-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/* Volume/Mute +-------------------------------------------------------------------------------- */ + +.librevjs-libre-mix-skin .librevjs-mute-control, .librevjs-libre-mix-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-mute-control:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-mix-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-mix-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*Personalización del nivel de volumen*/ + +.librevjs-libre-mix-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #f44336 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-mix-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + + +/* Progress +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-mix-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + + +/* Box containing play and load progress. Also acts as seek scrubber. */ + +.librevjs-libre-mix-skin .librevjs-progress-holder { + height: 100%; +} + + +/* Progress Bars */ + +.librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-libre-mix-skin .librevjs-play-progress { + background: #f44336 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-mix-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-mix-skin .librevjs-seek-handle:before { + padding-top: .1em +} + + +/* Time Display +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-mix-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-mix-skin .librevjs-duration { + float: left +} + +.librevjs-libre-mix-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + + +/* Fullscreen +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + + +/* Switch to the exit icon when the player is in fullscreen */ + +.librevjs-libre-mix-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/* Big Play Button (play button at start) +-------------------------------------------------------------------------------- +Positioning of the play button in the center or other corners can be done more +easily in the skin designer by LibreVideoJS FreeArts. +*/ + +.librevjs-libre-mix-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.85em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 3.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-mix-skin:hover .librevjs-big-play-button, .librevjs-libre-mix-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: #f12b24; + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-libre-mix-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/* Loading Spinner +-------------------------------------------------------------------------------- +*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-mix-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + + +/* Menu Buttons (Captions/Subtitles/etc.) +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-mix-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + + +/* Button Pop-up Menu */ + +.librevjs-libre-mix-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + max-height: 15em; + /* Same bottom as librevjs-menu border-top */ + overflow: auto; + left: -5em; + /* Width of menu - width of button / 2 */ + /* background-color-with-alpha */ + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-mix-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/* Select color menu subtitles/captions */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected { + color: #fff; + background-color: rgb(244, 67, 54); +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li:hover, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #f44336; +} + + +/*End Select color menu subtitles/caption */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + + +/* Subtitles Button */ + +.librevjs-libre-mix-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + + +/* Captions Button */ + +.librevjs-libre-mix-skin .librevjs-captions-button:before { + content: "\e008" +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-mix-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + + +/* +REQUIRED STYLES (be careful overriding) +================================================================================ +When loading the player, the video tag is replaced with a DIV, +that will hold the video tag or object tag for other playback methods. +The div contains the video playback element (HTML5) and controls, +and sets the width and height of the video. +** If you want to add some kind of border/padding (e.g. a frame), or special +positioning, use another containing element. Otherwise you risk messing up +control positioning and full window mode. ** +*/ + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + + +/* Playback technology elements expand to the width/height of the containing div <video> */ + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + + +/* Fullscreen Styles */ + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + + +/* Poster Styles */ + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + + +/* Hide the poster when native controls are used otherwise it covers them */ + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + + +/* Text Track Styles */ + + +/* Overall track holder for both captions and subtitles */ + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + + +/* Individual tracks */ + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.7em; + text-align: center; + margin-bottom: .1em; + /* Transparent black background, or fallback to all black (oldIE) */ + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + + +/* Hide disabled or unsupported controls */ + +.librevjs-libre-mix-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/* Opctional Styles No support HTML5*/ + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*Title Resolution | subtitles and Caption*/ + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: rgb(246, 44, 30); + background-color: inherit; +} + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: rgb(244, 67, 54); + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.8em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.4em; + } +} diff --git a/css/mix-material/mix-teal.css b/css/mix-material/mix-teal.css new file mode 100644 index 0000000..2a57a79 --- /dev/null +++ b/css/mix-material/mix-teal.css @@ -0,0 +1,934 @@ +/*! +LibreVideoJS Estilos personalizados = Teal +Version 1.2 +Escrito por Jesús Eduardo +*/ + + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'librevjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g. <video class="librevideo-js my-skin-name"> +*/ + + +/* Custom Icon Font +-------------------------------------------------------------------------------- +The control icons are from a custom font. Each icon corresponds to a character +(e.g. "\e002"). Font icons allow for easy scaling and coloring of icons. +*/ + +.librevjs-libre-mix-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + + +/* Base UI Component Classes +--------------------------------------------------------------------------------*/ +/* Slider - used for Volume bar and Seek bar */ + +.librevjs-libre-mix-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-mix-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-mix-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-mix-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* Control Bar +-------------------------------------------------------------------------------- +The default control bar that is a container for most of the controls. +*/ + +.librevjs-libre-mix-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + + +/* Show the control bar only once the video has started playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + + +/* Hide the control bar when the video is playing and the user is inactive */ + +.librevjs-libre-mix-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-mix-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + + +/* General styles for individual controls. */ + +.librevjs-libre-mix-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + + +/* FreeArt button icons: http://artlibre.org/licence/lal */ + +.librevjs-libre-mix-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-control:focus:before, .librevjs-libre-mix-skin .librevjs-control:hover:before { + color: #1de9b6; +} + +.librevjs-libre-mix-skin .librevjs-control:focus { + /* outline: 0; */ + /* keyboard-only users cannot see the focus on several of the UI elements when this is set to 0 */ +} + + +/* Hide control text visually, but have it available for screenreaders */ + +.librevjs-libre-mix-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/* Play/Pause +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(29, 233, 182); +} + +.librevjs-libre-mix-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-mix-skin .librevjs-play-control:hover:before { + color: #007c5d; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-mix-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/* Volume/Mute +-------------------------------------------------------------------------------- */ + +.librevjs-libre-mix-skin .librevjs-mute-control, .librevjs-libre-mix-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-mute-control:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-mix-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-mix-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*Personalización del nivel de volumen*/ + +.librevjs-libre-mix-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #1de9b6 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-mix-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + + +/* Progress +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-mix-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + + +/* Box containing play and load progress. Also acts as seek scrubber. */ + +.librevjs-libre-mix-skin .librevjs-progress-holder { + height: 100%; +} + + +/* Progress Bars */ + +.librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-libre-mix-skin .librevjs-play-progress { + background: #1de9b6 url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-mix-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-mix-skin .librevjs-seek-handle:before { + padding-top: .1em +} + + +/* Time Display +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-mix-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-mix-skin .librevjs-duration { + float: left +} + +.librevjs-libre-mix-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + + +/* Fullscreen +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + + +/* Switch to the exit icon when the player is in fullscreen */ + +.librevjs-libre-mix-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/* Big Play Button (play button at start) +-------------------------------------------------------------------------------- +Positioning of the play button in the center or other corners can be done more +easily in the skin designer by LibreVideoJS FreeArts. +*/ + +.librevjs-libre-mix-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.85em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 3.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-mix-skin:hover .librevjs-big-play-button, .librevjs-libre-mix-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: #1de9b6; + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-libre-mix-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/* Loading Spinner +-------------------------------------------------------------------------------- +*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-mix-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + + +/* Menu Buttons (Captions/Subtitles/etc.) +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-mix-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + + +/* Button Pop-up Menu */ + +.librevjs-libre-mix-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + /* Same bottom as librevjs-menu border-top */ + max-height: 15em; + overflow: auto; + left: -5em; + /* Width of menu - width of button / 2 */ + /* background-color-with-alpha */ + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-mix-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/* Select color menu subtitles/captions */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected { + color: rgb(1, 56, 47); + background-color: rgb(29, 233, 182); +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li:hover, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #004d40; + background-color: #1de9b6; +} + + +/*End Select color menu subtitles/caption */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + + +/* Subtitles Button */ + +.librevjs-libre-mix-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + + +/* Captions Button */ + +.librevjs-libre-mix-skin .librevjs-captions-button:before { + content: "\e008" +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-mix-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + + +/* +REQUIRED STYLES (be careful overriding) +================================================================================ +When loading the player, the video tag is replaced with a DIV, +that will hold the video tag or object tag for other playback methods. +The div contains the video playback element (HTML5) and controls, +and sets the width and height of the video. +** If you want to add some kind of border/padding (e.g. a frame), or special +positioning, use another containing element. Otherwise you risk messing up +control positioning and full window mode. ** +*/ + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + + +/* Playback technology elements expand to the width/height of the containing div <video> */ + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + + +/* Fullscreen Styles */ + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + + +/* Poster Styles */ + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + + +/* Hide the poster when native controls are used otherwise it covers them */ + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + + +/* Text Track Styles */ + + +/* Overall track holder for both captions and subtitles */ + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + + +/* Individual tracks */ + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.7em; + text-align: center; + margin-bottom: .1em; + /* Transparent black background, or fallback to all black (oldIE) */ + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + + +/* Hide disabled or unsupported controls */ + +.librevjs-libre-mix-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/* Opctional Styles No support HTML5*/ + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*Title Resolution | subtitles and Caption*/ + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: rgb(26, 187, 156); + background-color: inherit; +} + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: rgb(29, 233, 182); + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.8em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.4em; + } +} diff --git a/css/mix-material/mix-yellow.css b/css/mix-material/mix-yellow.css new file mode 100644 index 0000000..a9efaea --- /dev/null +++ b/css/mix-material/mix-yellow.css @@ -0,0 +1,934 @@ +/*! +LibreVideoJS Estilos personalizados = Yellow +Version 1.4 +Escrito por Jesús Eduardo +*/ + + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'librevjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g. <video class="librevideo-js my-skin-name"> +*/ + + +/* Custom Icon Font +-------------------------------------------------------------------------------- +The control icons are from a custom font. Each icon corresponds to a character +(e.g. "\e002"). Font icons allow for easy scaling and coloring of icons. +*/ + +.librevjs-libre-mix-skin { + color: #ccc; + background-color: inherit; +} + +@font-face { + font-family:"LibreVideoJS"; + src: url("../../fonts/libre-material/libre-icons.eot") format("embedded-opentype"); + src: local('?'), + url("../../fonts/libre-material/libre-icons.woff") format("woff"), + url("../../fonts/libre-material/libre-icons.ttf") format("truetype"), + url("../../fonts/libre-material/libre-icons.svg") format("svg"); +} + + +/* Base UI Component Classes +--------------------------------------------------------------------------------*/ +/* Slider - used for Volume bar and Seek bar */ + +.librevjs-libre-mix-skin .librevjs-slider { + /* Replace browser focus highlight with handle highlight */ + outline: 0; + position: relative; + cursor: pointer; + padding: 0; + /* background-color-with-alpha */ + background-color: #000000; + background-color: rgba(0, 0, 0, 0.5); +} + +.librevjs-libre-mix-skin .librevjs-slider:focus { + -webkit-box-shadow: 0 0 2em #fff; + -moz-box-shadow: 0 0 2em #fff; + box-shadow: 0 0 2em #fff; +} + + +/*Eliminación de botón de barra de progreso*/ + +.librevjs-libre-mix-skin .librevjs-slider-handle { + width: 0; + height: 0; +} + +.librevjs-libre-mix-skin .librevjs-slider-handle:before { + text-shadow: 0em 0em 1em #fff; + position: absolute; + top: 0; + left: 0; +} + + +/* Control Bar +-------------------------------------------------------------------------------- +The default control bar that is a container for most of the controls. +*/ + +.librevjs-libre-mix-skin .librevjs-control-bar { + /* Start hidden */ + display: none; + position: absolute; + /* Place control bar at the bottom of the player box/video. + If you want more margin below the control bar, add more height. */ + bottom: 0; + /* Use left/right to stretch to 100% width of player div */ + left: 0; + right: 0; + /* Height includes any margin you want above or below control items */ + height: 3.0em; + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); +} + + +/* Show the control bar only once the video has started playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-control-bar { + display: block; + visibility: visible; + opacity: 1; + -webkit-transition: visibility .1s, opacity .1s; + -moz-transition: visibility .1s, opacity .1s; + -o-transition: visibility .1s, opacity .1s; + transition: visibility .1s, opacity .1s +} + + +/* Hide the control bar when the video is playing and the user is inactive */ + +.librevjs-libre-mix-skin.librevjs-has-started.librevjs-user-inactive.librevjs-playing .librevjs-control-bar { + display: block; + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s +} + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-control-bar { + display: none +} + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-control-bar { + display: none +} + +@media \0screen { + .librevjs-libre-mix-skin.librevjs-user-inactive.librevjs-playing .librevjs-control-bar :before { + content: "" + } +} + + +/* General styles for individual controls. */ + +.librevjs-libre-mix-skin .librevjs-control { + outline: 0; + position: relative; + float: left; + text-align: center; + margin: 0; + padding: 0; + height: 3em; + width: 4em +} + + +/* FreeArt button icons: http://artlibre.org/licence/lal */ + +.librevjs-libre-mix-skin .librevjs-control:before { + font-family: LibreVideoJS; + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .5) +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-control:focus:before, .librevjs-libre-mix-skin .librevjs-control:hover:before { + color: #f1c40f; +} + +.librevjs-libre-mix-skin .librevjs-control:focus { + /* outline: 0; */ + /* keyboard-only users cannot see the focus on several of the UI elements when this is set to 0 */ +} + + +/* Hide control text visually, but have it available for screenreaders */ + +.librevjs-libre-mix-skin .librevjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + + +/* Play/Pause +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-play-control { + width: 5em; + cursor: pointer; + color: rgb(241, 196, 14); +} + +.librevjs-libre-mix-skin .librevjs-play-control:before { + content: "\e001" +} + +.librevjs-libre-mix-skin .librevjs-play-control:hover:before { + color: #f39c12; + /*color de play control al pasar el cursor*/ +} + +.librevjs-libre-mix-skin.librevjs-playing .librevjs-play-control:before { + content: "\e002" +} + + +/* Volume/Mute +-------------------------------------------------------------------------------- */ + +.librevjs-libre-mix-skin .librevjs-mute-control, .librevjs-libre-mix-skin .librevjs-volume-menu-button { + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-mute-control:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button:before { + content: "\e006" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-0:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-0:before { + content: "\e003" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-1:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-1:before { + content: "\e004" +} + +.librevjs-libre-mix-skin .librevjs-mute-control.librevjs-vol-2:before, .librevjs-libre-mix-skin .librevjs-volume-menu-button.librevjs-vol-2:before { + content: "\e005" +} + +.librevjs-libre-mix-skin .librevjs-volume-control { + width: 5em; + float: right +} + +.librevjs-libre-mix-skin .librevjs-volume-bar { + width: 5em; + height: .6em; + margin: 1.1em auto 0 +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu-content { + height: 2.9em +} + + +/*Personalización del nivel de volumen*/ + +.librevjs-libre-mix-skin .librevjs-volume-level { + position: absolute; + top: 0; + left: 0; + height: 0.5em; + /* assuming volume starts at 1.0 */ + width: 100%; + background: #f1c40f url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-volume-bar .librevjs-volume-handle { + width: .5em; + height: .5em +} + +.librevjs-libre-mix-skin .librevjs-volume-handle:before { + font-size: .9em; + top: -.2em; + left: -.2em; + width: 1em; + height: 1em; +} + +.librevjs-libre-mix-skin .librevjs-volume-menu-button .librevjs-menu .librevjs-menu-content { + width: 6em; + left: -4em; +} + + +/* Progress +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-progress-control { + position: absolute; + left: 0; + right: 0; + width: auto; + font-size: .3em; + height: 1em; + top: -1em; + -webkit-transition: all .4s; + -moz-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; +} + +.librevjs-libre-mix-skin:hover .librevjs-progress-control { + font-size: .9em; + -webkit-transition: all .2s; + -moz-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; +} + + +/* Box containing play and load progress. Also acts as seek scrubber. */ + +.librevjs-libre-mix-skin .librevjs-progress-holder { + height: 100%; +} + + +/* Progress Bars */ + +.librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-play-progress, .librevjs-libre-mix-skin .librevjs-progress-holder .librevjs-load-progress { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + left: 0; + top: 0 +} + +.librevjs-libre-mix-skin .librevjs-play-progress { + background: #f1c40f url() -50% 0 repeat; +} + +.librevjs-libre-mix-skin .librevjs-load-progress { + background: #646464; + background: rgba(255, 255, 255, .4) +} + +.librevjs-libre-mix-skin .librevjs-seek-handle { + width: 1.5em; + height: 100% +} + +.librevjs-libre-mix-skin .librevjs-seek-handle:before { + padding-top: .1em +} + + +/* Time Display +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-time-controls { + font-size: 1em; + font-weight: 700; + /*mayor visibilidad*/ + line-height: 3em +} + +.librevjs-libre-mix-skin .librevjs-current-time { + float: left +} + +.librevjs-libre-mix-skin .librevjs-duration { + float: left +} + +.librevjs-libre-mix-skin .librevjs-remaining-time { + display: none; + float: left +} + +.librevjs-time-divider { + float: left; + line-height: 3em +} + + +/* Fullscreen +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-fullscreen-control { + width: 3.8em; + cursor: pointer; + float: right +} + +.librevjs-libre-mix-skin .librevjs-fullscreen-control:before { + content: "\e000" +} + + +/* Switch to the exit icon when the player is in fullscreen */ + +.librevjs-libre-mix-skin.librevjs-fullscreen .librevjs-fullscreen-control:before { + content: "\e00b" +} + + +/* Big Play Button (play button at start) +-------------------------------------------------------------------------------- +Positioning of the play button in the center or other corners can be done more +easily in the skin designer by LibreVideoJS FreeArts. +*/ + +.librevjs-libre-mix-skin .librevjs-big-play-button { + /* Center it horizontally */ + left: 50%; + margin-left: -1.85em; + /* Center it vertically */ + top: 50%; + margin-top: -1.3em; + font-size: 2em; + display: block; + z-index: 2; + position: absolute; + width: 3.8em; + height: 2.6em; + text-align: center; + vertical-align: middle; + cursor: pointer; + opacity: 1; + /* Need a slightly gray bg so it can be seen on black backgrounds */ + /* background-color-with-alpha */ + background-color: #232323; + background-color: rgba(35, 35, 35, 0.8); + border: 0 solid; + /* border-radius */ + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + border-radius: 0.4em; + /* transition */ + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; +} + + +/* Hide if controls are disabled */ + +.librevjs-libre-mix-skin.librevjs-controls-disabled .librevjs-big-play-button { + display: none; +} + + +/* Hide when video starts playing */ + +.librevjs-libre-mix-skin.librevjs-has-started .librevjs-big-play-button { + display: none; +} + + +/* Hide on mobile devices. Remove when we stop using native controls + by default on mobile */ + +.librevjs-libre-mix-skin.librevjs-using-native-controls .librevjs-big-play-button { + display: none; +} + +.librevjs-libre-mix-skin:hover .librevjs-big-play-button, .librevjs-libre-mix-skin .librevjs-big-play-button:focus { + outline: 0; + cursor: pointer; + /* IE8 needs a non-glow hover state */ + background-color: rgb(244, 156, 18); + /*color del boton play al hacer focus*/ + color: #FFFFFF; +} + +.librevjs-libre-mix-skin .librevjs-big-play-button:before { + content: "\e001"; + font-family: LibreVideoJS; + /* In order to center the play icon vertically we need to set the line height + to the same as the button height */ + line-height: 2.6em; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center/* Needed for IE8 */ + ; + position: absolute; + left: 0; + width: 100%; + height: 100%; +} + +.librevjs-error .librevjs-big-play-button { + display: none; +} + + +/* Loading Spinner +-------------------------------------------------------------------------------- +*/ + +.librevjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + font-size: 4em; + line-height: 1; + width: 1em; + height: 1em; + margin-left: -.5em; + margin-top: -.5em; + opacity: .75; + -webkit-animation: spin 1.5s infinite linear; + -moz-animation: spin 1.5s infinite linear; + -o-animation: spin 1.5s infinite linear; + animation: spin 1.5s infinite linear +} + +.librevjs-libre-mix-skin .librevjs-loading-spinner:before { + content: "\e01e"; + font-family: LibreVideoJS; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + text-align: center; + text-shadow: 0 0 .1em #000 +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) + } + 100% { + -moz-transform: rotate(359deg) + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) + } + 100% { + -webkit-transform: rotate(359deg) + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg) + } + 100% { + -o-transform: rotate(359deg) + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg) + } + 100% { + transform: rotate(359deg) + } +} + + +/* Menu Buttons (Captions/Subtitles/etc.) +-------------------------------------------------------------------------------- +*/ + +.librevjs-libre-mix-skin .librevjs-menu-button { + float: right; + cursor: pointer; +} + +.librevjs-libre-mix-skin .librevjs-menu { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 0; + margin-bottom: 3em; + border-left: 2em solid transparent; + border-right: 2em solid transparent; + border-top: 1.55em solid #000; + border-top-color: rgba(7, 40, 50, .5); +} + + +/* Button Pop-up Menu */ + +.librevjs-libre-mix-skin .librevjs-menu-button .librevjs-menu .librevjs-menu-content { + display: block; + padding: 0; + margin: 0; + position: absolute; + width: 10em; + bottom: 1.5em; + /* Same bottom as librevjs-menu border-top */ + max-height: 15em; + overflow: auto; + left: -5em; + /* Width of menu - width of button / 2 */ + /* background-color-with-alpha */ + background-color: #07141e; + background-color: rgba(7, 20, 30, .7); + -webkit-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + -moz-box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); + box-shadow: -.2em -.2em .3em rgba(255, 255, 255, .2); +} + +.librevjs-libre-mix-skin .librevjs-menu-button:hover .librevjs-menu { + display: block; +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li { + list-style: none; + margin: 0; + padding: .3em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; +} + + +/* Select color menu subtitles/captions */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected { + color: #fff; + background-color: rgb(241, 196, 14); +} + +.librevjs-libre-mix-skin .librevjs-menu-button ul li:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li:hover, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:focus, .librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-selected:hover { + outline: 0; + color: #fff; + background-color: #f1c40f; +} + + +/*End Select color menu subtitles/caption */ + +.librevjs-libre-mix-skin .librevjs-menu-button ul li.librevjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 .3em; + font-weight: 700; + cursor: default; +} + + +/* Subtitles Button */ + +.librevjs-libre-mix-skin .librevjs-subtitles-button:before { + content: "\e00c" +} + + +/* Captions Button */ + +.librevjs-libre-mix-skin .librevjs-captions-button:before { + content: "\e008" +} + + +/* Replacement for focus outline */ + +.librevjs-libre-mix-skin .librevjs-captions-button:focus .librevjs-control-content:before, .librevjs-libre-mix-skin .librevjs-captions-button:hover .librevjs-control-content:before { + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; +} + + +/* +REQUIRED STYLES (be careful overriding) +================================================================================ +When loading the player, the video tag is replaced with a DIV, +that will hold the video tag or object tag for other playback methods. +The div contains the video playback element (HTML5) and controls, +and sets the width and height of the video. +** If you want to add some kind of border/padding (e.g. a frame), or special +positioning, use another containing element. Otherwise you risk messing up +control positioning and full window mode. ** +*/ + +.cliplibre-js { + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + vertical-align: middle; + font-weight: 500; + font-style: normal; + font-family: Arial, sans-serif; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + + +/* Playback technology elements expand to the width/height of the containing div <video> */ + +.cliplibre-js .librevjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.cliplibre-js:-moz-full-screen { + position: absolute +} + + +/* Fullscreen Styles */ + +body.librevjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; +} + +.cliplibre-js.librevjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%!important; + height: 100%!important; + position: absolute; +} + +.cliplibre-js:-webkit-full-screen { + width: 100%!important; + height: 100%!important +} + +.cliplibre-js.librevjs-fullscreen.librevjs-user-inactive { + cursor: none +} + + +/* Poster Styles */ + +.librevjs-poster { + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + cursor: pointer; + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100% +} + +.librevjs-poster img { + display: block; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100% +} + + +/* Hide the poster when native controls are used otherwise it covers them */ + +.cliplibre-js.librevjs-using-native-controls .librevjs-poster { + display: none +} + + +/* Text Track Styles */ + + +/* Overall track holder for both captions and subtitles */ + +.cliplibre-js .librevjs-text-track-display { + text-align: center; + position: absolute; + bottom: 4em; + left: 1em; + right: 1em +} + + +/* Individual tracks */ + +.cliplibre-js .librevjs-text-track { + display: none; + font-size: 1.7em; + text-align: center; + margin-bottom: .1em; + /* Transparent black background, or fallback to all black (oldIE) */ + background-color: #000; + background-color: rgba(0, 0, 0, .6) +} + +.cliplibre-js .librevjs-subtitles { + color: #fff +} + +.cliplibre-js .librevjs-captions { + color: rgb(255, 237, 0); + background-color: rgba(2, 7, 11, 0.7); +} + +.librevjs-tt-cue { + display: block +} + + +/* Hide disabled or unsupported controls */ + +.librevjs-libre-mix-skin .librevjs-hidden { + display: none +} + +.librevjs-lock-showing { + display: block!important; + opacity: 1; + visibility: visible +} + + +/* Opctional Styles No support HTML5*/ + +.no_html5 { + background: black none repeat scroll 0 0; + color: white; + height: 160px; + padding: 130px 10px 20px; + text-align: center; +} + + +/*Title Resolution | subtitles and Caption*/ + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title { + color: #f1c40f; + background-color: inherit; +} + +.librevjs-libre-mix-skin ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + color: #f39c12; + background-color: inherit; +} + + +/*Responsive*/ + +.cliplibre-js-responsive-container.librevjs-hd { + padding-top: 56.25%; +} + +.cliplibre-js-responsive-container.librevjs-sd { + padding-top: 75%; +} + +.cliplibre-js-responsive-container { + width: 100%; + position: relative; +} + +.cliplibre-js-responsive-container .cliplibre-js { + height: 100% !important; + width: 100% !important; + position: absolute; + top: 0; + left: 0; +} + +@media screen and (max-width: 800px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.5em; + margin-bottom: -0.2em; + } +} + +@media screen and (max-width: 600px) { + .cliplibre-js .librevjs-text-track { + font-size: 1.2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 2em; + } +} + +@media screen and (max-width: 413px) { + .cliplibre-js { + font-size: 8px; + } +} + +@media screen and (max-width: 400px) { + .cliplibre-js .librevjs-text-track { + font-size: 1em; + } + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 2em; + } + .cliplibre-js .librevjs-text-track-display { + bottom: 1em; + } +} + +@media screen and (max-width: 335px) { + .cliplibre-js { + font-size: 6px; + } +} + +@media screen and (max-width: 150px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.8em; + } +} + +@media screen and (max-width: 90px) { + .librevjs-libre-mix-skin .librevjs-big-play-button { + font-size: 1.4em; + } +} diff --git a/css/normalize.css b/css/normalize.css new file mode 100644 index 0000000..e086df0 --- /dev/null +++ b/css/normalize.css @@ -0,0 +1,527 @@ +/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */ + + +/** + * 1. Change the default font family in all browsers (opinionated). + * 2. Correct the line height in all browsers. + * 3. Prevent adjustments of font size after orientation changes in + * IE on Windows Phone and in iOS. + */ + + +/* Document + ========================================================================== */ + +html { + font-family: sans-serif; + /* 1 */ + line-height: 1.15; + /* 2 */ + -ms-text-size-adjust: 100%; + /* 3 */ + -webkit-text-size-adjust: 100%; + /* 3 */ +} + + +/* Sections + ========================================================================== */ + + +/** + * Remove the margin in all browsers (opinionated). + */ + +body { + margin: 0; +} + + +/** + * Add the correct display in IE 9-. + */ + +article, aside, footer, header, nav, section { + display: block; +} + + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + + +/* Grouping content + ========================================================================== */ + + +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in IE. + */ + +figcaption, figure, main { + /* 1 */ + display: block; +} + + +/** + * Add the correct margin in IE 8. + */ + +figure { + margin: 1em 40px; +} + + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; + /* 1 */ + height: 0; + /* 1 */ + overflow: visible; + /* 2 */ +} + + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + + +/* Text-level semantics + ========================================================================== */ + + +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + +a { + background-color: transparent; + /* 1 */ + -webkit-text-decoration-skip: objects; + /* 2 */ +} + + +/** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ + +a:active, a:hover { + outline-width: 0; +} + + +/** + * 1. Remove the bottom border in Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; + /* 1 */ + text-decoration: underline; + /* 2 */ + text-decoration: underline dotted; + /* 2 */ +} + + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ + +b, strong { + font-weight: inherit; +} + + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, strong { + font-weight: bolder; +} + + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, kbd, samp { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + + +/** + * Add the correct font style in Android 4.3-. + */ + +dfn { + font-style: italic; +} + + +/** + * Add the correct background and color in IE 9-. + */ + +mark { + background-color: #ff0; + color: #000; +} + + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + + +/* Embedded content + ========================================================================== */ + + +/** + * Add the correct display in IE 9-. + */ + +audio, video { + display: inline-block; +} + + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + + +/** + * Remove the border on images inside links in IE 10-. + */ + +img { + border-style: none; +} + + +/** + * Hide the overflow in IE. + */ + +svg:not(:root) { + overflow: hidden; +} + +video { + width: 100%; + height: auto; +} + +/* Forms + ========================================================================== */ + + +/** + * 1. Change the font styles in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ + +button, input, optgroup, select, textarea { + font-family: sans-serif; + /* 1 */ + font-size: 100%; + /* 1 */ + line-height: 1.15; + /* 1 */ + margin: 0; + /* 2 */ +} + + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, input { + /* 1 */ + overflow: visible; +} + + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, select { + /* 1 */ + text-transform: none; +} + + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ + +button, html [type="button"], +/* 1 */ + +[type="reset"], [type="submit"] { + -webkit-appearance: button; + /* 2 */ +} + + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, [type="button"]:-moz-focusring, [type="reset"]:-moz-focusring, [type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + + +/** + * Change the border, margin, and padding in all browsers (opinionated). + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; + /* 1 */ + color: inherit; + /* 2 */ + display: table; + /* 1 */ + max-width: 100%; + /* 1 */ + padding: 0; + /* 3 */ + white-space: normal; + /* 1 */ +} + + +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ +} + + +/** + * Remove the default vertical scrollbar in IE. + */ + +textarea { + overflow: auto; +} + + +/** + * 1. Add the correct box sizing in IE 10-. + * 2. Remove the padding in IE 10-. + */ + +[type="checkbox"], [type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ +} + + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button { + height: auto; +} + + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + + +/** + * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-cancel-button, [type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + + +/* Interactive + ========================================================================== */ + + +/* + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + */ + +details, +/* 1 */ + +menu { + display: block; +} + + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + + +/* Scripting + ========================================================================== */ + + +/** + * Add the correct display in IE 9-. + */ + +canvas { + display: inline-block; +} + + +/** + * Add the correct display in IE. + */ + +template { + display: none; +} + + +/* Hidden + ========================================================================== */ + + +/** + * Add the correct display in IE 10-. + */ + +[hidden] { + display: none; +} diff --git a/css/proggrestips/proggrestips.css b/css/proggrestips/proggrestips.css new file mode 100644 index 0000000..e08bbe2 --- /dev/null +++ b/css/proggrestips/proggrestips.css @@ -0,0 +1,53 @@ +/*! + * proggrestips.css + * + * Copyleft 2017 Jesus Eduardo <heckyel@cybersy> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + */ + +.librevjs-progress-tip { + visibility: hidden; + display: block; + opacity: 0.8; + padding: 5px; + font-size: 10px; + position: absolute; + z-index: 100000; +} + +.librevjs-progress-tip-arrow { + background: url(data:image/gif;base64,R0lGODlhCQAJAIABAAAAAAAAACH5BAEAAAEALAAAAAAJAAkAAAIRjAOnwIrcDJxvwkplPtchVQAAOw==) no-repeat top left; + bottom: 0; + left: 50%; + margin-left: -4px; + background-position: bottom left; + position: absolute; + width: 9px; + height: 5px; +} + +.librevjs-progress-tip-inner { + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + padding: 5px 8px 4px 8px; + background-color: black; + color: white; + max-width: 200px; + text-align: center; +} diff --git a/css/selector/video-quality-selector.css b/css/selector/video-quality-selector.css new file mode 100644 index 0000000..b3a0f12 --- /dev/null +++ b/css/selector/video-quality-selector.css @@ -0,0 +1,36 @@ +@charset "utf-8"; + +/* +You are free to style the button however you wish. I plan to use +an icon from my site's own icon font to make it more visible. These +are just basic styles to make it look ok with plain text. +*/ + + +/* Position the button */ + +.librevjs-res-button { + font-weight: bold; + float: right; + line-height: 3em; +} + + +/* Don't show hover effects on title */ + +ul li.librevjs-menu-title.librevjs-res-menu-title:hover { + cursor: default; + background-color: transparent; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + + +/* Needed to keep text visible in LibreVideoJS */ + +.librevjs-res-button .librevjs-control-text { + width: auto; + height: auto; + clip: auto; +} diff --git a/demo-custom-material-multicolors.html b/demo-custom-material-multicolors.html new file mode 100644 index 0000000..84c6dae --- /dev/null +++ b/demo-custom-material-multicolors.html @@ -0,0 +1,251 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS basado en VideoJS v4.3.</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!-- Favicon Libre --> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + .change_color { + text-align: center; + } + + .change_color input[type='Button'] { + display: inline-block; + border-style: none; + cursor: pointer; + font-size: 12px; + text-align: center; + margin-top: 10px; + padding: 5px 10px; + } + + .change_color input[onclick="multiColor('teal');"] { + background-color: #2ecc71; + } + + .change_color input[onclick="multiColor('blue');"] { + background-color: #3498db; + } + + .change_color input[onclick="multiColor('yellow');"] { + background-color: #f1c40f; + } + + .change_color input[onclick="multiColor('red');"] { + background-color: #e74c3c; + } + + .change_color input[onclick="multiColor('purple');"] { + background-color: #9b59b6; + } + + .change_color input[onclick="multiColor('grey');"] { + background-color: #9e9e9e; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!-- Ending | Estilos de la Página --> + <!-- LibreVideoJS Estilos --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <script> + /* + @licstart The following is the entire license notice for the + JavaScript code in this page. + + Copyleft 2017 Jesús Eduardo. + + The JavaScript code in this page is free software: you can + redistribute it and/or modify it under the terms of the GNU + General Public License (GNU GPL) as published by the Free Software + Foundation, either version 3 of the License, or (at your option) + any later version. The code is distributed WITHOUT ANY WARRANTY; + without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + + As additional permission under GNU GPL version 3 section 7, you + may distribute non-source (e.g., minimized or compacted) forms of + that code without the copy of the GNU GPL normally required by + section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + @licend The above is the entire license notice + for the JavaScript code in this page. + */ + </script> + <!-- LibreVideoJS - estilos --> + <script> + var filename = "./css/librevideojs-material/libre-skin-teal.css"; + var _color = location.search.split('color=')[1]; + if (_color != undefined && _color != "" && _color != "teal") + filename = "./css/librevideojs-material/libre-skin-" + _color + ".css"; + var fileref = document.createElement("link"); + fileref.setAttribute("rel", "stylesheet"); + fileref.setAttribute("type", "text/css"); + fileref.setAttribute("href", filename); + document.getElementsByTagName("head")[0].appendChild(fileref); + </script> + <!--LibreVideoJS--> + <script src="js/cliplibrejs.dev.js"></script> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Sección Libre</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls="controls" preload="none" poster="images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="captions" src="./subtitles/libre_es.vtt" srclang="es" label="Español" default=""> + <track kind="subtitles" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + <div class="change_color"> + <input type="Button" onclick="multiColor('teal');" value="teal"> + <input type="Button" onclick="multiColor('blue');" value="blue"> + <input type="Button" onclick="multiColor('yellow');" value="yellow"> + <input type="Button" onclick="multiColor('red');" value="red"> + <input type="Button" onclick="multiColor('purple');" value="purple"> + <input type="Button" onclick="multiColor('grey');" value="grey"> + </div> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + <br> El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys + Change of Colors--> + <script type="text/javascript"> + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-libre-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }); + }); + function multiColor(_color) { + history.replaceState({}, '', '?color=' + _color); + location.reload(); + }; + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + + function multiColor(_color) { + history.replaceState({}, '', '?color=' + _color); + location.reload(); + }; + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!--Script NO necesario | solo para la fecha--> + <script src="./js/fecha.js"></script> +</body> + +</html> diff --git a/demo-custom-material.html b/demo-custom-material.html new file mode 100644 index 0000000..596b39f --- /dev/null +++ b/demo-custom-material.html @@ -0,0 +1,165 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS basado en VideoJS v4.3.</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!--Favicon Libre--> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!--Ending | Estilos de la Página --> + <!-- LibreVideoJS Estilos --> + <link href="./css/librevideojs-material/libre-skin-teal.css" rel="stylesheet" type="text/css"> + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <!--LibreVideoJS-Integrado(cliplibrejs + Selector + Hotkeys)--> + <script src="./js/cliplibrejs.dev.js"></script> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Sección Libre</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls="controls" preload="none" poster="images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="captions" src="./subtitles/libre_es.vtt" srclang="es" label="Español" default=""> + <track kind="subtitles" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + <br> El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys --> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-libre-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }); + }); + // @license-end + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + // @license-end + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo desde 2016 - <span id="year"></span>. + </footer> + <!--Script NO necesario | solo para la fecha--> + <script src="./js/fecha.js"></script> +</body> + +</html> diff --git a/demo-custom-skin.html b/demo-custom-skin.html new file mode 100644 index 0000000..5340808 --- /dev/null +++ b/demo-custom-skin.html @@ -0,0 +1,164 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS basado en VideoJS v4.3.</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!--Favicon Libre--> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!--Ending | Estilos de la Página --> + <!-- LibreVideoJS Estilos --> + <link href="./css/libre-custom-skin/custom_skin.teal.css" rel="stylesheet" type="text/css"> + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <!--LibreVideoJS-Integrado(cliplibrejs + Selector + Hotkeys)--> + <script src="./js/cliplibrejs.dev.js"></script> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Sección Libre</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls preload="none" poster="images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="./subtitles/libre_en.vtt" srclang="en" label="English"/> + <track kind="captions" src="./subtitles/libre_es.vtt" srclang="es" label="Español" default/> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software.<br/> El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe + pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys --> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-custom-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }); + }); + // @license-end + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + // @license-end + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!--Script NO necesario | solo para la fecha--> + <script src="./js/fecha.js"></script> +</body> + +</html> diff --git a/demo-default-progreestips.html b/demo-default-progreestips.html new file mode 100644 index 0000000..df450bc --- /dev/null +++ b/demo-default-progreestips.html @@ -0,0 +1,173 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!-- Favicon Libre --> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!--Ending | Estilos de la Página --> + + <!-- Begin | LibreVideoJS --> + <!-- LibreVideoJS Estilos --> + <link href="./css/default/cliplibre-js-progreestips.dev.css" rel="stylesheet" type="text/css"> + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <!-- LibreVideoJS JavaScript --> + <script src="./js/cliplibrejs.developer.js"></script> + <!-- Ending | LibreVideoJS --> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Sección Libre</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls preload="none" poster="images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="subtitles/libre_en.vtt" srclang="en" label="English"/> + <track kind="captions" src="subtitles/libre_es.vtt" srclang="es" label="Español" default/> + <track kind="subtitles" src="subtitles/libre_en.vtt" srclang="en" label="English"/> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + </p> + <p> + El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys --> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-default-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }), + this.progressTips(); + }); + // @license-end + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + // @license-end + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!--Script NO necesario - solo para la fecha actual--> + <script src="./js/fecha.js"></script> + <!-- jQuery 3.1.1 requerido por LibreVideoJS ProggresTips --> + <script src="./js/jquery-3.1.1.js"></script> +</body> + +</html> diff --git a/demo-mix-material.html b/demo-mix-material.html new file mode 100644 index 0000000..f3881e0 --- /dev/null +++ b/demo-mix-material.html @@ -0,0 +1,166 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS basado en VideoJS v4.3.</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!-- Favicon Libre --> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!--Ending | Estilos de la Página --> + <!-- LibreVideoJS Estilos --> + <link href="./css/mix-material/mix-teal.css" rel="stylesheet" type="text/css"> + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <!-- LibreVideoJS JavaScript --> + <script src="./js/cliplibrejs.dev.js"></script> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Sección Libre</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls="controls" preload="none" poster="./images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="captions" src="./subtitles/libre_es.vtt" srclang="es" label="Español" default=""> + <track kind="subtitles" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="subtitles" src="./subtitles/libre_es.vtt" srclang="es" label="Español"> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + <br> El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys --> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-libre-mix-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }); + }); + // @license-end + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + // @license-end + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!--Script NO necesario | solo para la fecha--> + <script src="./js/fecha.js"></script> +</body> + +</html> diff --git a/demo-mix-multicolors.html b/demo-mix-multicolors.html new file mode 100644 index 0000000..5d1d091 --- /dev/null +++ b/demo-mix-multicolors.html @@ -0,0 +1,254 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS basado en VideoJS v4.3.</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!-- Favicon Libre --> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + .change_color { + text-align: center; + } + + .change_color input[type='Button'] { + display: inline-block; + border-style: none; + cursor: pointer; + font-size: 12px; + text-align: center; + margin-top: 10px; + padding: 5px 10px; + } + + .change_color input[onclick="multiColor('teal');"] { + background-color: #2ecc71; + } + + .change_color input[onclick="multiColor('blue');"] { + background-color: #3498db; + } + + .change_color input[onclick="multiColor('yellow');"] { + background-color: #f1c40f; + } + + .change_color input[onclick="multiColor('red');"] { + background-color: #e74c3c; + } + + .change_color input[onclick="multiColor('purple');"] { + background-color: #9b59b6; + } + + .change_color input[onclick="multiColor('grey');"] { + background-color: #9e9e9e; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!--Ending | Estilos de la Página --> + + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <script> + /* + @licstart The following is the entire license notice for the + JavaScript code in this page. + + Copyleft 2017 Jesús Eduardo. + + The JavaScript code in this page is free software: you can + redistribute it and/or modify it under the terms of the GNU + General Public License (GNU GPL) as published by the Free Software + Foundation, either version 3 of the License, or (at your option) + any later version. The code is distributed WITHOUT ANY WARRANTY; + without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + + As additional permission under GNU GPL version 3 section 7, you + may distribute non-source (e.g., minimized or compacted) forms of + that code without the copy of the GNU GPL normally required by + section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + @licend The above is the entire license notice + for the JavaScript code in this page. + */ + </script> + <!-- LibreVideoJS Estilos --> + <script> + var filename = "./css/mix-material/mix-teal.css"; + var _color = location.search.split('color=')[1]; + if (_color != undefined && _color != "" && _color != "teal") + filename = "./css/mix-material/mix-" + _color + ".css"; + var fileref = document.createElement("link"); + fileref.setAttribute("rel", "stylesheet"); + fileref.setAttribute("type", "text/css"); + fileref.setAttribute("href", filename); + document.getElementsByTagName("head")[0].appendChild(fileref); + </script> + <!--LibreVideoJS JavaScript--> + <script src="./js/cliplibrejs.dev.js"></script> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Sección Libre</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls="controls" preload="none" poster="images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="captions" src="subtitles/libre_es.vtt" srclang="es" label="Español" default=""> + <track kind="subtitles" src="subtitles/libre_en.vtt" srclang="en" label="English"> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + <div class="change_color"> + <input type="Button" onclick="multiColor('teal');" value="teal"> + <input type="Button" onclick="multiColor('blue');" value="blue"> + <input type="Button" onclick="multiColor('yellow');" value="yellow"> + <input type="Button" onclick="multiColor('red');" value="red"> + <input type="Button" onclick="multiColor('purple');" value="purple"> + <input type="Button" onclick="multiColor('grey');" value="grey"> + </div> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + </p> + <p> + El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys + Change of Colors--> + <script type="text/javascript"> + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-libre-mix-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }); + }); + function multiColor(_color) { + history.replaceState({}, '', '?color=' + _color); + location.reload(); + }; + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + + function multiColor(_color) { + history.replaceState({}, '', '?color=' + _color); + location.reload(); + }; + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!--Script NO necesario - solo para la fecha actual--> + <script src="./js/fecha.js"></script> +</body> + +</html> diff --git a/demo-progreestips-multicolors.html b/demo-progreestips-multicolors.html new file mode 100644 index 0000000..af2a533 --- /dev/null +++ b/demo-progreestips-multicolors.html @@ -0,0 +1,271 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS basado en VideoJS v4.3.</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!-- Favicon Libre --> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + .change_color { + text-align: center; + } + + .change_color input[type='Button'] { + display: inline-block; + border-style: none; + cursor: pointer; + font-size: 12px; + text-align: center; + margin-top: 10px; + padding: 5px 10px; + } + + .change_color input[onclick="multiColor('teal');"] { + background-color: #2ecc71; + } + + .change_color input[onclick="multiColor('blue');"] { + background-color: #3498db; + } + + .change_color input[onclick="multiColor('yellow');"] { + background-color: #f1c40f; + } + + .change_color input[onclick="multiColor('red');"] { + background-color: #e74c3c; + } + + .change_color input[onclick="multiColor('purple');"] { + background-color: #9b59b6; + } + + .change_color input[onclick="multiColor('grey');"] { + background-color: #9e9e9e; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!-- Ending | Estilos de la Página --> + + <!-- Begin | LibreVideoJS --> + <!-- LibreVideoJS ProggresTips --> + <link rel="stylesheet" href="./css/proggrestips/proggrestips.css"> + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <script> + /* + @licstart The following is the entire license notice for the + JavaScript code in this page. + + Copyleft 2017 Jesús Eduardo. + + The JavaScript code in this page is free software: you can + redistribute it and/or modify it under the terms of the GNU + General Public License (GNU GPL) as published by the Free Software + Foundation, either version 3 of the License, or (at your option) + any later version. The code is distributed WITHOUT ANY WARRANTY; + without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + + As additional permission under GNU GPL version 3 section 7, you + may distribute non-source (e.g., minimized or compacted) forms of + that code without the copy of the GNU GPL normally required by + section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + + @licend The above is the entire license notice + for the JavaScript code in this page. + */ + </script> + <!-- LibreVideoJS Estilos --> + <script> + var filename = "./css/mix-material/mix-teal.css"; + var _color = location.search.split('color=')[1]; + if (_color != undefined && _color != "" && _color != "teal") + filename = "./css/mix-material/mix-" + _color + ".css"; + var fileref = document.createElement("link"); + fileref.setAttribute("rel", "stylesheet"); + fileref.setAttribute("type", "text/css"); + fileref.setAttribute("href", filename); + document.getElementsByTagName("head")[0].appendChild(fileref); + </script> + <!-- LibreVideoJS JavaScript --> + <script src="./js/cliplibrejs.developer.js"></script> + <!-- Ending | LibreVideoJS --> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Demo con la funcionalidad de ProgressTips | Requiere jQuery</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls="controls" preload="none" poster="./images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="captions" src="./subtitles/libre_es.vtt" srclang="es" label="Español" default=""> + <track kind="subtitles" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="subtitles" src="./subtitles/libre_es.vtt" srclang="es" label="Español"> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + <div class="change_color"> + <input type="Button" onclick="multiColor('teal');" value="teal"> + <input type="Button" onclick="multiColor('blue');" value="blue"> + <input type="Button" onclick="multiColor('yellow');" value="yellow"> + <input type="Button" onclick="multiColor('red');" value="red"> + <input type="Button" onclick="multiColor('purple');" value="purple"> + <input type="Button" onclick="multiColor('grey');" value="grey"> + </div> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + </p> + <p> + El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys + ProgreesTips + Cambio de Colores--> + <script type="text/javascript"> + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-libre-mix-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }),/*ProgressTips*/ + this.progressTips(); + }); + function multiColor(_color) { + history.replaceState({}, '', '?color=' + _color); + location.reload(); + }; + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); /*Cambio de colores*/ + function multiColor(_color) { + history.replaceState({}, '', '?color=' + _color); + location.reload(); + }; + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <!-- ProgressTips --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs( '#example', {}, function() {this.progressTips();} ); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!-- Script NO necesario | solo para la fecha --> + <script src="./js/fecha.js"></script> + <!-- jQuery 3.1.1 requerido por LibreVideoJS ProggresTips --> + <script src="./js/jquery-3.1.1.js"></script> +</body> + +</html> diff --git a/demo-progreestips.html b/demo-progreestips.html new file mode 100644 index 0000000..f552693 --- /dev/null +++ b/demo-progreestips.html @@ -0,0 +1,183 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS basado en VideoJS v4.3.</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!-- Favicon Libre --> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!-- Ending | Estilos de la Página --> + <!-- Begin | LibreVideoJS --> + <!-- LibreVideoJS Estilos --> + <link href="./css/mix-material/mix-teal.css" rel="stylesheet" type="text/css"> + <!-- LibreVideoJS ProggresTips --> + <link rel="stylesheet" href="./css/proggrestips/proggrestips.css"> + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <!-- LibreVideoJS Library --> + <script src="./js/cliplibrejs.developer.js"></script> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Demo con la funcionalidad de ProgressTips | Requiere jQuery</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls="controls" preload="none" poster="./images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="captions" src="./subtitles/libre_es.vtt" srclang="es" label="Español" default=""> + <track kind="subtitles" src="./subtitles/libre_en.vtt" srclang="en" label="English"> + <track kind="subtitles" src="./subtitles/libre_es.vtt" srclang="es" label="Español"> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + </p> + <p> + El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys + ProgreesTips --> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-libre-mix-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }), + this.progressTips(); + }); + // @license-end + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + // @license-end + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <!-- ProgressTips --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs( '#example', {}, function() {this.progressTips();} ); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!-- Script NO necesario | solo para la fecha --> + <script src="./js/fecha.js"></script> + <!-- jQuery 3.1.1 requerido por LibreVideoJS ProggresTips --> + <script src="./js/jquery-3.1.1.js"></script> +</body> + +</html> diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..ca045b6 --- /dev/null +++ b/demo.html @@ -0,0 +1,170 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!-- Favicon Libre --> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!--Ending | Estilos de la Página --> + + <!-- Begin | LibreVideoJS --> + <!-- LibreVideoJS Estilos --> + <link href="./css/default/cliplibre-js.dev.css" rel="stylesheet" type="text/css"> + <!-- LibreVideoJS Quality --> + <link rel="stylesheet" href="./css/selector/video-quality-selector.css"> + <!-- LibreVideoJS JavaScript --> + <script src="./js/cliplibrejs.dev.js"></script> + <!-- Ending | LibreVideoJS --> +</head> + +<body> + <header> + <h1>Reproductor LibreVideoJS</h1> + </header> + <section> + <h2>Sección Libre</h2> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls preload="none" poster="images/poster.jpg" data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <source data-res="480p" src="https://archive.org/download/libre848x476/libre848x476.ogv" type="video/ogg"> + <source data-res="240p" src="https://archive.org/download/libre848x476/libre320x240.ogv" type="video/ogg"> + <source data-res="144p" src="https://archive.org/download/libre848x476/libre256x144.ogv" type="video/ogg"> + <track kind="captions" src="subtitles/libre_en.vtt" srclang="en" label="English"/> + <track kind="captions" src="subtitles/libre_es.vtt" srclang="es" label="Español" default/> + <track kind="subtitles" src="subtitles/libre_en.vtt" srclang="en" label="English"/> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + </article> + </section> + <p>Conferencia de Richard M. Stallman en Retina | España</p> + <p>Puede: <a href="https://archive.org/download/libre848x476/libre640x480.ogv" download="Conferencia-de-Richard-M.-Stallman-en-Retina-España" target="_blank">Descargar el vídeo</a></p> + <aside class="clase2"> + <h3>¿Qué es el software Libre?</h3> + <blockquote cite="https://www.gnu.org/home.es.html"> + <p> + Software libre significa que los usuarios tienen la libertad de ejecutar, copiar, distribuir, estudiar, modificar y mejorar el software. + </p> + <p> + El software libre es una cuestión de libertad, no de precio. Para entender el concepto, debe pensarse en «Libre» como en «Libertad de expresión», no como en «cerveza gratis». + </p> + </blockquote> + </aside> + + <!-- Quality Selector + Hotkeys --> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-default-skin"; + // funciones + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p", + } + }, + nativeControlsForTouch: false + }).ready(function(){ + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }); + }); + // @license-end + </script> + + <!-- + Abajo ↓ : Códigos individuales + --> + + <!-- Quality Selector --> + <!-- + <script type="text/javascript"> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example', { + plugins: { + resolutionSelector: { + force_types: ['video/webm', 'video/ogg'], + default_res: "480p" + } + }, + nativeControlsForTouch: false + }); + // @license-end + </script> + --> + + <!-- Hotkeys --> + <!-- + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + --> + + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!--Script NO necesario - solo para la fecha actual--> + <script src="./js/fecha.js"></script> +</body> + +</html> diff --git a/example-hotkeys.html b/example-hotkeys.html new file mode 100644 index 0000000..fe3b628 --- /dev/null +++ b/example-hotkeys.html @@ -0,0 +1,105 @@ +<!DOCTYPE html> +<html lang="es"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Reproductor LibreVideoJS</title> + <link rel="author" type="text/plain" href="humans.txt"> + <!--Favicon Libre--> + <link rel="shortcut icon" href="./images/gnu-linux_libre.png"> + <!-- Normalizador --> + <link href="./css/normalize.css" rel="stylesheet" type="text/css"> + <!--Begin | Estilos de la Página --> + <style> + body { + background-color: #141517; + color: white; + } + + h1, + h2, + h3 { + text-align: center; + } + + a { + text-decoration: none; + color: #189e7d; + } + + a:hover { + color: #1de9b6; + } + + .clase1 { + margin: 20px; + } + + p, + .clase2 { + margin: 20px; + } + + footer { + background-color: #1e1b1f; + text-align: center; + margin: 20px; + padding: 10px; + } + </style> + <!-- Ending | Estilos de la Página --> + <!-- LibreVideoJS - estilos --> + <link href="./css/default/cliplibre-js.dev.css" rel="stylesheet" type="text/css"> + <!--LibreVideoJS--> + <script src="./js/cliplibrejs.dev.js"></script> +</head> + +<body> + <h1> + Demo de LibreVideoJS trabajando con el plugin de hotkeys + </h1> + <article class="clase1"> + <h3>Vídeo de Software Libre</h3> + <video id="example" controls data-setup="{}"> + <source data-res="original" src="https://archive.org/download/libre848x476/libre640x480.ogv" type="video/ogg"> + <p class="no_html5">Lo siento, este navegador no soporta HTML 5. Por favor, cambia o actualiza tu navegador Web</p> + </video> + </article> + <div> + <h2>Instrucciones para hotkeys</h2> + <ul> + <li>FullScreen: F</li> + <li>Volumen: key [Up - Down]</li> + <li>Mute: M</li> + <li>Timeline: Next[Rigth], Prev[Left]</li> + <li>Timeline advance: 0%[key 0], 10%[key 1]..., 90%[key 9]</li> + </ul> + </div> + <!-- Hotkeys --> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + // Insert class base + var estilos = document.getElementById("example"); + estilos.className += " cliplibre-js-responsive-container librevjs-hd cliplibre-js librevjs-default-skin"; + // funciones + cliplibrejs('#example').ready(function() { + this.hotkeys({ + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true + }); + }); + // @license-end + </script> + <footer> + Basado en VideoJS, depurado y escrito por Jesús Eduardo en el año 2016 - <span id="year"></span>. + </footer> + <!-- Script NO necesario | solo para la fecha --> + <script src="./js/fecha.js"></script> +</body> + +</html> diff --git a/fonts/default/vjs.eot b/fonts/default/vjs.eot Binary files differnew file mode 100644 index 0000000..a075c19 --- /dev/null +++ b/fonts/default/vjs.eot diff --git a/fonts/default/vjs.svg b/fonts/default/vjs.svg new file mode 100644 index 0000000..2a7172e --- /dev/null +++ b/fonts/default/vjs.svg @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg"> + <metadata> + This is a custom SVG font generated by IcoMoon. + <iconset grid="16"/> + </metadata> + <defs> + <font id="VideoJS" horiz-adv-x="512"> + <font-face units-per-em="512" ascent="480" descent="-32"/> + <missing-glyph horiz-adv-x="512"/> + <glyph class="hidden" unicode="" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0"/> + <glyph unicode="" d="M 64,416L 224,416L 224,32L 64,32zM 288,416L 448,416L 448,32L 288,32z"/> + <glyph unicode="" d="M 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z"/> + <glyph + unicode="" + d="M 274.51,109.49c-6.143,0-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0,33.941 c 40.55,40.55, 40.55,106.529,0,147.078c-9.373,9.373-9.373,24.569,0,33.941c 9.373,9.372, 24.568,9.372, 33.941,0 c 59.265-59.265, 59.265-155.696,0-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z"/> + <glyph + unicode="" + d="M 359.765,64.235c-6.143,0-12.284,2.343-16.971,7.029c-9.372,9.372-9.372,24.568,0,33.941 c 65.503,65.503, 65.503,172.085,0,237.588c-9.372,9.373-9.372,24.569,0,33.941c 9.372,9.371, 24.569,9.372, 33.941,0 C 417.532,335.938, 440,281.696, 440,224c0-57.695-22.468-111.938-63.265-152.735C 372.049,66.578, 365.907,64.235, 359.765,64.235zM 274.51,109.49c-6.143,0-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0,33.941 c 40.55,40.55, 40.55,106.529,0,147.078c-9.373,9.373-9.373,24.569,0,33.941c 9.373,9.372, 24.568,9.372, 33.941,0 c 59.265-59.265, 59.265-155.696,0-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z"/> + <glyph + unicode="" + d="M 445.020,18.98c-6.143,0-12.284,2.343-16.971,7.029c-9.372,9.373-9.372,24.568,0,33.941 C 471.868,103.771, 496.001,162.030, 496.001,224c0,61.969-24.133,120.229-67.952,164.049c-9.372,9.373-9.372,24.569,0,33.941 c 9.372,9.372, 24.569,9.372, 33.941,0c 52.885-52.886, 82.011-123.2, 82.011-197.99c0-74.791-29.126-145.104-82.011-197.99 C 457.304,21.323, 451.162,18.98, 445.020,18.98zM 359.765,64.235c-6.143,0-12.284,2.343-16.971,7.029c-9.372,9.372-9.372,24.568,0,33.941 c 65.503,65.503, 65.503,172.085,0,237.588c-9.372,9.373-9.372,24.569,0,33.941c 9.372,9.371, 24.569,9.372, 33.941,0 C 417.532,335.938, 440,281.696, 440,224c0-57.695-22.468-111.938-63.265-152.735C 372.049,66.578, 365.907,64.235, 359.765,64.235zM 274.51,109.49c-6.143,0-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0,33.941 c 40.55,40.55, 40.55,106.529,0,147.078c-9.373,9.373-9.373,24.569,0,33.941c 9.373,9.372, 24.568,9.372, 33.941,0 c 59.265-59.265, 59.265-155.696,0-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z" + horiz-adv-x="544"/> + <glyph unicode="" d="M 256,480L 96,224L 256-32L 416,224 z"/> + <glyph + unicode="" + d="M 0,480 L 687.158,480 L 687.158-35.207 L 0-35.207 L 0,480 z M 622.731,224.638 C 621.878,314.664 618.46,353.922 597.131,381.656 C 593.291,387.629 586.038,391.042 580.065,395.304 C 559.158,410.669 460.593,416.211 346.247,416.211 C 231.896,416.211 128.642,410.669 108.162,395.304 C 101.762,391.042 94.504,387.629 90.242,381.656 C 69.331,353.922 66.349,314.664 65.069,224.638 C 66.349,134.607 69.331,95.353 90.242,67.62 C 94.504,61.22 101.762,58.233 108.162,53.967 C 128.642,38.18 231.896,33.060 346.247,32.207 C 460.593,33.060 559.158,38.18 580.065,53.967 C 586.038,58.233 593.291,61.22 597.131,67.62 C 618.46,95.353 621.878,134.607 622.731,224.638 z M 331.179,247.952 C 325.389,318.401 287.924,359.905 220.901,359.905 C 159.672,359.905 111.54,304.689 111.54,215.965 C 111.54,126.859 155.405,71.267 227.907,71.267 C 285.79,71.267 326.306,113.916 332.701,184.742 L 263.55,184.742 C 260.81,158.468 249.843,138.285 226.69,138.285 C 190.136,138.285 183.435,174.462 183.435,212.92 C 183.435,265.854 198.665,292.886 223.951,292.886 C 246.492,292.886 260.81,276.511 262.939,247.952 L 331.179,247.952 z M 570.013,247.952 C 564.228,318.401 526.758,359.905 459.74,359.905 C 398.507,359.905 350.379,304.689 350.379,215.965 C 350.379,126.859 394.244,71.267 466.746,71.267 C 524.625,71.267 565.14,113.916 571.536,184.742 L 502.384,184.742 C 499.649,158.468 488.682,138.285 465.529,138.285 C 428.971,138.285 422.27,174.462 422.27,212.92 C 422.27,265.854 437.504,292.886 462.785,292.886 C 485.327,292.886 499.649,276.511 501.778,247.952 L 570.013,247.952 z " + horiz-adv-x="687.158"/> + <glyph unicode="" d="M 64,416L 448,416L 448,32L 64,32z"/> + <glyph + unicode="" + d="M 192,416A64,64 12780 1 1 320,416A64,64 12780 1 1 192,416zM 327.765,359.765A64,64 12780 1 1 455.765,359.765A64,64 12780 1 1 327.765,359.765zM 416,224A32,32 12780 1 1 480,224A32,32 12780 1 1 416,224zM 359.765,88.235A32,32 12780 1 1 423.765,88.23500000000001A32,32 12780 1 1 359.765,88.23500000000001zM 224.001,32A32,32 12780 1 1 288.001,32A32,32 12780 1 1 224.001,32zM 88.236,88.235A32,32 12780 1 1 152.236,88.23500000000001A32,32 12780 1 1 88.236,88.23500000000001zM 72.236,359.765A48,48 12780 1 1 168.236,359.765A48,48 12780 1 1 72.236,359.765zM 28,224A36,36 12780 1 1 100,224A36,36 12780 1 1 28,224z"/> + <glyph unicode="" d="M 224,192 L 224-16 L 144,64 L 48-32 L 0,16 L 96,112 L 16,192 ZM 512,432 L 416,336 L 496,256 L 288,256 L 288,464 L 368,384 L 464,480 Z"/> + <glyph + unicode="" + d="M 256,448 C 397.385,448 512,354.875 512,240 C 512,125.124 397.385,32 256,32 C 242.422,32 229.095,32.867 216.088,34.522 C 161.099-20.467 95.463-30.328 32-31.776 L 32-18.318 C 66.268-1.529 96,29.052 96,64 C 96,68.877 95.621,73.665 94.918,78.348 C 37.020,116.48 0,174.725 0,240 C 0,354.875 114.615,448 256,448 Z"/> + <glyph + unicode="" + d="M 256,480C 114.615,480,0,365.385,0,224s 114.615-256, 256-256s 256,114.615, 256,256S 397.385,480, 256,480z M 256,352 c 70.692,0, 128-57.308, 128-128s-57.308-128-128-128s-128,57.308-128,128S 185.308,352, 256,352z M 408.735,71.265 C 367.938,30.468, 313.695,8, 256,8c-57.696,0-111.938,22.468-152.735,63.265C 62.468,112.062, 40,166.304, 40,224 c0,57.695, 22.468,111.938, 63.265,152.735l 33.941-33.941c0,0,0,0,0,0c-65.503-65.503-65.503-172.085,0-237.588 C 168.937,73.475, 211.125,56, 256,56c 44.874,0, 87.062,17.475, 118.794,49.206c 65.503,65.503, 65.503,172.084,0,237.588l 33.941,33.941 C 449.532,335.938, 472,281.695, 472,224C 472,166.304, 449.532,112.062, 408.735,71.265z"/> + <glyph + unicode="" + d="M 512,224c-0.639,33.431-7.892,66.758-21.288,97.231c-13.352,30.5-32.731,58.129-56.521,80.96 c-23.776,22.848-51.972,40.91-82.492,52.826C 321.197,466.979, 288.401,472.693, 256,472c-32.405-0.641-64.666-7.687-94.167-20.678 c-29.524-12.948-56.271-31.735-78.367-54.788c-22.112-23.041-39.58-50.354-51.093-79.899C 20.816,287.104, 15.309,255.375, 16,224 c 0.643-31.38, 7.482-62.574, 20.067-91.103c 12.544-28.55, 30.738-54.414, 53.055-75.774c 22.305-21.377, 48.736-38.252, 77.307-49.36 C 194.988-3.389, 225.652-8.688, 256-8c 30.354,0.645, 60.481,7.277, 88.038,19.457c 27.575,12.141, 52.558,29.74, 73.183,51.322 c 20.641,21.57, 36.922,47.118, 47.627,74.715c 6.517,16.729, 10.94,34.2, 13.271,51.899c 0.623-0.036, 1.249-0.060, 1.881-0.060 c 17.673,0, 32,14.326, 32,32c0,0.898-0.047,1.786-0.119,2.666L 512,223.999 z M 461.153,139.026c-11.736-26.601-28.742-50.7-49.589-70.59 c-20.835-19.905-45.5-35.593-72.122-45.895C 312.828,12.202, 284.297,7.315, 256,8c-28.302,0.649-56.298,6.868-81.91,18.237 c-25.625,11.333-48.842,27.745-67.997,47.856c-19.169,20.099-34.264,43.882-44.161,69.529C 51.997,169.264, 47.318,196.729, 48,224 c 0.651,27.276, 6.664,54.206, 17.627,78.845c 10.929,24.65, 26.749,46.985, 46.123,65.405c 19.365,18.434, 42.265,32.935, 66.937,42.428 C 203.356,420.208, 229.755,424.681, 256,424c 26.25-0.653, 52.114-6.459, 75.781-17.017c 23.676-10.525, 45.128-25.751, 62.812-44.391 c 17.698-18.629, 31.605-40.647, 40.695-64.344C 444.412,274.552, 448.679,249.219, 448,224l 0.119,0 c-0.072-0.88-0.119-1.768-0.119-2.666 c0-16.506, 12.496-30.087, 28.543-31.812C 473.431,172.111, 468.278,155.113, 461.153,139.026z"/> + <glyph + unicode="" + d="M 256,480 C 116.626,480 3.271,368.619 0.076,230.013 C 3.036,350.945 94.992,448 208,448 C 322.875,448 416,347.712 416,224 C 416,197.49 437.49,176 464,176 C 490.51,176 512,197.49 512,224 C 512,365.385 397.385,480 256,480 ZM 256-32 C 395.374-32 508.729,79.381 511.924,217.987 C 508.964,97.055 417.008,0 304,0 C 189.125,0 96,100.288 96,224 C 96,250.51 74.51,272 48,272 C 21.49,272 0,250.51 0,224 C 0,82.615 114.615-32 256-32 Z"/> + <glyph + unicode="" + d="M 432,128c-22.58,0-42.96-9.369-57.506-24.415L 158.992,211.336C 159.649,215.462, 160,219.689, 160,224 s-0.351,8.538-1.008,12.663l 215.502,107.751C 389.040,329.369, 409.42,320, 432,320c 44.183,0, 80,35.817, 80,80S 476.183,480, 432,480 s-80-35.817-80-80c0-4.311, 0.352-8.538, 1.008-12.663L 137.506,279.585C 122.96,294.63, 102.58,304, 80,304c-44.183,0-80-35.818-80-80 c0-44.184, 35.817-80, 80-80c 22.58,0, 42.96,9.369, 57.506,24.414l 215.502-107.751C 352.352,56.538, 352,52.311, 352,48 c0-44.184, 35.817-80, 80-80s 80,35.816, 80,80C 512,92.182, 476.183,128, 432,128z"/> + <glyph unicode="" d="M 96,416L 416,224L 96,32 z"/> + <glyph unicode="" d="M 512,480 L 512,272 L 432,352 L 336,256 L 288,304 L 384,400 L 304,480 ZM 224,144 L 128,48 L 208-32 L 0-32 L 0,176 L 80,96 L 176,192 Z"/> + <glyph unicode=" " horiz-adv-x="256"/> + </font> + </defs> +</svg> diff --git a/fonts/default/vjs.ttf b/fonts/default/vjs.ttf Binary files differnew file mode 100644 index 0000000..eb24637 --- /dev/null +++ b/fonts/default/vjs.ttf diff --git a/fonts/default/vjs.woff b/fonts/default/vjs.woff Binary files differnew file mode 100644 index 0000000..c3f0f1d --- /dev/null +++ b/fonts/default/vjs.woff diff --git a/fonts/libre-material/libre-icons.eot b/fonts/libre-material/libre-icons.eot Binary files differnew file mode 100644 index 0000000..8c4be9d --- /dev/null +++ b/fonts/libre-material/libre-icons.eot diff --git a/fonts/libre-material/libre-icons.otf b/fonts/libre-material/libre-icons.otf Binary files differnew file mode 100644 index 0000000..03c8bc8 --- /dev/null +++ b/fonts/libre-material/libre-icons.otf diff --git a/fonts/libre-material/libre-icons.svg b/fonts/libre-material/libre-icons.svg new file mode 100644 index 0000000..42b9a22 --- /dev/null +++ b/fonts/libre-material/libre-icons.svg @@ -0,0 +1,100 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> + <metadata> + Created by FontForge 20170224 at Fri Feb 24 18:22:12 2017 By Jesús Eduardo + </metadata> + <defs> + <font id="libre-icons" horiz-adv-x="1024"> + <font-face + font-family="LibreVideoJS" + font-weight="400" + font-stretch="normal" + units-per-em="1024" + panose-1="0 0 0 0 0 0 0 0 0 0" + ascent="960" + descent="-64" + bbox="-11 -71 1472 971" + underline-thickness="0" + underline-position="0" + unicode-range="U+0001-FFFD"/> + <missing-glyph/> + <glyph glyph-name=".notdef" unicode="�"/> + <glyph glyph-name="glyph1" horiz-adv-x="0" d="M0 0v0v0v0z"/> + <glyph glyph-name="glyph1" horiz-adv-x="0" d="M0 0v0v0v0z"/> + <glyph glyph-name="nonmarkingreturn" horiz-adv-x="341"/> + <glyph glyph-name="uni0001" horiz-adv-x="0" d="M0 0v0v0v0z"/> + <glyph glyph-name="space" unicode=" " horiz-adv-x="512" d="M0 0v0v0v0z"/> + <glyph glyph-name="uniE000" unicode="" d="M3 -61v451l146 -145l200 199l159 -159l-199 -200l145 -146h-451v0zM570 957h451v-451l-146 145l-200 -199l-159 159l199 200l-145 146v0z"/> + <glyph glyph-name="uniE001" unicode="" d="M909 509l-741 441q-7 4 -14 6.5t-15 2.5q-22 0 -37.5 -15.5t-15.5 -37.5v0v-916v0q0 -22 15.5 -37.5t37.5 -15.5q8 0 15.5 2.5t14.5 6.5l740 441q13 10 21 26t8 35t-8 34.5t-21 26.5v0z"/> + <glyph + glyph-name="uniE002" + unicode="" + d="M288 960h-192q-27 0 -45.5 -18.5t-18.5 -45.5v-896q0 -27 18.5 -45.5t45.5 -18.5h192q27 0 45.5 18.5t18.5 45.5v896q0 27 -18.5 45.5t-45.5 18.5v0zM928 960h-192q-27 0 -45.5 -18.5t-18.5 -45.5v-896q0 -27 18.5 -45.5t45.5 -18.5h192q27 0 45.5 18.5t18.5 45.5v896q0 27 -18.5 45.5t-45.5 18.5v0z"/> + <glyph + glyph-name="uniE003" + unicode="" + d="M960 341v-85h-85l-107 107l-107 -107h-85v85l107 107l-107 107v85h85l107 -107l107 107h85v-85l-107 -107l107 -107v0zM416 0q-6 0 -12 2.5t-11 6.5l-246 247h-115q-13 0 -22.5 9.5t-9.5 22.5v320q0 13 9.5 22.5t22.5 9.5h115l246 247q7 6 16.5 8t18.5 -1q9 -4 14.5 -12t5.5 -18v-832q0 -10 -5.5 -18t-14.5 -12q-3 -1 -6 -1.5t-6 -0.5v0z"/> + <glyph + glyph-name="uniE004" + unicode="" + d="M549 219q-9 0 -18 3.5t-16 10.5q-14 14 -14 34t14 34q30 30 45.5 68.5t15.5 78.5t-15.5 78.5t-45.5 68.5q-14 14 -14 34t14 34t34 14t34 -14q44 -45 66.5 -101t22.5 -114t-22.5 -114.5t-66.5 -100.5q-7 -7 -16 -10.5t-18 -3.5v0zM416 0q-6 0 -12 2.5t-11 6.5l-246 247h-115q-13 0 -22.5 9.5t-9.5 22.5v320q0 13 9.5 22.5t22.5 9.5h115l246 247q7 6 16.5 8t18.5 -1q9 -4 14.5 -12t5.5 -18v-832q0 -10 -5.5 -18t-14.5 -12q-3 -1 -6 -1.5t-6 -0.5v0z"/> + <glyph + glyph-name="uniE005" + unicode="" + d="M720 128q-10 0 -18.5 3.5t-15.5 11.5q-14 14 -14 33.5t14 33.5q49 50 73.5 111.5t24.5 126.5t-24.5 126.5t-73.5 111.5q-14 14 -14 33.5t14 33.5t33.5 14.5t33.5 -14.5q31 -30 54.5 -65.5t39.5 -74t24.5 -80.5t8.5 -85t-8.5 -85t-24.5 -80.5t-39.5 -74t-54.5 -66.5q-7 -7 -15.5 -10.5t-18.5 -3.5v0h1zM549 219q-9 0 -18 3.5t-16 10.5q-14 14 -14 34t14 34q30 30 45.5 68.5t15.5 78.5t-15.5 78.5t-45.5 68.5q-14 14 -14 34t14 34t34 14t34 -14q44 -45 66.5 -101t22.5 -114t-22.5 -114.5t-66.5 -100.5q-7 -7 -16 -10.5t-18 -3.5v0zM416 0q-6 0 -12 2.5t-11 6.5l-246 247h-115q-13 0 -22.5 9.5t-9.5 22.5v320q0 13 9.5 22.5t22.5 9.5h115l246 247q7 6 16.5 8t18.5 -1q9 -4 14.5 -12t5.5 -18v-832q0 -10 -5.5 -18t-14.5 -12q-3 -1 -6 -1.5t-6 -0.5v0z"/> + <glyph + glyph-name="uniE006" + unicode="" + horiz-adv-x="1088" + d="M890 38q-9 0 -18 3.5t-16 10.5q-14 14 -14 34t14 34q33 33 58.5 71t42.5 79.5t26 86t9 91.5q0 46 -9 91t-26 86.5t-42.5 79.5t-58.5 71q-14 14 -14 34t14 34t34 14t34 -14q40 -40 70.5 -85.5t51 -96t31.5 -104.5t11 -110t-11 -110t-31.5 -104.5t-51 -96t-70.5 -85.5q-7 -7 -16 -10.5t-18 -3.5v0zM720 128q-10 0 -18.5 3.5t-15.5 11.5q-14 14 -14 33.5t14 33.5q49 50 73.5 111.5t24.5 126.5t-24.5 126.5t-73.5 111.5q-14 14 -14 33.5t14 33.5t33.5 14.5t33.5 -14.5q31 -30 54.5 -65.5t39.5 -74t24.5 -80.5t8.5 -85t-8.5 -85t-24.5 -80.5t-39.5 -74t-54.5 -66.5q-7 -7 -15.5 -10.5t-18.5 -3.5v0h1zM549 219q-9 0 -18 3.5t-16 10.5q-14 14 -14 34t14 34q30 30 45.5 68.5t15.5 78.5t-15.5 78.5t-45.5 68.5q-14 14 -14 34t14 34t34 14t34 -14q44 -45 66.5 -101t22.5 -114t-22.5 -114.5t-66.5 -100.5q-7 -7 -16 -10.5t-18 -3.5v0zM416 0q-6 0 -12 2.5t-11 6.5l-246 247h-115q-13 0 -22.5 9.5t-9.5 22.5v320q0 13 9.5 22.5t22.5 9.5h115l246 247q7 6 16.5 8t18.5 -1q9 -4 14.5 -12t5.5 -18v-832q0 -10 -5.5 -18t-14.5 -12q-3 -1 -6 -1.5t-6 -0.5v0z"/> + <glyph + glyph-name="uniE007" + unicode="" + d="M513 861q-108 0 -199.5 -53.5t-144.5 -145t-53 -199.5t53 -199.5t144.5 -144.5t199.5 -53t200 53t145 144.5t53 199.5t-53 199.5t-145 145t-200 53.5zM513 960q58 0 114 -13t105 -37.5t92 -58.5t77 -77t58.5 -92t37.5 -105t13 -114q0 -101 -39 -193t-106 -158.5t-159 -106t-193 -39.5t-193 39.5t-158.5 106t-105.5 158.5t-39 193t39 193t105.5 158.5t158.5 106t193 39.5zM405 700l344 -223l-344 -224v447z"/> + <glyph + glyph-name="uniE008" + unicode="" + horiz-adv-x="1536" + d="M1324 0h-1112q-61 0 -104.5 43.5t-43.5 105.5v598q0 62 43.5 105.5t104.5 43.5h1112q61 0 104.5 -43.5t43.5 -105.5v-598q0 -62 -43.5 -105.5t-104.5 -43.5v0zM454 500q3 13 8 25t12 22q6 11 15 19t20 14t24.5 9t29.5 3q9 0 17 -1t16 -4t15 -7t13 -9q7 -5 12 -11t9 -13t7 -14t4 -16h90q-2 19 -7 35.5t-13 30.5q-8 15 -18 27t-23 22q-12 10 -26 17t-30 13q-15 5 -31.5 7.5t-34.5 2.5q-24 0 -46 -4.5t-42 -13.5q-19 -8 -35.5 -20t-30.5 -28q-13 -15 -23.5 -33t-17.5 -38q-7 -21 -10.5 -43.5t-3.5 -46.5q0 -23 3.5 -45t10.5 -42t17.5 -38t23.5 -33q14 -15 30.5 -26.5t35.5 -20.5q20 -8 41.5 -12.5t46.5 -4.5q20 0 38 3t34 9t30.5 15t26.5 20t22 25t18 30q7 17 11.5 35t6.5 38h-90q-3 -22 -10.5 -39t-19.5 -31q-12 -13 -29 -19.5t-38 -6.5q-16 0 -29.5 3t-24.5 9t-20 14.5t-15 18.5q-7 10 -12 21.5t-8 24.5q-4 13 -5.5 26t-1.5 27t1.5 27.5t5.5 26.5v0v0v0zM895 500q3 13 8 25t12 22q7 11 16 19t20 14t24.5 9t29.5 3q8 0 16.5 -1t16.5 -4q7 -3 14.5 -7t13.5 -9t11.5 -11t9.5 -13t6.5 -14t3.5 -16h91q-2 19 -7 35.5t-13 30.5q-8 15 -18.5 27t-22.5 22t-26 17t-30 13q-16 5 -32.5 7.5t-33.5 2.5q-25 0 -47 -4.5t-41 -13.5q-20 -8 -36.5 -20t-29.5 -28q-14 -15 -24 -33t-17 -38q-7 -21 -11 -43.5t-4 -46.5q0 -23 4 -45t11 -42t17 -38t24 -33q13 -15 29.5 -26.5t36.5 -20.5q19 -8 41 -12.5t47 -4.5q19 0 37 3t35 9q16 6 30.5 15t26.5 20t22 25t17 30q8 17 12.5 35t6.5 38h-91q-3 -22 -10 -39t-19 -31q-13 -13 -29.5 -19.5t-37.5 -6.5q-16 0 -29.5 3t-24.5 9t-20 14.5t-16 18.5t-12 21.5t-8 24.5t-4.5 26t-1.5 27t1.5 27.5t4.5 26.5v0v0v0z"/> + <glyph glyph-name="uniE00B" unicode="" d="M849 652l128 -127h-390v389l127 -127l171 171l139 -138l-175 -168v0zM310 109l-172 -171l-138 138l171 172l-127 127h390v-390l-124 124v0z"/> + <glyph + glyph-name="uniE00C" + unicode="" + d="M272 476h480v-120h-480v120zM272 656h480v-120h-480v120zM932 896h-840q-25 0 -42.5 -17.5t-17.5 -42.5v-660q0 -25 17.5 -42.5t42.5 -17.5h120v-180l270 180h450q25 0 42.5 17.5t17.5 42.5v660q0 25 -17.5 42.5t-42.5 17.5v0zM872 236h-390l-150 -90v90h-180v540h720v-540v0z"/> + <glyph glyph-name="uniE00D" unicode="" d="M1044 971v-1042h-1055v1042h1055zM328 506l-249 -419h843v1l-193 198l-127 -96l-236 316h-38z"/> + <glyph + glyph-name="uniE01E" + unicode="" + d="M512 960q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19t45 19t19 45v128q0 26 -19 45t-45 19v0zM512 192q-26 0 -45 -18.5t-19 -45.5v-128q0 -27 19 -45.5t45 -18.5t45 18.5t19 45.5v128q0 27 -19 45.5t-45 18.5v0zM783 629l91 91q19 18 19 44.5t-19 45.5t-45.5 19t-45.5 -19l-90 -90q-19 -19 -19 -45.5t19 -45.5t45.5 -19t44.5 19v0zM240 267l-90 -90q-19 -19 -19 -45.5t19 -45.5t45.5 -19t44.5 19l91 91q19 18 19 44.5t-19 45.5t-45.5 19t-45.5 -19v0zM240 810q-18 19 -44.5 19t-45.5 -19t-19 -45.5t19 -44.5l90 -91q19 -19 45.5 -19t45.5 19t19 45.5t-19 45.5l-91 90v0zM783 267q-18 19 -44.5 19t-45.5 -19t-19 -45.5t19 -44.5l90 -91q19 -19 45.5 -19t45.5 19t19 45.5t-19 45.5l-91 90v0zM960 512h-128q-27 0 -45.5 -19t-18.5 -45t18.5 -45t45.5 -19h128q27 0 45.5 19t18.5 45t-18.5 45t-45.5 19v0zM256 448q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45t19 -45t45 -19h128q26 0 45 19t19 45v0z"/> + <glyph + glyph-name="uniE606" + unicode="" + d="M800 448q0 -60 -22.5 -112.5t-61.5 -91.5t-91.5 -61.5t-112.5 -22.5t-112.5 22.5t-91.5 61.5t-61.5 91.5t-22.5 112.5t22.5 112.5t61.5 91.5t91.5 61.5t112.5 22.5t112.5 -22.5t91.5 -61.5t61.5 -91.5t22.5 -112.5v0z"/> + <glyph + glyph-name="uniE607" + unicode="" + horiz-adv-x="1152" + d="M1042 153l-401 686q-25 25 -60.5 25t-60.5 -25l-401 -686q-25 -25 -25 -60.5t25 -60.5h923q25 25 25 60.5t-25 60.5v0zM544 593q0 20 14 34t34 14t34 -14t14 -34v-224q0 -20 -14 -34t-34 -14t-34 14t-14 34v224v0zM592 160q-20 0 -34 14.5t-14 33.5q0 20 14 34t34 14t34 -14t14 -34q0 -19 -14 -33.5t-34 -14.5v0z"/> + <glyph + glyph-name="uniE60C" + unicode="" + horiz-adv-x="1152" + d="M751 486l-575 396q-34 22 -58.5 7.5t-24.5 -57.5v-768q0 -43 24.5 -57.5t58.5 7.5l575 396l11.5 10.5t11.5 27.5t-11.5 27.5l-11.5 10.5v0zM892 927h79q34 0 57 -7.5t23 -40.5v-862q0 -33 -23 -40.5t-57 -7.5h-79q-34 0 -57 7.5t-23 40.5v862q0 33 23 40.5t57 7.5v0z"/> + <glyph + glyph-name="uniE60F" + unicode="" + horiz-adv-x="1152" + d="M968 882l-575 -396l-11 -10.5t-11 -27.5t11 -27.5l11 -10.5l575 -396q34 -22 58.5 -7.5t24.5 57.5v768q0 43 -24.5 57.5t-58.5 -7.5v0zM253 927h-80q-33 0 -56.5 -7.5t-23.5 -40.5v-862q0 -33 23.5 -40.5t56.5 -7.5h80q33 0 56.5 7.5t23.5 40.5v862q0 33 -23.5 40.5t-56.5 7.5v0z"/> + <glyph + glyph-name="uniE610" + unicode="" + horiz-adv-x="896" + d="M781 611q26 -43 40 -92.5t14 -102.5q0 -79 -30 -149t-82.5 -122t-122.5 -82.5t-149 -30.5t-149 30.5t-122 82.5t-82.5 122t-30.5 149t30.5 149t82.5 122t122 82.5t149 30.5v128l320 -173l-320 -179v128q-60 0 -112.5 -22.5t-91.5 -61.5t-61.5 -91.5t-22.5 -112.5t22.5 -112.5t61.5 -91.5t91.5 -61.5t112.5 -22.5t112.5 22.5t91.5 61.5t61.5 91.5t22.5 112.5q0 41 -11 78.5t-30 68.5l83 48v0z"/> + <glyph + glyph-name="uniE615" + unicode="" + d="M675 448l247 -246q36 -36 36 -85.5t-36 -78.5q-36 -36 -85.5 -36t-78.5 36l-246 247l-246 -247q-36 -36 -85.5 -36t-78.5 36q-36 36 -36 85.5t36 78.5l247 246l-247 246q-36 36 -36 85.5t36 78.5q36 36 85.5 36t78.5 -36l246 -247l246 247q36 36 85.5 36t78.5 -36q36 -36 36 -85.5t-36 -78.5l-247 -246v0z"/> + </font> + </defs> +</svg> diff --git a/fonts/libre-material/libre-icons.ttf b/fonts/libre-material/libre-icons.ttf Binary files differnew file mode 100644 index 0000000..efa2437 --- /dev/null +++ b/fonts/libre-material/libre-icons.ttf diff --git a/fonts/libre-material/libre-icons.woff b/fonts/libre-material/libre-icons.woff Binary files differnew file mode 100644 index 0000000..010e03f --- /dev/null +++ b/fonts/libre-material/libre-icons.woff diff --git a/humans.txt b/humans.txt new file mode 100644 index 0000000..4750dd9 --- /dev/null +++ b/humans.txt @@ -0,0 +1,21 @@ +/* demo.html, demo-custom-skin-material.html, demo.playList.html | Visita el sitio de software libre. - https://www.conocimientoslibres.tuxfamily.org */ + +/* TEAM */ + Author: Jesús Eduardo + Contact: heckyel [at] riseup [dot] net + From: Tumbes city, Perú + +/* IN MEMORIAL */ + Rusian + +/* THANKS */ + Yui, Betty, Leon, + Camila, Clarem, Mojo, Jorge Maldonado + +/* SITE */ + Last update: 2017/07/14 + Language: Castellano + Standars: HTML5, CSS3, JavaScript + Framework: LibreVideoJS + Software: Emacs, MAT + Sistema Operativo usado: Hyperbola GNU/Linux-Libre diff --git a/images/ProgreesTips.png b/images/ProgreesTips.png Binary files differnew file mode 100644 index 0000000..738d8fa --- /dev/null +++ b/images/ProgreesTips.png diff --git a/images/gnu-linux_libre.png b/images/gnu-linux_libre.png Binary files differnew file mode 100644 index 0000000..547696f --- /dev/null +++ b/images/gnu-linux_libre.png diff --git a/images/poster.jpg b/images/poster.jpg Binary files differnew file mode 100644 index 0000000..fba2c05 --- /dev/null +++ b/images/poster.jpg diff --git a/js/cliplibrejs.dev.js b/js/cliplibrejs.dev.js new file mode 100644 index 0000000..8783131 --- /dev/null +++ b/js/cliplibrejs.dev.js @@ -0,0 +1,6940 @@ +/*! + * @base: https://github.com/videojs/video.js + * + * @Source: cliplibrejs.dev.js + * + * @licstart The following is the entire license notice for the + * JavaScript code in this page. + * + * Copyleft 2017 Jesus Eduardo + * + * The JavaScript code in this page is free software: you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License (GNU GPL) as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) + * any later version. The code is distributed WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + * + * As additional permission under GNU GPL version 3 section 7, you + * may distribute non-source (e.g., minimized or compacted) forms of + * that code without the copy of the GNU GPL normally required by + * section 4, provided you include this license notice and a URL + * through which recipients can access the Corresponding Source. + * + * @licend The above is the entire license notice + * for the JavaScript code in this page. + * + */ +/** + * @fileoverview Main function src. + */ +// HTML5 Shiv. Must be in <head> to support older browsers. +document.createElement('video'); +document.createElement('audio'); +document.createElement('track'); + +/** + * Doubles as the main function for users to create a player instance and also + * the main library object. + * + * @param {String|Element} id Video element or video element ID + * @param {Object=} options Optional options object for config/settings + * @param {Function=} ready Optional ready callback + * @return {librevjs.Player} A player instance + * @namespace + */ +var librevjs = function (id, options, ready) { + var tag; // Element of ID + + // Allow for element or ID to be passed in + // String ID + if (typeof id === 'string') { + + // Adjust for jQuery ID syntax + if (id.indexOf('#') === 0) { + id = id.slice(1); + } + + // If a player instance has already been created for this ID return it. + if (librevjs.players[id]) { + // If options or ready funtion are passed, warn + if (options) { + librevjs.log.warn('Player "' + id + '" is already initialised. Options will not be applied.'); + } + if (ready) { + librevjs.players[id].ready(ready); + } + return librevjs.players[id]; + + // Otherwise get element for ID + } else { + tag = librevjs.el(id); + } + + // ID is a media element + } else { + tag = id; + } + + // Check for a useable element + if (!tag || !tag.nodeName) { // re: nodeName, could be a box div also + throw new TypeError('The element or ID supplied is not valid. (cliplibrejs)'); // Returns + } + + // Element may have a player attr referring to an already created player instance. + // If not, set up a new player and return the instance. + return tag['player'] || new librevjs.Player(tag, options, ready); +}; + +// Extended name, also available externally, window.cliplibrejs +var cliplibrejs = window['cliplibrejs'] = librevjs; + +// CDN Version. Used to target right flash swf. +librevjs.CDN_VERSION = '1.2.1'; +librevjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://'); + +/** + * Global Player instance options, surfaced from librevjs.Player.prototype.options_ + * librevjs.options = librevjs.Player.prototype.options_ + * All options should use string keys so they avoid + * renaming by closure compiler + * @type {Object} + */ +librevjs.options = { + // Default order of fallback technology + 'techOrder': ['html5', 'flash'], + // techOrder: ['flash','html5'], + + 'html5': {}, + 'flash': {}, + + // Default of web browser is 300x150. Should rely on source width/height. + 'width': 300, + 'height': 150, + // defaultVolume: 0.85, + 'defaultVolume': 0.00, // The freakin seaguls are driving me crazy! + + // Included control sets + 'children': { + 'mediaLoader': {}, + 'posterImage': {}, + 'textTrackDisplay': {}, + 'loadingSpinner': {}, + 'bigPlayButton': {}, + 'controlBar': {} + }, + + // Default message to show when a video cannot be played. + 'notSupportedMessage': 'No compatible source was found for this video.' +}; + +/** + * Global player list + * @type {Object} + */ +librevjs.players = {}; +/** + * Core Object/Class for objects that use inheritance + constructors + * @constructor + */ +librevjs.CoreObject = librevjs['CoreObject'] = function () {}; +// Manually exporting librevjs['CoreObject'] here for Closure Compiler +// because of the use of the extend/create class methods +// If we didn't do this, those functions would get flattend to something like +// `a = ...` and `this.prototype` would refer to the global object instead of +// CoreObject + +/** + * Create a new object that inherits from this Object + * @param {Object} props Functions and properties to be applied to the + * new object's prototype + * @return {librevjs.CoreObject} Returns an object that inherits from CoreObject + * @this {*} + */ +librevjs.CoreObject.extend = function (props) { + var init, subObj; + + props = props || {}; + // Set up the constructor using the supplied init method + // or using the init of the parent object + // Make sure to check the unobfuscated version for external libs + init = props['init'] || props.init || this.prototype['init'] || this.prototype.init || function () {}; + // In Resig's simple class inheritance (previously used) the constructor + // is a function that calls `this.init.apply(arguments)` + // However that would prevent us from using `ParentObject.call(this);` + // in a Child constuctor because the `this` in `this.init` + // would still refer to the Child and cause an inifinite loop. + // We would instead have to do + // `ParentObject.prototype.init.apply(this, argumnents);` + // Bleh. We're not creating a _super() function, so it's good to keep + // the parent constructor reference simple. + subObj = function () { + init.apply(this, arguments); + }; + + // Inherit from this object's prototype + subObj.prototype = librevjs.obj.create(this.prototype); + // Reset the constructor property for subObj otherwise + // instances of subObj would have the constructor of the parent Object + subObj.prototype.constructor = subObj; + + // Make the class extendable + subObj.extend = librevjs.CoreObject.extend; + // Make a function for creating instances + subObj.create = librevjs.CoreObject.create; + + // Extend subObj's prototype with functions and other properties from props + for (var name in props) { + if (props.hasOwnProperty(name)) { + subObj.prototype[name] = props[name]; + } + } + + return subObj; +}; + +/** + * Create a new instace of this Object class + * @return {librevjs.CoreObject} Returns an instance of a CoreObject subclass + * @this {*} + */ +librevjs.CoreObject.create = function () { + // Create a new object that inherits from this object's prototype + var inst = librevjs.obj.create(this.prototype); + + // Apply this constructor function to the new object + this.apply(inst, arguments); + + // Return the new object + return inst; +}; +/** + * @fileoverview Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/) + * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible) + * This should work very similarly to jQuery's events, however it's based off the book version which isn't as + * robust as jquery's, so there's probably some differences. + */ + +/** + * Add an event listener to element + * It stores the handler function in a separate cache object + * and adds a generic handler to the element's event, + * along with a unique id (guid) to the element. + * @param {Element|Object} elem Element or object to bind listeners to + * @param {String} type Type of event to bind to. + * @param {Function} fn Event listener. + */ +librevjs.on = function (elem, type, fn) { + var data = librevjs.getData(elem); + + // We need a place to store all our handler data + if (!data.handlers) data.handlers = {}; + + if (!data.handlers[type]) data.handlers[type] = []; + + if (!fn.guid) fn.guid = librevjs.guid++; + + data.handlers[type].push(fn); + + if (!data.dispatcher) { + data.disabled = false; + + data.dispatcher = function (event) { + + if (data.disabled) return; + event = librevjs.fixEvent(event); + + var handlers = data.handlers[event.type]; + + if (handlers) { + // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off. + var handlersCopy = handlers.slice(0); + + for (var m = 0, n = handlersCopy.length; m < n; m++) { + if (event.isImmediatePropagationStopped()) { + break; + } else { + handlersCopy[m].call(elem, event); + } + } + } + }; + } + + if (data.handlers[type].length == 1) { + if (document.addEventListener) { + elem.addEventListener(type, data.dispatcher, false); + } else if (document.attachEvent) { + elem.attachEvent('on' + type, data.dispatcher); + } + } +}; + +/** + * Removes event listeners from an element + * @param {Element|Object} elem Object to remove listeners from + * @param {String=} type Type of listener to remove. Don't include to remove all events from element. + * @param {Function} fn Specific listener to remove. Don't incldue to remove listeners for an event type. + */ +librevjs.off = function (elem, type, fn) { + // Don't want to add a cache object through getData if not needed + if (!librevjs.hasData(elem)) return; + + var data = librevjs.getData(elem); + + // If no events exist, nothing to unbind + if (!data.handlers) { + return; + } + + // Utility function + var removeType = function (t) { + data.handlers[t] = []; + librevjs.cleanUpEvents(elem, t); + }; + + // Are we removing all bound events? + if (!type) { + for (var t in data.handlers) removeType(t); + return; + } + + var handlers = data.handlers[type]; + + // If no handlers exist, nothing to unbind + if (!handlers) return; + + // If no listener was provided, remove all listeners for type + if (!fn) { + removeType(type); + return; + } + + // We're only removing a single handler + if (fn.guid) { + for (var n = 0; n < handlers.length; n++) { + if (handlers[n].guid === fn.guid) { + handlers.splice(n--, 1); + } + } + } + + librevjs.cleanUpEvents(elem, type); +}; + +/** + * Clean up the listener cache and dispatchers + * @param {Element|Object} elem Element to clean up + * @param {String} type Type of event to clean up + */ +librevjs.cleanUpEvents = function (elem, type) { + var data = librevjs.getData(elem); + + // Remove the events of a particular type if there are none left + if (data.handlers[type].length === 0) { + delete data.handlers[type]; + // data.handlers[type] = null; + // Setting to null was causing an error with data.handlers + + // Remove the meta-handler from the element + if (elem.removeEventListener) { + elem.removeEventListener(type, data.dispatcher, false); + } else if (elem.detachEvent) { + elem.detachEvent('on' + type, data.dispatcher); + } + } + + // Remove the events object if there are no types left + if (librevjs.isEmpty(data.handlers)) { + delete data.handlers; + delete data.dispatcher; + delete data.disabled; + + // data.handlers = null; + // data.dispatcher = null; + // data.disabled = null; + } + + // Finally remove the expando if there is no data left + if (librevjs.isEmpty(data)) { + librevjs.removeData(elem); + } +}; + +/** + * Fix a native event to have standard property values + * @param {Object} event Event object to fix + * @return {Object} + */ +librevjs.fixEvent = function (event) { + + function returnTrue() { + return true; + } + + function returnFalse() { + return false; + } + + // Test if fixing up is needed + // Used to check if !event.stopPropagation instead of isPropagationStopped + // But native events return true for stopPropagation, but don't have + // other expected methods like isPropagationStopped. Seems to be a problem + // with the Javascript Ninja code. So we're just overriding all events now. + if (!event || !event.isPropagationStopped) { + var old = event || window.event; + + event = {}; + // Clone the old object so that we can modify the values event = {}; + // IE8 Doesn't like when you mess with native event properties + // Firefox returns false for event.hasOwnProperty('type') and other props + // which makes copying more difficult. + // TODO: Probably best to create a whitelist of event props + for (var key in old) { + // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y + if (key !== 'layerX' && key !== 'layerY') { + event[key] = old[key]; + } + } + + // The event occurred on this element + if (!event.target) { + event.target = event.srcElement || document; + } + + // Handle which other element the event is related to + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + + // Stop the default browser action + event.preventDefault = function () { + if (old.preventDefault) { + old.preventDefault(); + } + event.returnValue = false; + event.isDefaultPrevented = returnTrue; + }; + + event.isDefaultPrevented = returnFalse; + + // Stop the event from bubbling + event.stopPropagation = function () { + if (old.stopPropagation) { + old.stopPropagation(); + } + event.cancelBubble = true; + event.isPropagationStopped = returnTrue; + }; + + event.isPropagationStopped = returnFalse; + + // Stop the event from bubbling and executing other handlers + event.stopImmediatePropagation = function () { + if (old.stopImmediatePropagation) { + old.stopImmediatePropagation(); + } + event.isImmediatePropagationStopped = returnTrue; + event.stopPropagation(); + }; + + event.isImmediatePropagationStopped = returnFalse; + + // Handle mouse position + if (event.clientX != null) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Handle key presses + event.which = event.charCode || event.keyCode; + + // Fix button for mouse clicks: + // 0 == left; 1 == middle; 2 == right + if (event.button != null) { + event.button = (event.button & 1 ? 0 : (event.button & 4 ? 1 : (event.button & 2 ? 2 : 0))); + } + } + + // Returns fixed-up instance + return event; +}; + +/** + * Trigger an event for an element + * @param {Element|Object} elem Element to trigger an event on + * @param {String} event Type of event to trigger + */ +librevjs.trigger = function (elem, event) { + // Fetches element data and a reference to the parent (for bubbling). + // Don't want to add a data object to cache for every parent, + // so checking hasData first. + var elemData = (librevjs.hasData(elem)) ? librevjs.getData(elem) : {}; + var parent = elem.parentNode || elem.ownerDocument; + // type = event.type || event, + // handler; + + // If an event name was passed as a string, creates an event out of it + if (typeof event === 'string') { + event = { + type: event, + target: elem + }; + } + // Normalizes the event properties. + event = librevjs.fixEvent(event); + + // If the passed element has a dispatcher, executes the established handlers. + if (elemData.dispatcher) { + elemData.dispatcher.call(elem, event); + } + + // Unless explicitly stopped or the event does not bubble (e.g. media events) + // recursively calls this function to bubble the event up the DOM. + if (parent && !event.isPropagationStopped() && event.bubbles !== false) { + librevjs.trigger(parent, event); + + // If at the top of the DOM, triggers the default action unless disabled. + } else if (!parent && !event.isDefaultPrevented()) { + var targetData = librevjs.getData(event.target); + + // Checks if the target has a default action for this event. + if (event.target[event.type]) { + // Temporarily disables event dispatching on the target as we have already executed the handler. + targetData.disabled = true; + // Executes the default action. + if (typeof event.target[event.type] === 'function') { + event.target[event.type](); + } + // Re-enables event dispatching. + targetData.disabled = false; + } + } + + // Inform the triggerer if the default was prevented by returning false + return !event.isDefaultPrevented(); + /* Original version of js ninja events wasn't complete. + * We've since updated to the latest version, but keeping this around + * for now just in case. + */ + // // Added in attion to book. Book code was broke. + // event = typeof event === 'object' ? + // event[librevjs.expando] ? + // event : + // new librevjs.Event(type, event) : + // new librevjs.Event(type); + + // event.type = type; + // if (handler) { + // handler.call(elem, event); + // } + + // // Clean up the event in case it is being reused + // event.result = undefined; + // event.target = elem; +}; + +/** + * Trigger a listener only once for an event + * @param {Element|Object} elem Element or object to + * @param {[type]} type [description] + * @param {Function} fn [description] + * @return {[type]} + */ +librevjs.one = function (elem, type, fn) { + var func = function () { + librevjs.off(elem, type, func); + fn.apply(this, arguments); + }; + func.guid = fn.guid = fn.guid || librevjs.guid++; + librevjs.on(elem, type, func); +}; +var hasOwnProp = Object.prototype.hasOwnProperty; + +/** + * Creates an element and applies properties. + * @param {String=} tagName Name of tag to be created. + * @param {Object=} properties Element properties to be applied. + * @return {Element} + */ +librevjs.createEl = function (tagName, properties) { + var el, propName; + + el = document.createElement(tagName || 'div'); + + for (propName in properties) { + if (hasOwnProp.call(properties, propName)) { + //el[propName] = properties[propName]; + // Not remembering why we were checking for dash + // but using setAttribute means you have to use getAttribute + + // The check for dash checks for the aria-* attributes, like aria-label, aria-valuemin. + // The additional check for "role" is because the default method for adding attributes does not + // add the attribute "role". My guess is because it's not a valid attribute in some namespaces, although + // browsers handle the attribute just fine. The W3C allows for aria-* attributes to be used in pre-HTML5 docs. + // http://www.w3.org/TR/wai-aria-primer/#ariahtml. Using setAttribute gets around this problem. + + if (propName.indexOf('aria-') !== -1 || propName == 'role') { + el.setAttribute(propName, properties[propName]); + } else { + el[propName] = properties[propName]; + } + } + } + return el; +}; + +/** + * Uppercase the first letter of a string + * @param {String} string String to be uppercased + * @return {String} + */ +librevjs.capitalize = function (string) { + return string.charAt(0).toUpperCase() + string.slice(1); +}; + +/** + * Object functions container + * @type {Object} + */ +librevjs.obj = {}; + +/** + * Object.create shim for prototypal inheritance. + * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create + * @param {Object} obj Object to use as prototype + */ +librevjs.obj.create = Object.create || function (obj) { + //Create a new function called 'F' which is just an empty object. + function F() {} + + //the prototype of the 'F' function should point to the + //parameter of the anonymous function. + F.prototype = obj; + + //create a new constructor function based off of the 'F' function. + return new F(); +}; + +/** + * Loop through each property in an object and call a function + * whose arguments are (key,value) + * @param {Object} obj Object of properties + * @param {Function} fn Function to be called on each property. + * @this {*} + */ +librevjs.obj.each = function (obj, fn, context) { + for (var key in obj) { + if (hasOwnProp.call(obj, key)) { + fn.call(context || this, key, obj[key]); + } + } +}; + +/** + * Merge two objects together and return the original. + * @param {Object} obj1 + * @param {Object} obj2 + * @return {Object} + */ +librevjs.obj.merge = function (obj1, obj2) { + if (!obj2) { + return obj1; + } + for (var key in obj2) { + if (hasOwnProp.call(obj2, key)) { + obj1[key] = obj2[key]; + } + } + return obj1; +}; + +/** + * Merge two objects, and merge any properties that are objects + * instead of just overwriting one. Uses to merge options hashes + * where deeper default settings are important. + * @param {Object} obj1 Object to override + * @param {Object} obj2 Overriding object + * @return {Object} New object. Obj1 and Obj2 will be untouched. + */ +librevjs.obj.deepMerge = function (obj1, obj2) { + var key, val1, val2; + + // make a copy of obj1 so we're not ovewriting original values. + // like prototype.options_ and all sub options objects + obj1 = librevjs.obj.copy(obj1); + + for (key in obj2) { + if (hasOwnProp.call(obj2, key)) { + val1 = obj1[key]; + val2 = obj2[key]; + + // Check if both properties are pure objects and do a deep merge if so + if (librevjs.obj.isPlain(val1) && librevjs.obj.isPlain(val2)) { + obj1[key] = librevjs.obj.deepMerge(val1, val2); + } else { + obj1[key] = obj2[key]; + } + } + } + return obj1; +}; + +/** + * Make a copy of the supplied object + * @param {Object} obj Object to copy + * @return {Object} Copy of object + */ +librevjs.obj.copy = function (obj) { + return librevjs.obj.merge({}, obj); +}; + +/** + * Check if an object is plain, and not a dom node or any object sub-instance + * @param {Object} obj Object to check + * @return {Boolean} True if plain, false otherwise + */ +librevjs.obj.isPlain = function (obj) { + return !!obj && typeof obj === 'object' && obj.toString() === '[object Object]' && obj.constructor === Object; +}; + +/** +* Bind (a.k.a proxy or Context). A simple method for changing the context of a function + It also stores a unique id on the function so it can be easily removed from events +* @param {*} context The object to bind as scope +* @param {Function} fn The function to be bound to a scope +* @param {Number=} uid An optional unique ID for the function to be set +* @return {Function} +*/ +librevjs.bind = function (context, fn, uid) { + // Make sure the function has a unique ID + if (!fn.guid) { + fn.guid = librevjs.guid++; + } + + // Create the new function that changes the context + var ret = function () { + return fn.apply(context, arguments); + }; + + // Allow for the ability to individualize this function + // Needed in the case where multiple objects might share the same prototype + // IF both items add an event listener with the same function, then you try to remove just one + // it will remove both because they both have the same guid. + // when using this, you need to use the bind method when you remove the listener as well. + // currently used in text tracks + ret.guid = (uid) ? uid + '_' + fn.guid : fn.guid; + + return ret; +}; + +/** + * Element Data Store. Allows for binding data to an element without putting it directly on the element. + * Ex. Event listneres are stored here. + * (also from jsninja.com, slightly modified and updated for closure compiler) + * @type {Object} + */ +librevjs.cache = {}; + +/** + * Unique ID for an element or function + * @type {Number} + */ +librevjs.guid = 1; + +/** + * Unique attribute name to store an element's guid in + * @type {String} + * @constant + */ +librevjs.expando = 'vdata' + (new Date()).getTime(); + +/** + * Returns the cache object where data for an element is stored + * @param {Element} el Element to store data for. + * @return {Object} + */ +librevjs.getData = function (el) { + var id = el[librevjs.expando]; + if (!id) { + id = el[librevjs.expando] = librevjs.guid++; + librevjs.cache[id] = {}; + } + return librevjs.cache[id]; +}; + +/** + * Returns the cache object where data for an element is stored + * @param {Element} el Element to store data for. + * @return {Object} + */ +librevjs.hasData = function (el) { + var id = el[librevjs.expando]; + return !(!id || librevjs.isEmpty(librevjs.cache[id])); +}; + +/** + * Delete data for the element from the cache and the guid attr from getElementById + * @param {Element} el Remove data for an element + */ +librevjs.removeData = function (el) { + var id = el[librevjs.expando]; + if (!id) { + return; + } + // Remove all stored data + // Changed to = null + // http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-javascript/ + // librevjs.cache[id] = null; + delete librevjs.cache[id]; + + // Remove the expando property from the DOM node + try { + delete el[librevjs.expando]; + } catch (e) { + if (el.removeAttribute) { + el.removeAttribute(librevjs.expando); + } else { + // IE doesn't appear to support removeAttribute on the document element + el[librevjs.expando] = null; + } + } +}; + +librevjs.isEmpty = function (obj) { + for (var prop in obj) { + // Inlude null properties as empty. + if (obj[prop] !== null) { + return false; + } + } + return true; +}; + +/** + * Add a CSS class name to an element + * @param {Element} element Element to add class name to + * @param {String} classToAdd Classname to add + */ +librevjs.addClass = function (element, classToAdd) { + if ((' ' + element.className + ' ').indexOf(' ' + classToAdd + ' ') == -1) { + element.className = element.className === '' ? classToAdd : element.className + ' ' + classToAdd; + } +}; + +/** + * Remove a CSS class name from an element + * @param {Element} element Element to remove from class name + * @param {String} classToAdd Classname to remove + */ +librevjs.removeClass = function (element, classToRemove) { + var classNames, i; + + if (element.className.indexOf(classToRemove) == -1) { + return; + } + + classNames = element.className.split(' '); + + // no arr.indexOf in ie8, and we don't want to add a big shim + for (i = classNames.length - 1; i >= 0; i--) { + if (classNames[i] === classToRemove) { + classNames.splice(i, 1); + } + } + + element.className = classNames.join(' '); +}; + +/** + * Element for testing browser HTML5 video capabilities + * @type {Element} + * @constant + */ +librevjs.TEST_VID = librevjs.createEl('video'); + +/** + * Useragent for browser testing. + * @type {String} + * @constant + */ +librevjs.USER_AGENT = navigator.userAgent; + +/** + * Device is an iPhone + * @type {Boolean} + * @constant + */ +librevjs.IS_IPHONE = (/iPhone/i).test(librevjs.USER_AGENT); +librevjs.IS_IPAD = (/iPad/i).test(librevjs.USER_AGENT); +librevjs.IS_IPOD = (/iPod/i).test(librevjs.USER_AGENT); +librevjs.IS_IOS = librevjs.IS_IPHONE || librevjs.IS_IPAD || librevjs.IS_IPOD; + +librevjs.IOS_VERSION = (function () { + var match = librevjs.USER_AGENT.match(/OS (\d+)_/i); + if (match && match[1]) { + return match[1]; + } +})(); + +librevjs.IS_ANDROID = (/Android/i).test(librevjs.USER_AGENT); +librevjs.ANDROID_VERSION = (function () { + // This matches Android Major.Minor.Patch versions + // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned + var match = librevjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i), + major, + minor; + + if (!match) { + return null; + } + + major = match[1] && parseFloat(match[1]); + minor = match[2] && parseFloat(match[2]); + + if (major && minor) { + return parseFloat(match[1] + '.' + match[2]); + } else if (major) { + return major; + } else { + return null; + } +})(); +// Old Android is defined as Version older than 2.3, and requiring a webkit version of the android browser +librevjs.IS_OLD_ANDROID = librevjs.IS_ANDROID && (/webkit/i).test(librevjs.USER_AGENT) && librevjs.ANDROID_VERSION < 2.3; + +librevjs.IS_FIREFOX = (/Firefox/i).test(librevjs.USER_AGENT); +librevjs.IS_CHROME = (/Chrome/i).test(librevjs.USER_AGENT); + +librevjs.TOUCH_ENABLED = ('ontouchstart' in window); + +/** + * Get an element's attribute values, as defined on the HTML tag + * Attributs are not the same as properties. They're defined on the tag + * or with setAttribute (which shouldn't be used with HTML) + * This will return true or false for boolean attributes. + * @param {Element} tag Element from which to get tag attributes + * @return {Object} + */ +librevjs.getAttributeValues = function (tag) { + var obj, knownBooleans, attrs, attrName, attrVal; + + obj = {}; + + // known boolean attributes + // we can check for matching boolean properties, but older browsers + // won't know about HTML5 boolean attributes that we still read from + knownBooleans = ',' + 'autoplay,controls,loop,muted,default' + ','; + + if (tag && tag.attributes && tag.attributes.length > 0) { + attrs = tag.attributes; + + for (var i = attrs.length - 1; i >= 0; i--) { + attrName = attrs[i].name; + attrVal = attrs[i].value; + + // check for known booleans + // the matching element property will return a value for typeof + if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) { + // the value of an included boolean attribute is typically an empty + // string ('') which would equal false if we just check for a false value. + // we also don't want support bad code like autoplay='false' + attrVal = (attrVal !== null) ? true : false; + } + + obj[attrName] = attrVal; + } + } + + return obj; +}; + +/** + * Get the computed style value for an element + * From http://robertnyman.com/2006/04/24/get-the-rendered-style-of-an-element/ + * @param {Element} el Element to get style value for + * @param {String} strCssRule Style name + * @return {String} Style value + */ +librevjs.getComputedDimension = function (el, strCssRule) { + var strValue = ''; + if (document.defaultView && document.defaultView.getComputedStyle) { + strValue = document.defaultView.getComputedStyle(el, '').getPropertyValue(strCssRule); + + } else if (el.currentStyle) { + // IE8 Width/Height support + strValue = el['client' + strCssRule.substr(0, 1).toUpperCase() + strCssRule.substr(1)] + 'px'; + } + return strValue; +}; + +/** + * Insert an element as the first child node of another + * @param {Element} child Element to insert + * @param {[type]} parent Element to insert child into + */ +librevjs.insertFirst = function (child, parent) { + if (parent.firstChild) { + parent.insertBefore(child, parent.firstChild); + } else { + parent.appendChild(child); + } +}; + +/** + * Object to hold browser support information + * @type {Object} + */ +librevjs.support = {}; + +/** + * Shorthand for document.getElementById() + * Also allows for CSS (jQuery) ID syntax. But nothing other than IDs. + * @param {String} id Element ID + * @return {Element} Element with supplied ID + */ +librevjs.el = function (id) { + if (id.indexOf('#') === 0) { + id = id.slice(1); + } + + return document.getElementById(id); +}; + +/** + * Format seconds as a time string, H:MM:SS or M:SS + * Supplying a guide (in seconds) will force a number of leading zeros + * to cover the length of the guide + * @param {Number} seconds Number of seconds to be turned into a string + * @param {Number} guide Number (in seconds) to model the string after + * @return {String} Time formatted as H:MM:SS or M:SS + */ +librevjs.formatTime = function (seconds, guide) { + // Default to using seconds as guide + guide = guide || seconds; + var s = Math.floor(seconds % 60), + m = Math.floor(seconds / 60 % 60), + h = Math.floor(seconds / 3600), + gm = Math.floor(guide / 60 % 60), + gh = Math.floor(guide / 3600); + + // handle invalid times + if (isNaN(seconds) || seconds === Infinity) { + // '-' is false for all relational operators (e.g. <, >=) so this setting + // will add the minimum number of fields specified by the guide + h = m = s = '-'; + } + + // Check if we need to show hours + h = (h > 0 || gh > 0) ? h + ':' : ''; + + // If hours are showing, we may need to add a leading zero. + // Always show at least one digit of minutes. + m = (((h || gm >= 10) && m < 10) ? '0' + m : m) + ':'; + + // Check if leading zero is need for seconds + s = (s < 10) ? '0' + s : s; + + return h + m + s; +}; + +// Attempt to block the ability to select text while dragging controls +librevjs.blockTextSelection = function () { + document.body.focus(); + document.onselectstart = function () { + return false; + }; +}; +// Turn off text selection blocking +librevjs.unblockTextSelection = function () { + document.onselectstart = function () { + return true; + }; +}; + +/** + * Trim whitespace from the ends of a string. + * @param {String} string String to trim + * @return {String} Trimmed string + */ +librevjs.trim = function (str) { + return (str + '').replace(/^\s+|\s+$/g, ''); +}; + +/** + * Should round off a number to a decimal place + * @param {Number} num Number to round + * @param {Number} dec Number of decimal places to round to + * @return {Number} Rounded number + */ +librevjs.round = function (num, dec) { + if (!dec) { + dec = 0; + } + return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); +}; + +/** + * Should create a fake TimeRange object + * Mimics an HTML5 time range instance, which has functions that + * return the start and end times for a range + * TimeRanges are returned by the buffered() method + * @param {Number} start Start time in seconds + * @param {Number} end End time in seconds + * @return {Object} Fake TimeRange object + */ +librevjs.createTimeRange = function (start, end) { + return { + length: 1, + start: function () { + return start; + }, + end: function () { + return end; + } + }; +}; + +/** + * Simple http request for retrieving external files (e.g. text tracks) + * @param {String} url URL of resource + * @param {Function=} onSuccess Success callback + * @param {Function=} onError Error callback + */ +librevjs.get = function (url, onSuccess, onError) { + var local, request; + + if (typeof XMLHttpRequest === 'undefined') { + window.XMLHttpRequest = function () { + try { + return new window.ActiveXObject('Msxml2.XMLHTTP.6.0'); + } catch (e) {} + try { + return new window.ActiveXObject('Msxml2.XMLHTTP.3.0'); + } catch (f) {} + try { + return new window.ActiveXObject('Msxml2.XMLHTTP'); + } catch (g) {} + throw new Error('This browser does not support XMLHttpRequest.'); + }; + } + + request = new XMLHttpRequest(); + try { + request.open('GET', url); + } catch (e) { + onError(e); + } + + local = (url.indexOf('file:') === 0 || (window.location.href.indexOf('file:') === 0 && url.indexOf('http') === -1)); + + request.onreadystatechange = function () { + if (request.readyState === 4) { + if (request.status === 200 || local && request.status === 0) { + onSuccess(request.responseText); + } else { + if (onError) { + onError(); + } + } + } + }; + + try { + request.send(); + } catch (e) { + if (onError) { + onError(e); + } + } +}; + +/* Local Storage +================================================================================ */ +librevjs.setLocalStorage = function (key, value) { + try { + // IE was throwing errors referencing the var anywhere without this + var localStorage = window.localStorage || false; + if (!localStorage) { + return; + } + localStorage[key] = value; + } catch (e) { + if (e.code == 22 || e.code == 1014) { // Webkit == 22 / Firefox == 1014 + librevjs.log('LocalStorage Full (LibreVideoJS)', e); + } else { + if (e.code == 18) { + librevjs.log('LocalStorage not allowed (LibreVideoJS)', e); + } else { + librevjs.log('LocalStorage Error (LibreVideoJS)', e); + } + } + } +}; + +/** + * Get abosolute version of relative URL. Used to tell flash correct URL. + * http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue + * @param {String} url URL to make absolute + * @return {String} Absolute URL + */ +librevjs.getAbsoluteURL = function (url) { + + // Check if absolute URL + if (!url.match(/^https?:\/\//)) { + // Convert to absolute URL. Flash hosted off-site needs an absolute URL. + url = librevjs.createEl('div', { + innerHTML: '<a href="' + url + '">x</a>' + }).firstChild.href; + } + + return url; +}; + +// usage: log('inside coolFunc',this,arguments); +// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ +librevjs.log = function () { + librevjs.log.history = librevjs.log.history || []; // store logs to an array for reference + librevjs.log.history.push(arguments); + if (window.console) { + window.console.log(Array.prototype.slice.call(arguments)); + } +}; + +// Offset Left +// getBoundingClientRect technique from John Resig http://ejohn.org/blog/getboundingclientrect-is-awesome/ +librevjs.findPosition = function (el) { + var box, docEl, body, clientLeft, scrollLeft, left, clientTop, scrollTop, top; + + if (el.getBoundingClientRect && el.parentNode) { + box = el.getBoundingClientRect(); + } + + if (!box) { + return { + left: 0, + top: 0 + }; + } + + docEl = document.documentElement; + body = document.body; + + clientLeft = docEl.clientLeft || body.clientLeft || 0; + scrollLeft = window.pageXOffset || body.scrollLeft; + left = box.left + scrollLeft - clientLeft; + + clientTop = docEl.clientTop || body.clientTop || 0; + scrollTop = window.pageYOffset || body.scrollTop; + top = box.top + scrollTop - clientTop; + + return { + left: left, + top: top + }; +}; +/** + * @fileoverview Player Component - Base class for all UI objects + * + */ + +/** + * Base UI Component class + * @param {Object} player Main Player + * @param {Object=} options + * @constructor + */ +librevjs.Component = librevjs.CoreObject.extend({ + /** @constructor */ + init: function (player, options, ready) { + this.player_ = player; + + // Make a copy of prototype.options_ to protect against overriding global defaults + this.options_ = librevjs.obj.copy(this.options_); + + // Updated options with supplied options + options = this.options(options); + + // Get ID from options, element, or create using player ID and unique ID + this.id_ = options['id'] || ((options['el'] && options['el']['id']) ? options['el']['id'] : player.id() + '_component_' + librevjs.guid++); + + this.name_ = options['name'] || null; + + // Create element if one wasn't provided in options + this.el_ = options['el'] || this.createEl(); + + this.children_ = []; + this.childIndex_ = {}; + this.childNameIndex_ = {}; + + // Add any child components in options + this.initChildren(); + + this.ready(ready); + // Don't want to trigger ready here or it will before init is actually + // finished for all children that run this constructor + } +}); + +/** + * Dispose of the component and all child components. + */ +librevjs.Component.prototype.dispose = function () { + this.trigger('dispose'); + + // Dispose all children. + if (this.children_) { + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i].dispose) { + this.children_[i].dispose(); + } + } + } + + // Delete child references + this.children_ = null; + this.childIndex_ = null; + this.childNameIndex_ = null; + + // Remove all event listeners. + this.off(); + + // Remove element from DOM + if (this.el_.parentNode) { + this.el_.parentNode.removeChild(this.el_); + } + + librevjs.removeData(this.el_); + this.el_ = null; +}; + +/** + * Reference to main player instance. + * @type {librevjs.Player} + * @private + */ +librevjs.Component.prototype.player_; + +/** + * Return the component's player. + * @return {librevjs.Player} + */ +librevjs.Component.prototype.player = function () { + return this.player_; +}; + +/** + * Component options object. + * @type {Object} + * @private + */ +librevjs.Component.prototype.options_; + +/** + * Deep merge of options objects + * Whenever a property is an object on both options objects + * the two properties will be merged using librevjs.obj.deepMerge. + * + * This is used for merging options for child components. We + * want it to be easy to override individual options on a child + * component without having to rewrite all the other default options. + * + * Parent.prototype.options_ = { + * children: { + * 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, + * 'childTwo': {}, + * 'childThree': {} + * } + * } + * newOptions = { + * children: { + * 'childOne': { 'foo': 'baz', 'abc': '123' } + * 'childTwo': null, + * 'childFour': {} + * } + * } + * + * this.options(newOptions); + * + * RESULT + * + * { + * children: { + * 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, + * 'childTwo': null, // Disabled. Won't be initialized. + * 'childThree': {}, + * 'childFour': {} + * } + * } + * + * @param {Object} obj Object whose values will be overwritten + * @return {Object} NEW merged object. Does not return obj1. + */ +librevjs.Component.prototype.options = function (obj) { + if (obj === undefined) return this.options_; + + return this.options_ = librevjs.obj.deepMerge(this.options_, obj); +}; + +/** + * The DOM element for the component. + * @type {Element} + * @private + */ +librevjs.Component.prototype.el_; + +/** + * Create the component's DOM element. + * @param {String=} tagName Element's node type. e.g. 'div' + * @param {Object=} attributes An object of element attributes that should be set on the element. + * @return {Element} + */ +librevjs.Component.prototype.createEl = function (tagName, attributes) { + return librevjs.createEl(tagName, attributes); +}; + +/** + * Return the component's DOM element. + * @return {Element} + */ +librevjs.Component.prototype.el = function () { + return this.el_; +}; + +/** + * An optional element where, if defined, children will be inserted + * instead of directly in el_ + * @type {Element} + * @private + */ +librevjs.Component.prototype.contentEl_; + +/** + * Return the component's DOM element for embedding content. + * will either be el_ or a new element defined in createEl + * @return {Element} + */ +librevjs.Component.prototype.contentEl = function () { + return this.contentEl_ || this.el_; +}; + +/** + * The ID for the component. + * @type {String} + * @private + */ +librevjs.Component.prototype.id_; + +/** + * Return the component's ID. + * @return {String} + */ +librevjs.Component.prototype.id = function () { + return this.id_; +}; + +/** + * The name for the component. Often used to reference the component. + * @type {String} + * @private + */ +librevjs.Component.prototype.name_; + +/** + * Return the component's ID. + * @return {String} + */ +librevjs.Component.prototype.name = function () { + return this.name_; +}; + +/** + * Array of child components + * @type {Array} + * @private + */ +librevjs.Component.prototype.children_; + +/** + * Returns array of all child components. + * @return {Array} + */ +librevjs.Component.prototype.children = function () { + return this.children_; +}; + +/** + * Object of child components by ID + * @type {Object} + * @private + */ +librevjs.Component.prototype.childIndex_; + +/** + * Returns a child component with the provided ID. + * @return {Array} + */ +librevjs.Component.prototype.getChildById = function (id) { + return this.childIndex_[id]; +}; + +/** + * Object of child components by Name + * @type {Object} + * @private + */ +librevjs.Component.prototype.childNameIndex_; + +/** + * Returns a child component with the provided ID. + * @return {Array} + */ +librevjs.Component.prototype.getChild = function (name) { + return this.childNameIndex_[name]; +}; + +/** + * Adds a child component inside this component. + * @param {String|librevjs.Component} child The class name or instance of a child to add. + * @param {Object=} options Optional options, including options to be passed to + * children of the child. + * @return {librevjs.Component} The child component, because it might be created in this process. + * @suppress {accessControls|checkRegExp|checkTypes|checkVars|const|constantProperty|deprecated|duplicate|es5Strict|fileoverviewTags|globalThis|invalidCasts|missingProperties|nonStandardJsDocs|strictModuleDepCheck|undefinedNames|undefinedVars|unknownDefines|uselessCode|visibility} + */ +librevjs.Component.prototype.addChild = function (child, options) { + var component, componentClass, componentName, componentId; + + // If string, create new component with options + if (typeof child === 'string') { + + componentName = child; + + // Make sure options is at least an empty object to protect against errors + options = options || {}; + + // Assume name of set is a lowercased name of the UI Class (PlayButton, etc.) + componentClass = options['componentClass'] || librevjs.capitalize(componentName); + + // Set name through options + options['name'] = componentName; + + // Create a new object & element for this controls set + // If there's no .player_, this is a player + // Closure Compiler throws an 'incomplete alias' warning if we use the librevjs variable directly. + // Every class should be exported, so this should never be a problem here. + component = new window['cliplibrejs'][componentClass](this.player_ || this, options); + + // child is a component instance + } else { + component = child; + } + + this.children_.push(component); + + if (typeof component.id === 'function') { + this.childIndex_[component.id()] = component; + } + + // If a name wasn't used to create the component, check if we can use the + // name function of the component + componentName = componentName || (component.name && component.name()); + + if (componentName) { + this.childNameIndex_[componentName] = component; + } + + // Add the UI object's element to the container div (box) + // Having an element is not required + if (typeof component['el'] === 'function' && component['el']()) { + this.contentEl().appendChild(component['el']()); + } + + // Return so it can stored on parent object if desired. + return component; +}; + +librevjs.Component.prototype.removeChild = function (component) { + if (typeof component === 'string') { + component = this.getChild(component); + } + + if (!component || !this.children_) return; + + var childFound = false; + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i] === component) { + childFound = true; + this.children_.splice(i, 1); + break; + } + } + + if (!childFound) return; + + this.childIndex_[component.id] = null; + this.childNameIndex_[component.name] = null; + + var compEl = component.el(); + if (compEl && compEl.parentNode === this.contentEl()) { + this.contentEl().removeChild(component.el()); + } +}; + +/** + * Initialize default child components from options + */ +librevjs.Component.prototype.initChildren = function () { + var options = this.options_; + + if (options && options['children']) { + var self = this; + + // Loop through components and add them to the player + librevjs.obj.each(options['children'], function (name, opts) { + // Allow for disabling default components + // e.g. librevjs.options['children']['posterImage'] = false + if (opts === false) return; + + // Allow waiting to add components until a specific event is called + var tempAdd = function () { + // Set property name on player. Could cause conflicts with other prop names, but it's worth making refs easy. + self[name] = self.addChild(name, opts); + }; + + if (opts['loadEvent']) { + // this.one(opts.loadEvent, tempAdd) + } else { + tempAdd(); + } + }); + } +}; + +librevjs.Component.prototype.buildCSSClass = function () { + // Child classes can include a function that does: + // return 'CLASS NAME' + this._super(); + return ''; +}; + +/* Events +============================================================================= */ + +/** + * Add an event listener to this component's element. Context will be the component. + * @param {String} type Event type e.g. 'click' + * @param {Function} fn Event listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.on = function (type, fn) { + librevjs.on(this.el_, type, librevjs.bind(this, fn)); + return this; +}; + +/** + * Remove an event listener from the component's element + * @param {String=} type Optional event type. Without type it will remove all listeners. + * @param {Function=} fn Optional event listener. Without fn it will remove all listeners for a type. + * @return {librevjs.Component} + */ +librevjs.Component.prototype.off = function (type, fn) { + librevjs.off(this.el_, type, fn); + return this; +}; + +/** + * Add an event listener to be triggered only once and then removed + * @param {String} type Event type + * @param {Function} fn Event listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.one = function (type, fn) { + librevjs.one(this.el_, type, librevjs.bind(this, fn)); + return this; +}; + +/** + * Trigger an event on an element + * @param {String} type Event type to trigger + * @param {Event|Object} event Event object to be passed to the listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.trigger = function (type, event) { + librevjs.trigger(this.el_, type, event); + return this; +}; + +/* Ready +================================================================================ */ +/** + * Is the component loaded. + * @type {Boolean} + * @private + */ +librevjs.Component.prototype.isReady_; + +/** + * Trigger ready as soon as initialization is finished. + * Allows for delaying ready. Override on a sub class prototype. + * If you set this.isReadyOnInitFinish_ it will affect all components. + * Specially used when waiting for the Flash player to asynchrnously load. + * @type {Boolean} + * @private + */ +librevjs.Component.prototype.isReadyOnInitFinish_ = true; + +/** + * List of ready listeners + * @type {Array} + * @private + */ +librevjs.Component.prototype.readyQueue_; + +/** + * Bind a listener to the component's ready state. + * Different from event listeners in that if the ready event has already happend + * it will trigger the function immediately. + * @param {Function} fn Ready listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.ready = function (fn) { + if (fn) { + if (this.isReady_) { + fn.call(this); + } else { + if (this.readyQueue_ === undefined) { + this.readyQueue_ = []; + } + this.readyQueue_.push(fn); + } + } + return this; +}; + +/** + * Trigger the ready listeners + * @return {librevjs.Component} + */ +librevjs.Component.prototype.triggerReady = function () { + this.isReady_ = true; + + var readyQueue = this.readyQueue_; + + if (readyQueue && readyQueue.length > 0) { + + for (var i = 0, j = readyQueue.length; i < j; i++) { + readyQueue[i].call(this); + } + + // Reset Ready Queue + this.readyQueue_ = []; + + // Allow for using event listeners also, in case you want to do something everytime a source is ready. + this.trigger('ready'); + } +}; + +/* Display +============================================================================= */ + +/** + * Add a CSS class name to the component's element + * @param {String} classToAdd Classname to add + * @return {librevjs.Component} + */ +librevjs.Component.prototype.addClass = function (classToAdd) { + librevjs.addClass(this.el_, classToAdd); + return this; +}; + +/** + * Remove a CSS class name from the component's element + * @param {String} classToRemove Classname to remove + * @return {librevjs.Component} + */ +librevjs.Component.prototype.removeClass = function (classToRemove) { + librevjs.removeClass(this.el_, classToRemove); + return this; +}; + +/** + * Show the component element if hidden + * @return {librevjs.Component} + */ +librevjs.Component.prototype.show = function () { + this.el_.style.display = 'block'; + return this; +}; + +/** + * Hide the component element if hidden + * @return {librevjs.Component} + */ +librevjs.Component.prototype.hide = function () { + this.el_.style.display = 'none'; + return this; +}; + +/** + * Lock an item in its visible state. To be used with fadeIn/fadeOut. + * @return {librevjs.Component} + */ +librevjs.Component.prototype.lockShowing = function () { + this.addClass('librevjs-lock-showing'); + return this; +}; + +/** + * Unlock an item to be hidden. To be used with fadeIn/fadeOut. + * @return {librevjs.Component} + */ +librevjs.Component.prototype.unlockShowing = function () { + this.removeClass('librevjs-lock-showing'); + return this; +}; + +/** + * Disable component by making it unshowable + */ +librevjs.Component.prototype.disable = function () { + this.hide(); + this.show = function () {}; +}; + +/** + * If a value is provided it will change the width of the player to that value + * otherwise the width is returned + * http://dev.w3.org/html5/spec/dimension-attributes.html#attr-dim-height + * Video tag width/height only work in pixels. No percents. + * But allowing limited percents use. e.g. width() will return number+%, not computed width + * @param {Number|String=} num Optional width number + * @param {[type]} skipListeners Skip the 'resize' event trigger + * @return {librevjs.Component|Number|String} Returns 'this' if dimension was set. + * Otherwise it returns the dimension. + */ +librevjs.Component.prototype.width = function (num, skipListeners) { + return this.dimension('width', num, skipListeners); +}; + +/** + * Get or set the height of the player + * @param {Number|String=} num Optional new player height + * @param {Boolean=} skipListeners Optional skip resize event trigger + * @return {librevjs.Component|Number|String} The player, or the dimension + */ +librevjs.Component.prototype.height = function (num, skipListeners) { + return this.dimension('height', num, skipListeners); +}; + +/** + * Set both width and height at the same time. + * @param {Number|String} width + * @param {Number|String} height + * @return {librevjs.Component} The player. + */ +librevjs.Component.prototype.dimensions = function (width, height) { + // Skip resize listeners on width for optimization + return this.width(width, true).height(height); +}; + +/** + * Get or set width or height. + * All for an integer, integer + 'px' or integer + '%'; + * Known issue: hidden elements. Hidden elements officially have a width of 0. + * So we're defaulting to the style.width value and falling back to computedStyle + * which has the hidden element issue. + * Info, but probably not an efficient fix: + * http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/ + * @param {String=} widthOrHeight 'width' or 'height' + * @param {Number|String=} num New dimension + * @param {Boolean=} skipListeners Skip resize event trigger + * @return {librevjs.Component|Number|String} Return the player if setting a dimension. + * Otherwise it returns the dimension. + */ +librevjs.Component.prototype.dimension = function (widthOrHeight, num, skipListeners) { + if (num !== undefined) { + + // Check if using css width/height (% or px) and adjust + if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) { + this.el_.style[widthOrHeight] = num; + } else if (num === 'auto') { + this.el_.style[widthOrHeight] = ''; + } else { + this.el_.style[widthOrHeight] = num + 'px'; + } + + // skipListeners allows us to avoid triggering the resize event when setting both width and height + if (!skipListeners) { + this.trigger('resize'); + } + + // Return component + return this; + } + + // Not setting a value, so getting it + // Make sure element exists + if (!this.el_) return 0; + + // Get dimension value from style + var val = this.el_.style[widthOrHeight]; + var pxIndex = val.indexOf('px'); + if (pxIndex !== -1) { + // Return the pixel value with no 'px' + return parseInt(val.slice(0, pxIndex), 10); + + // No px so using % or no style was set, so falling back to offsetWidth/height + // If component has display:none, offset will return 0 + // TODO: handle display:none and no dimension style using px + } else { + + return parseInt(this.el_['offset' + librevjs.capitalize(widthOrHeight)], 10); + + // ComputedStyle version. + // Only difference is if the element is hidden it will return + // the percent value (e.g. '100%'') + // instead of zero like offsetWidth returns. + // var val = librevjs.getComputedStyleValue(this.el_, widthOrHeight); + // var pxIndex = val.indexOf('px'); + + // if (pxIndex !== -1) { + // return val.slice(0, pxIndex); + // } else { + // return val; + // } + } +}; + +/** + * Emit 'tap' events when touch events are supported. We're requireing them to + * be enabled because otherwise every component would have this extra overhead + * unnecessarily, on mobile devices where extra overhead is especially bad. + * + * This is being implemented so we can support taps on the video element + * toggling the controls. + */ +librevjs.Component.prototype.emitTapEvents = function () { + var touchStart, touchTime, couldBeTap, noTap; + + // Track the start time so we can determine how long the touch lasted + touchStart = 0; + + this.on('touchstart', function (event) { + // Record start time so we can detect a tap vs. "touch and hold" + touchStart = new Date().getTime(); + // Reset couldBeTap tracking + couldBeTap = true; + }); + + noTap = function () { + couldBeTap = false; + }; + // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s + this.on('touchmove', noTap); + this.on('touchleave', noTap); + this.on('touchcancel', noTap); + + // When the touch ends, measure how long it took and trigger the appropriate + // event + this.on('touchend', function () { + // Proceed only if the touchmove/leave/cancel event didn't happen + if (couldBeTap === true) { + // Measure how long the touch lasted + touchTime = new Date().getTime() - touchStart; + // The touch needs to be quick in order to consider it a tap + if (touchTime < 250) { + this.trigger('tap'); + // It may be good to copy the touchend event object and change the + // type to tap, if the other event properties aren't exact after + // librevjs.fixEvent runs (e.g. event.target) + } + } + }); +}; +/* Button - Base class for all buttons +================================================================================ */ +/** + * Base class for all buttons + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.Button = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + var touchstart = false; + this.on('touchstart', function (event) { + // Stop click and other mouse events from triggering also + event.preventDefault(); + touchstart = true; + }); + this.on('touchmove', function () { + touchstart = false; + }); + var self = this; + this.on('touchend', function (event) { + if (touchstart) { + self.onClick(event); + } + event.preventDefault(); + }); + + this.on('click', this.onClick); + this.on('focus', this.onFocus); + this.on('blur', this.onBlur); + } +}); + +librevjs.Button.prototype.createEl = function (type, props) { + // Add standard Aria and Tabindex info + props = librevjs.obj.merge({ + className: this.buildCSSClass(), + innerHTML: '<div class="librevjs-control-content"><span class="librevjs-control-text">' + (this.buttonText || 'Need Text') + '</span></div>', + role: 'button', + 'aria-live': 'polite', // let the screen reader user know that the text of the button may change + tabIndex: 0 + }, props); + + return librevjs.Component.prototype.createEl.call(this, type, props); +}; + +librevjs.Button.prototype.buildCSSClass = function () { + // TODO: Change librevjs-control to librevjs-button? + return 'librevjs-control ' + librevjs.Component.prototype.buildCSSClass.call(this); +}; + +// Click - Override with specific functionality for button +librevjs.Button.prototype.onClick = function () {}; + +// Focus - Add keyboard functionality to element +librevjs.Button.prototype.onFocus = function () { + librevjs.on(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; + +// KeyPress (document level) - Trigger click when keys are pressed +librevjs.Button.prototype.onKeyPress = function (event) { + // Check for space bar (32) or enter (13) keys + if (event.which == 32 || event.which == 13) { + event.preventDefault(); + this.onClick(); + } +}; + +// Blur - Remove keyboard triggers +librevjs.Button.prototype.onBlur = function () { + librevjs.off(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; +/* Slider +================================================================================ */ +/** + * Parent for seek bar and volume slider + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.Slider = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + // Set property names to bar and handle to match with the child Slider class is looking for + this.bar = this.getChild(this.options_['barName']); + this.handle = this.getChild(this.options_['handleName']); + + player.on(this.playerEvent, librevjs.bind(this, this.update)); + + this.on('mousedown', this.onMouseDown); + this.on('touchstart', this.onMouseDown); + this.on('focus', this.onFocus); + this.on('blur', this.onBlur); + this.on('click', this.onClick); + + this.player_.on('controlsvisible', librevjs.bind(this, this.update)); + + // This is actually to fix the volume handle position. http://twitter.com/#!/gerritvanaaken/status/159046254519787520 + // this.player_.one('timeupdate', librevjs.bind(this, this.update)); + + player.ready(librevjs.bind(this, this.update)); + + this.boundEvents = {}; + } +}); + +librevjs.Slider.prototype.createEl = function (type, props) { + props = props || {}; + // Add the slider element class to all sub classes + props.className = props.className + ' librevjs-slider'; + props = librevjs.obj.merge({ + role: 'slider', + 'aria-valuenow': 0, + 'aria-valuemin': 0, + 'aria-valuemax': 100, + tabIndex: 0 + }, props); + + return librevjs.Component.prototype.createEl.call(this, type, props); +}; + +librevjs.Slider.prototype.onMouseDown = function (event) { + event.preventDefault(); + librevjs.blockTextSelection(); + + this.boundEvents.move = librevjs.bind(this, this.onMouseMove); + this.boundEvents.end = librevjs.bind(this, this.onMouseUp); + + librevjs.on(document, 'mousemove', this.boundEvents.move); + librevjs.on(document, 'mouseup', this.boundEvents.end); + librevjs.on(document, 'touchmove', this.boundEvents.move); + librevjs.on(document, 'touchend', this.boundEvents.end); + + this.onMouseMove(event); +}; + +librevjs.Slider.prototype.onMouseUp = function () { + librevjs.unblockTextSelection(); + librevjs.off(document, 'mousemove', this.boundEvents.move, false); + librevjs.off(document, 'mouseup', this.boundEvents.end, false); + librevjs.off(document, 'touchmove', this.boundEvents.move, false); + librevjs.off(document, 'touchend', this.boundEvents.end, false); + + this.update(); +}; + +librevjs.Slider.prototype.update = function () { + // In VolumeBar init we have a setTimeout for update that pops and update to the end of the + // execution stack. The player is destroyed before then update will cause an error + if (!this.el_) return; + + // If scrubbing, we could use a cached value to make the handle keep up with the user's mouse. + // On HTML5 browsers scrubbing is really smooth, but some flash players are slow, so we might want to utilize this later. + // var progress = (this.player_.scrubbing) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration(); + + var barProgress, + progress = this.getPercent(), + handle = this.handle, + bar = this.bar; + + // Protect against no duration and other division issues + if (isNaN(progress)) { + progress = 0; + } + + barProgress = progress; + + // If there is a handle, we need to account for the handle in our calculation for progress bar + // so that it doesn't fall short of or extend past the handle. + if (handle) { + + var box = this.el_, + boxWidth = box.offsetWidth, + + handleWidth = handle.el().offsetWidth, + + // The width of the handle in percent of the containing box + // In IE, widths may not be ready yet causing NaN + handlePercent = (handleWidth) ? handleWidth / boxWidth : 0, + + // Get the adjusted size of the box, considering that the handle's center never touches the left or right side. + // There is a margin of half the handle's width on both sides. + boxAdjustedPercent = 1 - handlePercent, + + // Adjust the progress that we'll use to set widths to the new adjusted box width + adjustedProgress = progress * boxAdjustedPercent; + + // The bar does reach the left side, so we need to account for this in the bar's width + barProgress = adjustedProgress + (handlePercent / 2); + + // Move the handle from the left based on the adjected progress + handle.el().style.left = librevjs.round(adjustedProgress * 100, 2) + '%'; + } + + // Set the new bar width + bar.el().style.width = librevjs.round(barProgress * 100, 2) + '%'; +}; + +librevjs.Slider.prototype.calculateDistance = function (event) { + var el, box, boxX, boxY, boxW, boxH, handle, pageX, pageY; + + el = this.el_; + box = librevjs.findPosition(el); + boxW = boxH = el.offsetWidth; + handle = this.handle; + + if (this.options_.vertical) { + boxY = box.top; + + if (event.changedTouches) { + pageY = event.changedTouches[0].pageY; + } else { + pageY = event.pageY; + } + + if (handle) { + var handleH = handle.el().offsetHeight; + // Adjusted X and Width, so handle doesn't go outside the bar + boxY = boxY + (handleH / 2); + boxH = boxH - handleH; + } + + // Percent that the click is through the adjusted area + return Math.max(0, Math.min(1, ((boxY - pageY) + boxH) / boxH)); + + } else { + boxX = box.left; + + if (event.changedTouches) { + pageX = event.changedTouches[0].pageX; + } else { + pageX = event.pageX; + } + + if (handle) { + var handleW = handle.el().offsetWidth; + + // Adjusted X and Width, so handle doesn't go outside the bar + boxX = boxX + (handleW / 2); + boxW = boxW - handleW; + } + + // Percent that the click is through the adjusted area + return Math.max(0, Math.min(1, (pageX - boxX) / boxW)); + } +}; + +librevjs.Slider.prototype.onFocus = function () { + librevjs.on(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; + +librevjs.Slider.prototype.onKeyPress = function (event) { + if (event.which == 37) { // Left Arrow + event.preventDefault(); + this.stepBack(); + } else if (event.which == 39) { // Right Arrow + event.preventDefault(); + this.stepForward(); + } +}; + +librevjs.Slider.prototype.onBlur = function () { + librevjs.off(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; + +/** + * Listener for click events on slider, used to prevent clicks + * from bubbling up to parent elements like button menus. + * @param {Object} event Event object + */ +librevjs.Slider.prototype.onClick = function (event) { + event.stopImmediatePropagation(); + event.preventDefault(); +}; + +/** + * SeekBar Behavior includes play progress bar, and seek handle + * Needed so it can determine seek position based on handle position/size + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.SliderHandle = librevjs.Component.extend(); + +/** + * Default value of the slider + * @type {Number} + */ +librevjs.SliderHandle.prototype.defaultValue = 0; + +/** @inheritDoc */ +librevjs.SliderHandle.prototype.createEl = function (type, props) { + props = props || {}; + // Add the slider element class to all sub classes + props.className = props.className + ' librevjs-slider-handle'; + props = librevjs.obj.merge({ + innerHTML: '<span class="librevjs-control-text">' + this.defaultValue + '</span>' + }, props); + + return librevjs.Component.prototype.createEl.call(this, 'div', props); +}; +/* Menu +================================================================================ */ +/** + * The base for text track and settings menu buttons. + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.Menu = librevjs.Component.extend(); + +/** + * Add a menu item to the menu + * @param {Object|String} component Component or component type to add + */ +librevjs.Menu.prototype.addItem = function (component) { + this.addChild(component); + component.on('click', librevjs.bind(this, function () { + this.unlockShowing(); + })); +}; + +/** @inheritDoc */ +librevjs.Menu.prototype.createEl = function () { + var contentElType = this.options().contentElType || 'ul'; + this.contentEl_ = librevjs.createEl(contentElType, { + className: 'librevjs-menu-content' + }); + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + append: this.contentEl_, + className: 'librevjs-menu' + }); + el.appendChild(this.contentEl_); + + // Prevent clicks from bubbling up. Needed for Menu Buttons, + // where a click on the parent is significant + librevjs.on(el, 'click', function (event) { + event.preventDefault(); + event.stopImmediatePropagation(); + }); + + return el; +}; + +/** + * Menu item + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.MenuItem = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + this.selected(options['selected']); + } +}); + +/** @inheritDoc */ +librevjs.MenuItem.prototype.createEl = function (type, props) { + return librevjs.Button.prototype.createEl.call(this, 'li', librevjs.obj.merge({ + className: 'librevjs-menu-item', + innerHTML: this.options_['label'] + }, props)); +}; + +/** @inheritDoc */ +librevjs.MenuItem.prototype.onClick = function () { + this.selected(true); +}; + +/** + * Set this menu item as selected or not + * @param {Boolean} selected + */ +librevjs.MenuItem.prototype.selected = function (selected) { + if (selected) { + this.addClass('librevjs-selected'); + this.el_.setAttribute('aria-selected', true); + } else { + this.removeClass('librevjs-selected'); + this.el_.setAttribute('aria-selected', false); + } +}; + + +/** + * A button class with a popup menu + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.MenuButton = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + this.menu = this.createMenu(); + + // Add list to element + this.addChild(this.menu); + + // Automatically hide empty menu buttons + if (this.items && this.items.length === 0) { + this.hide(); + } + + this.on('keyup', this.onKeyPress); + this.el_.setAttribute('aria-haspopup', true); + this.el_.setAttribute('role', 'button'); + } +}); + +/** + * Track the state of the menu button + * @type {Boolean} + */ +librevjs.MenuButton.prototype.buttonPressed_ = false; + +librevjs.MenuButton.prototype.createMenu = function () { + var menu = new librevjs.Menu(this.player_); + + // Add a title list item to the top + if (this.options().title) { + menu.el().appendChild(librevjs.createEl('li', { + className: 'librevjs-menu-title', + innerHTML: librevjs.capitalize(this.kind_), + tabindex: -1 + })); + } + + this.items = this['createItems'](); + + if (this.items) { + // Add menu items to the menu + for (var i = 0; i < this.items.length; i++) { + menu.addItem(this.items[i]); + } + } + + return menu; +}; + +/** + * Create the list of menu items. Specific to each subclass. + */ +librevjs.MenuButton.prototype.createItems = function () {}; + +/** @inheritDoc */ +librevjs.MenuButton.prototype.buildCSSClass = function () { + return this.className + ' librevjs-menu-button ' + librevjs.Button.prototype.buildCSSClass.call(this); +}; + +// Focus - Add keyboard functionality to element +// This function is not needed anymore. Instead, the keyboard functionality is handled by +// treating the button as triggering a submenu. When the button is pressed, the submenu +// appears. Pressing the button again makes the submenu disappear. +librevjs.MenuButton.prototype.onFocus = function () {}; +// Can't turn off list display that we turned on with focus, because list would go away. +librevjs.MenuButton.prototype.onBlur = function () {}; + +librevjs.MenuButton.prototype.onClick = function () { + // When you click the button it adds focus, which will show the menu indefinitely. + // So we'll remove focus when the mouse leaves the button. + // Focus is needed for tab navigation. + this.one('mouseout', librevjs.bind(this, function () { + this.menu.unlockShowing(); + this.el_.blur(); + })); + if (this.buttonPressed_) { + this.unpressButton(); + } else { + this.pressButton(); + } +}; + +librevjs.MenuButton.prototype.onKeyPress = function (event) { + event.preventDefault(); + + // Check for space bar (32) or enter (13) keys + if (event.which == 32 || event.which == 13) { + if (this.buttonPressed_) { + this.unpressButton(); + } else { + this.pressButton(); + } + // Check for escape (27) key + } else if (event.which == 27) { + if (this.buttonPressed_) { + this.unpressButton(); + } + } +}; + +librevjs.MenuButton.prototype.pressButton = function () { + this.buttonPressed_ = true; + this.menu.lockShowing(); + this.el_.setAttribute('aria-pressed', true); + if (this.items && this.items.length > 0) { + this.items[0].el().focus(); // set the focus to the title of the submenu + } +}; + +librevjs.MenuButton.prototype.unpressButton = function () { + this.buttonPressed_ = false; + this.menu.unlockShowing(); + this.el_.setAttribute('aria-pressed', false); +}; + +/** + * Main player class. A player instance is returned by _V_(id); + * @param {Element} tag The original video tag used for configuring options + * @param {Object=} options Player options + * @param {Function=} ready Ready callback function + * @constructor + */ +librevjs.Player = librevjs.Component.extend({ + /** @constructor */ + init: function (tag, options, ready) { + this.tag = tag; // Store the original tag used to set options + + // Set Options + // The options argument overrides options set in the video tag + // which overrides globally set options. + // This latter part coincides with the load order + // (tag must exist before Player) + options = librevjs.obj.merge(this.getTagSettings(tag), options); + + // Cache for video property values. + this.cache_ = {}; + + // Set poster + this.poster_ = options['poster']; + // Set controls + this.controls_ = options['controls']; + // Original tag settings stored in options + // now remove immediately so native controls don't flash. + // May be turned back on by HTML5 tech if nativeControlsForTouch is true + tag.controls = false; + + // Run base component initializing with new options. + // Builds the element through createEl() + // Inits and embeds any child components in opts + librevjs.Component.call(this, this, options, ready); + + // Update controls className. Can't do this when the controls are initially + // set because the element doesn't exist yet. + if (this.controls()) { + this.addClass('librevjs-controls-enabled'); + } else { + this.addClass('librevjs-controls-disabled'); + } + + // TODO: Make this smarter. Toggle user state between touching/mousing + // using events, since devices can have both touch and mouse events. + // if (librevjs.TOUCH_ENABLED) { + // this.addClass('librevjs-touch-enabled'); + // } + + // Firstplay event implimentation. Not sold on the event yet. + // Could probably just check currentTime==0? + this.one('play', function (e) { + var fpEvent = { + type: 'firstplay', + target: this.el_ + }; + // Using librevjs.trigger so we can check if default was prevented + var keepGoing = librevjs.trigger(this.el_, fpEvent); + + if (!keepGoing) { + e.preventDefault(); + e.stopPropagation(); + e.stopImmediatePropagation(); + } + }); + + this.on('ended', this.onEnded); + this.on('play', this.onPlay); + this.on('firstplay', this.onFirstPlay); + this.on('pause', this.onPause); + this.on('progress', this.onProgress); + this.on('durationchange', this.onDurationChange); + this.on('error', this.onError); + this.on('fullscreenchange', this.onFullscreenChange); + + // Make player easily findable by ID + librevjs.players[this.id_] = this; + + if (options['plugins']) { + librevjs.obj.each(options['plugins'], function (key, val) { + this[key](val); + }, this); + } + + this.listenForUserActivity(); + } +}); + +/** + * Player instance options, surfaced using librevjs.options + * librevjs.options = librevjs.Player.prototype.options_ + * Make changes in librevjs.options, not here. + * All options should use string keys so they avoid + * renaming by closure compiler + * @type {Object} + * @private + */ +librevjs.Player.prototype.options_ = librevjs.options; + +librevjs.Player.prototype.dispose = function () { + this.trigger('dispose'); + // prevent dispose from being called twice + this.off('dispose'); + + // Kill reference to this player + librevjs.players[this.id_] = null; + if (this.tag && this.tag['player']) { + this.tag['player'] = null; + } + if (this.el_ && this.el_['player']) { + this.el_['player'] = null; + } + + // Ensure that tracking progress and time progress will stop and plater deleted + this.stopTrackingProgress(); + this.stopTrackingCurrentTime(); + + if (this.tech) { + this.tech.dispose(); + } + + // Component dispose + librevjs.Component.prototype.dispose.call(this); +}; + +librevjs.Player.prototype.getTagSettings = function (tag) { + var options = { + 'sources': [], + 'tracks': [] + }; + + librevjs.obj.merge(options, librevjs.getAttributeValues(tag)); + + // Get tag children settings + if (tag.hasChildNodes()) { + var children, child, childName, i, j; + + children = tag.childNodes; + + for (i = 0, j = children.length; i < j; i++) { + child = children[i]; + // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/ + childName = child.nodeName.toLowerCase(); + if (childName === 'source') { + options['sources'].push(librevjs.getAttributeValues(child)); + } else if (childName === 'track') { + options['tracks'].push(librevjs.getAttributeValues(child)); + } + } + } + + return options; +}; + +librevjs.Player.prototype.createEl = function () { + var el = this.el_ = librevjs.Component.prototype.createEl.call(this, 'div'); + var tag = this.tag; + + // Remove width/height attrs from tag so CSS can make it 100% width/height + tag.removeAttribute('width'); + tag.removeAttribute('height'); + // Empty video tag tracks so the built-in player doesn't use them also. + // This may not be fast enough to stop HTML5 browsers from reading the tags + // so we'll need to turn off any default tracks if we're manually doing + // captions and subtitles. videoElement.textTracks + if (tag.hasChildNodes()) { + var nodes, nodesLength, i, node, nodeName, removeNodes; + + nodes = tag.childNodes; + nodesLength = nodes.length; + removeNodes = []; + + while (nodesLength--) { + node = nodes[nodesLength]; + nodeName = node.nodeName.toLowerCase(); + if (nodeName === 'track') { + removeNodes.push(node); + } + } + + for (i = 0; i < removeNodes.length; i++) { + tag.removeChild(removeNodes[i]); + } + } + + // Make sure tag ID exists + tag.id = tag.id || 'librevjs_video_' + librevjs.guid++; + + // Give video tag ID and class to player div + // ID will now reference player box, not the video tag + el.id = tag.id; + el.className = tag.className; + + // Update tag id/class for use as HTML5 playback tech + // Might think we should do this after embedding in container so .librevjs-tech class + // doesn't flash 100% width/height, but class only applies with .video-js parent + tag.id += '_html5_api'; + tag.className = 'librevjs-tech'; + + // Make player findable on elements + tag['player'] = el['player'] = this; + // Default state of video is paused + this.addClass('librevjs-paused'); + + // Make box use width/height of tag, or rely on default implementation + // Enforce with CSS since width/height attrs don't work on divs + this.width(this.options_['width="100%"'], true); // (true) Skip resize listener on load + this.height(this.options_['height="auto"'], true); + + // Wrap video tag in div (el/box) container + if (tag.parentNode) { + tag.parentNode.insertBefore(el, tag); + } + librevjs.insertFirst(tag, el); // Breaks iPhone, fixed in HTML5 setup. + + return el; +}; + +// /* Media Technology (tech) +// ================================================================================ */ +// Load/Create an instance of playback technlogy including element and API methods +// And append playback element in player div. +librevjs.Player.prototype.loadTech = function (techName, source) { + + // Pause and remove current playback technology + if (this.tech) { + this.unloadTech(); + + // if this is the first time loading, HTML5 tag will exist but won't be initialized + // so we need to remove it if we're not loading HTML5 + } else if (techName !== 'Html5' && this.tag) { + librevjs.Html5.disposeMediaElement(this.tag); + this.tag = null; + } + + this.techName = techName; + + // Turn off API access because we're loading a new tech that might load asynchronously + this.isReady_ = false; + + var techReady = function () { + this.player_.triggerReady(); + + // Manually track progress in cases where the browser/flash player doesn't report it. + if (!this.features['progressEvents']) { + this.player_.manualProgressOn(); + } + + // Manually track timeudpates in cases where the browser/flash player doesn't report it. + if (!this.features['timeupdateEvents']) { + this.player_.manualTimeUpdatesOn(); + } + }; + + // Grab tech-specific options from player options and add source and parent element to use. + var techOptions = librevjs.obj.merge({ + 'source': source, + 'parentEl': this.el_ + }, this.options_[techName.toLowerCase()]); + + if (source) { + if (source.src == this.cache_.src && this.cache_.currentTime > 0) { + techOptions['startTime'] = this.cache_.currentTime; + } + + this.cache_.src = source.src; + } + + // Initialize tech instance + this.tech = new window['cliplibrejs'][techName](this, techOptions); + + this.tech.ready(techReady); +}; + +librevjs.Player.prototype.unloadTech = function () { + this.isReady_ = false; + this.tech.dispose(); + + // Turn off any manual progress or timeupdate tracking + if (this.manualProgress) { + this.manualProgressOff(); + } + + if (this.manualTimeUpdates) { + this.manualTimeUpdatesOff(); + } + + this.tech = false; +}; + +// There's many issues around changing the size of a Flash (or other plugin) object. +// First is a plugin reload issue in Firefox that has been around for 11 years: https://bugzilla.mozilla.org/show_bug.cgi?id=90268 +// Then with the new fullscreen API, Mozilla and webkit browsers will reload the flash object after going to fullscreen. +// To get around this, we're unloading the tech, caching source and currentTime values, and reloading the tech once the plugin is resized. +// reloadTech: function(betweenFn){ +// librevjs.log('unloadingTech') +// this.unloadTech(); +// librevjs.log('unloadedTech') +// if (betweenFn) { betweenFn.call(); } +// librevjs.log('LoadingTech') +// this.loadTech(this.techName, { src: this.cache_.src }) +// librevjs.log('loadedTech') +// }, + +/* Fallbacks for unsupported event types +================================================================================ */ +// Manually trigger progress events based on changes to the buffered amount +// Many flash players and older HTML5 browsers don't send progress or progress-like events +librevjs.Player.prototype.manualProgressOn = function () { + this.manualProgress = true; + + // Trigger progress watching when a source begins loading + this.trackProgress(); + + // Watch for a native progress event call on the tech element + // In HTML5, some older versions don't support the progress event + // So we're assuming they don't, and turning off manual progress if they do. + // As opposed to doing user agent detection + this.tech.one('progress', function () { + + // Update known progress support for this playback technology + this.features['progressEvents'] = true; + + // Turn off manual progress tracking + this.player_.manualProgressOff(); + }); +}; + +librevjs.Player.prototype.manualProgressOff = function () { + this.manualProgress = false; + this.stopTrackingProgress(); +}; + +librevjs.Player.prototype.trackProgress = function () { + + this.progressInterval = setInterval(librevjs.bind(this, function () { + // Don't trigger unless buffered amount is greater than last time + // log(this.cache_.bufferEnd, this.buffered().end(0), this.duration()) + /* TODO: update for multiple buffered regions */ + if (this.cache_.bufferEnd < this.buffered().end(0)) { + this.trigger('progress'); + } else if (this.bufferedPercent() == 1) { + this.stopTrackingProgress(); + this.trigger('progress'); // Last update + } + }), 500); +}; +librevjs.Player.prototype.stopTrackingProgress = function () { + clearInterval(this.progressInterval); +}; + +/* Time Tracking -------------------------------------------------------------- */ +librevjs.Player.prototype.manualTimeUpdatesOn = function () { + this.manualTimeUpdates = true; + + this.on('play', this.trackCurrentTime); + this.on('pause', this.stopTrackingCurrentTime); + // timeupdate is also called by .currentTime whenever current time is set + + // Watch for native timeupdate event + this.tech.one('timeupdate', function () { + // Update known progress support for this playback technology + this.features['timeupdateEvents'] = true; + // Turn off manual progress tracking + this.player_.manualTimeUpdatesOff(); + }); +}; + +librevjs.Player.prototype.manualTimeUpdatesOff = function () { + this.manualTimeUpdates = false; + this.stopTrackingCurrentTime(); + this.off('play', this.trackCurrentTime); + this.off('pause', this.stopTrackingCurrentTime); +}; + +librevjs.Player.prototype.trackCurrentTime = function () { + if (this.currentTimeInterval) { + this.stopTrackingCurrentTime(); + } + this.currentTimeInterval = setInterval(librevjs.bind(this, function () { + this.trigger('timeupdate'); + }), 250); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15 +}; + +// Turn off play progress tracking (when paused or dragging) +librevjs.Player.prototype.stopTrackingCurrentTime = function () { + clearInterval(this.currentTimeInterval); +}; + +// /* Player event handlers (how the player reacts to certain events) +// ================================================================================ */ +librevjs.Player.prototype.onEnded = function () { + if (this.options_['loop']) { + this.currentTime(0); + this.play(); + } +}; + +librevjs.Player.prototype.onPlay = function () { + librevjs.removeClass(this.el_, 'librevjs-paused'); + librevjs.addClass(this.el_, 'librevjs-playing'); +}; + +librevjs.Player.prototype.onFirstPlay = function () { + //If the first starttime attribute is specified + //then we will start at the given offset in seconds + if (this.options_['starttime']) { + this.currentTime(this.options_['starttime']); + } + + this.addClass('librevjs-has-started'); +}; + +librevjs.Player.prototype.onPause = function () { + librevjs.removeClass(this.el_, 'librevjs-playing'); + librevjs.addClass(this.el_, 'librevjs-paused'); +}; + +librevjs.Player.prototype.onProgress = function () { + // Add custom event for when source is finished downloading. + if (this.bufferedPercent() == 1) { + this.trigger('loadedalldata'); + } +}; + +// Update duration with durationchange event +// Allows for cacheing value instead of asking player each time. +librevjs.Player.prototype.onDurationChange = function () { + this.duration(this.techGet('duration')); +}; + +librevjs.Player.prototype.onError = function (e) { + librevjs.log('Video Error', e); +}; + +librevjs.Player.prototype.onFullscreenChange = function () { + if (this.isFullScreen) { + this.addClass('librevjs-fullscreen'); + } else { + this.removeClass('librevjs-fullscreen'); + } +}; + +// /* Player API +// ================================================================================ */ + +/** + * Object for cached values. + * @private + */ +librevjs.Player.prototype.cache_; + +librevjs.Player.prototype.getCache = function () { + return this.cache_; +}; + +// Pass values to the playback tech +librevjs.Player.prototype.techCall = function (method, arg) { + // If it's not ready yet, call method when it is + if (this.tech && !this.tech.isReady_) { + this.tech.ready(function () { + this[method](arg); + }); + + // Otherwise call method now + } else { + try { + this.tech[method](arg); + } catch (e) { + librevjs.log(e); + throw e; + } + } +}; + +// Get calls can't wait for the tech, and sometimes don't need to. +librevjs.Player.prototype.techGet = function (method) { + + if (this.tech && this.tech.isReady_) { + + // Flash likes to die and reload when you hide or reposition it. + // In these cases the object methods go away and we get errors. + // When that happens we'll catch the errors and inform tech that it's not ready any more. + try { + return this.tech[method](); + } catch (e) { + // When building additional tech libs, an expected method may not be defined yet + if (this.tech[method] === undefined) { + librevjs.log('LibreVideo.js: ' + method + ' method not defined for ' + this.techName + ' playback technology.', e); + } else { + // When a method isn't available on the object it throws a TypeError + if (e.name == 'TypeError') { + librevjs.log('LibreVideo.js: ' + method + ' unavailable on ' + this.techName + ' playback technology element.', e); + this.tech.isReady_ = false; + } else { + librevjs.log(e); + } + } + throw e; + } + } + + return; +}; + +/** + * Start media playback + * http://dev.w3.org/html5/spec/video.html#dom-media-play + * We're triggering the 'play' event here instead of relying on the + * media element to allow using event.preventDefault() to stop + * play from happening if desired. Usecase: preroll ads. + */ +librevjs.Player.prototype.play = function () { + this.techCall('play'); + return this; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-pause +librevjs.Player.prototype.pause = function () { + this.techCall('pause'); + return this; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-paused +// The initial state of paused should be true (in Safari it's actually false) +librevjs.Player.prototype.paused = function () { + return (this.techGet('paused') === false) ? false : true; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-currenttime +librevjs.Player.prototype.currentTime = function (seconds) { + if (seconds !== undefined) { + + // Cache the last set value for smoother scrubbing. + this.cache_.lastSetCurrentTime = seconds; + + this.techCall('setCurrentTime', seconds); + + // Improve the accuracy of manual timeupdates + if (this.manualTimeUpdates) { + this.trigger('timeupdate'); + } + + return this; + } + + // Cache last currentTime and return + // Default to 0 seconds + return this.cache_.currentTime = (this.techGet('currentTime') || 0); +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-duration +// Duration should return NaN if not available. ParseFloat will turn false-ish values to NaN. +librevjs.Player.prototype.duration = function (seconds) { + if (seconds !== undefined) { + + // Cache the last set value for optimiized scrubbing (esp. Flash) + this.cache_.duration = parseFloat(seconds); + + return this; + } + + if (this.cache_.duration === undefined) { + this.onDurationChange(); + } + + return this.cache_.duration; +}; + +// Calculates how much time is left. Not in spec, but useful. +librevjs.Player.prototype.remainingTime = function () { + return this.duration() - this.currentTime(); +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-buffered +// Buffered returns a timerange object. +// Kind of like an array of portions of the video that have been downloaded. +// So far no browsers return more than one range (portion) +librevjs.Player.prototype.buffered = function () { + var buffered = this.techGet('buffered'), + start = 0, + buflast = buffered.length - 1, + // Default end to 0 and store in values + end = this.cache_.bufferEnd = this.cache_.bufferEnd || 0; + + if (buffered && buflast >= 0 && buffered.end(buflast) !== end) { + end = buffered.end(buflast); + // Storing values allows them be overridden by setBufferedFromProgress + this.cache_.bufferEnd = end; + } + + return librevjs.createTimeRange(start, end); +}; + +// Calculates amount of buffer is full. Not in spec but useful. +librevjs.Player.prototype.bufferedPercent = function () { + return (this.duration()) ? this.buffered().end(0) / this.duration() : 0; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-volume +librevjs.Player.prototype.volume = function (percentAsDecimal) { + var vol; + + if (percentAsDecimal !== undefined) { + vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal))); // Force value to between 0 and 1 + this.cache_.volume = vol; + this.techCall('setVolume', vol); + librevjs.setLocalStorage('volume', vol); + return this; + } + + // Default to 1 when returning current volume. + vol = parseFloat(this.techGet('volume')); + return (isNaN(vol)) ? 1 : vol; +}; + +// http://dev.w3.org/html5/spec/video.html#attr-media-muted +librevjs.Player.prototype.muted = function (muted) { + if (muted !== undefined) { + this.techCall('setMuted', muted); + return this; + } + return this.techGet('muted') || false; // Default to false +}; + +// Check if current tech can support native fullscreen (e.g. with built in controls lik iOS, so not our flash swf) +librevjs.Player.prototype.supportsFullScreen = function () { + return this.techGet('supportsFullScreen') || false; +}; + +// Turn on fullscreen (or window) mode +librevjs.Player.prototype.requestFullScreen = function () { + var requestFullScreen = librevjs.support.requestFullScreen; + this.isFullScreen = true; + + if (requestFullScreen) { + // the browser supports going fullscreen at the element level so we can + // take the controls fullscreen as well as the video + + // Trigger fullscreenchange event after change + // We have to specifically add this each time, and remove + // when cancelling fullscreen. Otherwise if there's multiple + // players on a page, they would all be reacting to the same fullscreen + // events + librevjs.on(document, requestFullScreen.eventName, librevjs.bind(this, function (e) { + this.isFullScreen = document[requestFullScreen.isFullScreen]; + + // If cancelling fullscreen, remove event listener. + if (this.isFullScreen === false) { + librevjs.off(document, requestFullScreen.eventName, arguments.callee); + } + + this.trigger('fullscreenchange'); + })); + + this.el_[requestFullScreen.requestFn](); + + } else if (this.tech.supportsFullScreen()) { + // we can't take the video.js controls fullscreen but we can go fullscreen + // with native controls + this.techCall('enterFullScreen'); + } else { + // fullscreen isn't supported so we'll just stretch the video element to + // fill the viewport + this.enterFullWindow(); + this.trigger('fullscreenchange'); + } + + return this; +}; + +librevjs.Player.prototype.cancelFullScreen = function () { + var requestFullScreen = librevjs.support.requestFullScreen; + this.isFullScreen = false; + + // Check for browser element fullscreen support + if (requestFullScreen) { + document[requestFullScreen.cancelFn](); + } else if (this.tech.supportsFullScreen()) { + this.techCall('exitFullScreen'); + } else { + this.exitFullWindow(); + this.trigger('fullscreenchange'); + } + + return this; +}; + +// When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us. +librevjs.Player.prototype.enterFullWindow = function () { + this.isFullWindow = true; + + // Storing original doc overflow value to return to when fullscreen is off + this.docOrigOverflow = document.documentElement.style.overflow; + + // Add listener for esc key to exit fullscreen + librevjs.on(document, 'keydown', librevjs.bind(this, this.fullWindowOnEscKey)); + + // Hide any scroll bars + document.documentElement.style.overflow = 'hidden'; + + // Apply fullscreen styles + librevjs.addClass(document.body, 'librevjs-full-window'); + + this.trigger('enterFullWindow'); +}; +librevjs.Player.prototype.fullWindowOnEscKey = function (event) { + if (event.keyCode === 27) { + if (this.isFullScreen === true) { + this.cancelFullScreen(); + } else { + this.exitFullWindow(); + } + } +}; + +librevjs.Player.prototype.exitFullWindow = function () { + this.isFullWindow = false; + librevjs.off(document, 'keydown', this.fullWindowOnEscKey); + + // Unhide scroll bars. + document.documentElement.style.overflow = this.docOrigOverflow; + + // Remove fullscreen styles + librevjs.removeClass(document.body, 'librevjs-full-window'); + + // Resize the box, controller, and poster to original sizes + // this.positionAll(); + this.trigger('exitFullWindow'); +}; + +librevjs.Player.prototype.selectSource = function (sources) { + + // Loop through each playback technology in the options order + for (var i = 0, j = this.options_['techOrder']; i < j.length; i++) { + var techName = librevjs.capitalize(j[i]), + tech = window['cliplibrejs'][techName]; + + // Check if the browser supports this technology + if (tech.isSupported()) { + // Loop through each source object + for (var a = 0, b = sources; a < b.length; a++) { + var source = b[a]; + + // Check if source can be played with this technology + if (tech['canPlaySource'](source)) { + return { + source: source, + tech: techName + }; + } + } + } + } + + return false; +}; + +// src is a pretty powerful function +// If you pass it an array of source objects, it will find the best source to play and use that object.src +// If the new source requires a new playback technology, it will switch to that. +// If you pass it an object, it will set the source to object.src +// If you pass it anything else (url string) it will set the video source to that +librevjs.Player.prototype.src = function (source) { + // Case: Array of source objects to choose from and pick the best to play + if (source instanceof Array) { + + var sourceTech = this.selectSource(source), + techName; + + if (sourceTech) { + source = sourceTech.source; + techName = sourceTech.tech; + + // If this technology is already loaded, set source + if (techName == this.techName) { + this.src(source); // Passing the source object + // Otherwise load this technology with chosen source + } else { + this.loadTech(techName, source); + } + } else { + this.el_.appendChild(librevjs.createEl('p', { + innerHTML: this.options()['notSupportedMessage'] + })); + } + + // Case: Source object { src: '', type: '' ... } + } else if (source instanceof Object) { + + if (window['cliplibrejs'][this.techName]['canPlaySource'](source)) { + this.src(source.src); + } else { + // Send through tech loop to check for a compatible technology. + this.src([source]); + } + + // Case: URL String (http://myvideo...) + } else { + // Cache for getting last set source + this.cache_.src = source; + + if (!this.isReady_) { + this.ready(function () { + this.src(source); + }); + } else { + this.techCall('src', source); + if (this.options_['preload'] == 'auto') { + this.load(); + } + if (this.options_['autoplay']) { + this.play(); + } + } + } + return this; +}; + +// Begin loading the src data +// http://dev.w3.org/html5/spec/video.html#dom-media-load +librevjs.Player.prototype.load = function () { + this.techCall('load'); + return this; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-currentsrc +librevjs.Player.prototype.currentSrc = function () { + return this.techGet('currentSrc') || this.cache_.src || ''; +}; + +// Attributes/Options +librevjs.Player.prototype.preload = function (value) { + if (value !== undefined) { + this.techCall('setPreload', value); + this.options_['preload'] = value; + return this; + } + return this.techGet('preload'); +}; +librevjs.Player.prototype.autoplay = function (value) { + if (value !== undefined) { + this.techCall('setAutoplay', value); + this.options_['autoplay'] = value; + return this; + } + return this.techGet('autoplay', value); +}; +librevjs.Player.prototype.loop = function (value) { + if (value !== undefined) { + this.techCall('setLoop', value); + this.options_['loop'] = value; + return this; + } + return this.techGet('loop'); +}; + +/** + * The url of the poster image source. + * @type {String} + * @private + */ +librevjs.Player.prototype.poster_; + +/** + * Get or set the poster image source url. + * @param {String} src Poster image source URL + * @return {String} Poster image source URL or null + */ +librevjs.Player.prototype.poster = function (src) { + if (src !== undefined) { + this.poster_ = src; + } + return this.poster_; +}; + +/** + * Whether or not the controls are showing + * @type {Boolean} + * @private + */ +librevjs.Player.prototype.controls_; + +/** + * Get or set whether or not the controls are showing. + * @param {Boolean} controls Set controls to showing or not + * @return {Boolean} Controls are showing + */ +librevjs.Player.prototype.controls = function (bool) { + if (bool !== undefined) { + bool = !! bool; // force boolean + // Don't trigger a change event unless it actually changed + if (this.controls_ !== bool) { + this.controls_ = bool; + if (bool) { + this.removeClass('librevjs-controls-disabled'); + this.addClass('librevjs-controls-enabled'); + this.trigger('controlsenabled'); + } else { + this.removeClass('librevjs-controls-enabled'); + this.addClass('librevjs-controls-disabled'); + this.trigger('controlsdisabled'); + } + } + return this; + } + return this.controls_; +}; + +librevjs.Player.prototype.usingNativeControls_; + +/** + * Toggle native controls on/off. Native controls are the controls built into + * devices (e.g. default iPhone controls), Flash, or other techs + * (e.g. Vimeo Controls) + * + * **This should only be set by the current tech, because only the tech knows + * if it can support native controls** + * + * @param {Boolean} bool True signals that native controls are on + * @return {librevjs.Player} Returns the player + */ +librevjs.Player.prototype.usingNativeControls = function (bool) { + if (bool !== undefined) { + bool = !! bool; // force boolean + // Don't trigger a change event unless it actually changed + if (this.usingNativeControls_ !== bool) { + this.usingNativeControls_ = bool; + if (bool) { + this.addClass('librevjs-using-native-controls'); + this.trigger('usingnativecontrols'); + } else { + this.removeClass('librevjs-using-native-controls'); + this.trigger('usingcustomcontrols'); + } + } + return this; + } + return this.usingNativeControls_; +}; + +librevjs.Player.prototype.error = function () { + return this.techGet('error'); +}; +librevjs.Player.prototype.ended = function () { + return this.techGet('ended'); +}; +librevjs.Player.prototype.seeking = function () { + return this.techGet('seeking'); +}; + +// When the player is first initialized, trigger activity so components +// like the control bar show themselves if needed +librevjs.Player.prototype.userActivity_ = true; +librevjs.Player.prototype.reportUserActivity = function (event) { + this.userActivity_ = true; +}; + +librevjs.Player.prototype.userActive_ = true; +librevjs.Player.prototype.userActive = function (bool) { + if (bool !== undefined) { + bool = !! bool; + if (bool !== this.userActive_) { + this.userActive_ = bool; + if (bool) { + // If the user was inactive and is now active we want to reset the + // inactivity timer + this.userActivity_ = true; + this.removeClass('librevjs-user-inactive'); + this.addClass('librevjs-user-active'); + this.trigger('useractive'); + } else { + // We're switching the state to inactive manually, so erase any other + // activity + this.userActivity_ = false; + + // Chrome/Safari/IE have bugs where when you change the cursor it can + // trigger a mousemove event. This causes an issue when you're hiding + // the cursor when the user is inactive, and a mousemove signals user + // activity. Making it impossible to go into inactive mode. Specifically + // this happens in fullscreen when we really need to hide the cursor. + // + // When this gets resolved in ALL browsers it can be removed + // https://code.google.com/p/chromium/issues/detail?id=103041 + this.tech.one('mousemove', function (e) { + e.stopPropagation(); + e.preventDefault(); + }); + this.removeClass('librevjs-user-active'); + this.addClass('librevjs-user-inactive'); + this.trigger('userinactive'); + } + } + return this; + } + return this.userActive_; +}; + +librevjs.Player.prototype.listenForUserActivity = function () { + var onMouseActivity, onMouseDown, mouseInProgress, onMouseUp, + activityCheck, inactivityTimeout; + + onMouseActivity = this.reportUserActivity; + + onMouseDown = function () { + onMouseActivity(); + // For as long as the they are touching the device or have their mouse down, + // we consider them active even if they're not moving their finger or mouse. + // So we want to continue to update that they are active + clearInterval(mouseInProgress); + // Setting userActivity=true now and setting the interval to the same time + // as the activityCheck interval (250) should ensure we never miss the + // next activityCheck + mouseInProgress = setInterval(librevjs.bind(this, onMouseActivity), 250); + }; + + onMouseUp = function (event) { + onMouseActivity(); + // Stop the interval that maintains activity if the mouse/touch is down + clearInterval(mouseInProgress); + }; + + // Any mouse movement will be considered user activity + this.on('mousedown', onMouseDown); + this.on('mousemove', onMouseActivity); + this.on('mouseup', onMouseUp); + + // Listen for keyboard navigation + // Shouldn't need to use inProgress interval because of key repeat + this.on('keydown', onMouseActivity); + this.on('keyup', onMouseActivity); + + // Consider any touch events that bubble up to be activity + // Certain touches on the tech will be blocked from bubbling because they + // toggle controls + this.on('touchstart', onMouseDown); + this.on('touchmove', onMouseActivity); + this.on('touchend', onMouseUp); + this.on('touchcancel', onMouseUp); + + // Run an interval every 250 milliseconds instead of stuffing everything into + // the mousemove/touchmove function itself, to prevent performance degradation. + // `this.reportUserActivity` simply sets this.userActivity_ to true, which + // then gets picked up by this loop + // http://ejohn.org/blog/learning-from-twitter/ + activityCheck = setInterval(librevjs.bind(this, function () { + // Check to see if mouse/touch activity has happened + if (this.userActivity_) { + // Reset the activity tracker + this.userActivity_ = false; + + // If the user state was inactive, set the state to active + this.userActive(true); + + // Clear any existing inactivity timeout to start the timer over + clearTimeout(inactivityTimeout); + + // In X seconds, if no more activity has occurred the user will be + // considered inactive + inactivityTimeout = setTimeout(librevjs.bind(this, function () { + // Protect against the case where the inactivityTimeout can trigger just + // before the next user activity is picked up by the activityCheck loop + // causing a flicker + if (!this.userActivity_) { + this.userActive(false); + } + }), 2000); + } + }), 250); + + // Clean up the intervals when we kill the player + this.on('dispose', function () { + clearInterval(activityCheck); + clearTimeout(inactivityTimeout); + }); +}; + +// Methods to add support for +// networkState: function(){ return this.techCall('networkState'); }, +// readyState: function(){ return this.techCall('readyState'); }, +// seeking: function(){ return this.techCall('seeking'); }, +// initialTime: function(){ return this.techCall('initialTime'); }, +// startOffsetTime: function(){ return this.techCall('startOffsetTime'); }, +// played: function(){ return this.techCall('played'); }, +// seekable: function(){ return this.techCall('seekable'); }, +// videoTracks: function(){ return this.techCall('videoTracks'); }, +// audioTracks: function(){ return this.techCall('audioTracks'); }, +// videoWidth: function(){ return this.techCall('videoWidth'); }, +// videoHeight: function(){ return this.techCall('videoHeight'); }, +// defaultPlaybackRate: function(){ return this.techCall('defaultPlaybackRate'); }, +// playbackRate: function(){ return this.techCall('playbackRate'); }, +// mediaGroup: function(){ return this.techCall('mediaGroup'); }, +// controller: function(){ return this.techCall('controller'); }, +// defaultMuted: function(){ return this.techCall('defaultMuted'); } + +// TODO +// currentSrcList: the array of sources including other formats and bitrates +// playList: array of source lists in order of playback + +// RequestFullscreen API +(function () { + var prefix, requestFS, div; + + div = document.createElement('div'); + + requestFS = {}; + + // Current W3C Spec + // http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#api + // Mozilla Draft: https://wiki.mozilla.org/Gecko:FullScreenAPI#fullscreenchange_event + // New: https://dvcs.w3.org/hg/fullscreen/raw-file/529a67b8d9f3/Overview.html + if (div.cancelFullscreen !== undefined) { + requestFS.requestFn = 'requestFullscreen'; + requestFS.cancelFn = 'exitFullscreen'; + requestFS.eventName = 'fullscreenchange'; + requestFS.isFullScreen = 'fullScreen'; + + // Webkit (Chrome/Safari) and Mozilla (Firefox) have working implementations + // that use prefixes and vary slightly from the new W3C spec. Specifically, + // using 'exit' instead of 'cancel', and lowercasing the 'S' in Fullscreen. + // Other browsers don't have any hints of which version they might follow yet, + // so not going to try to predict by looping through all prefixes. + } else { + + if (document.mozCancelFullScreen) { + prefix = 'moz'; + requestFS.isFullScreen = prefix + 'FullScreen'; + } else { + prefix = 'webkit'; + requestFS.isFullScreen = prefix + 'IsFullScreen'; + } + + if (div[prefix + 'RequestFullScreen']) { + requestFS.requestFn = prefix + 'RequestFullScreen'; + requestFS.cancelFn = prefix + 'CancelFullScreen'; + } + requestFS.eventName = prefix + 'fullscreenchange'; + } + + if (document[requestFS.cancelFn]) { + librevjs.support.requestFullScreen = requestFS; + } + +})(); + + +/** + * Container of main controls + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.ControlBar = librevjs.Component.extend(); + +librevjs.ControlBar.prototype.options_ = { + loadEvent: 'play', + children: { + 'playToggle': {}, + 'currentTimeDisplay': {}, + 'timeDivider': {}, + 'durationDisplay': {}, + 'remainingTimeDisplay': {}, + 'progressControl': {}, + 'fullscreenToggle': {}, + 'volumeControl': {}, + 'muteToggle': {} + // 'volumeMenuButton': {} + } +}; + +librevjs.ControlBar.prototype.createEl = function () { + return librevjs.createEl('div', { + className: 'librevjs-control-bar' + }); +}; +/** + * Button to toggle between play and pause + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.PlayToggle = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + player.on('play', librevjs.bind(this, this.onPlay)); + player.on('pause', librevjs.bind(this, this.onPause)); + } +}); + +librevjs.PlayToggle.prototype.buttonText = 'Play'; + +librevjs.PlayToggle.prototype.buildCSSClass = function () { + return 'librevjs-play-control ' + librevjs.Button.prototype.buildCSSClass.call(this); +}; + +// OnClick - Toggle between play and pause +librevjs.PlayToggle.prototype.onClick = function () { + if (this.player_.paused()) { + this.player_.play(); + } else { + this.player_.pause(); + } +}; + +// OnPlay - Add the librevjs-playing class to the element so it can change appearance +librevjs.PlayToggle.prototype.onPlay = function () { + librevjs.removeClass(this.el_, 'librevjs-paused'); + librevjs.addClass(this.el_, 'librevjs-playing'); + this.el_.children[0].children[0].innerHTML = 'Pause'; // change the button text to "Pause" +}; + +// OnPause - Add the librevjs-paused class to the element so it can change appearance +librevjs.PlayToggle.prototype.onPause = function () { + librevjs.removeClass(this.el_, 'librevjs-playing'); + librevjs.addClass(this.el_, 'librevjs-paused'); + this.el_.children[0].children[0].innerHTML = 'Play'; // change the button text to "Play" +}; +/** + * Displays the current time + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.CurrentTimeDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('timeupdate', librevjs.bind(this, this.updateContent)); + } +}); + +librevjs.CurrentTimeDisplay.prototype.createEl = function () { + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-current-time librevjs-time-controls librevjs-control' + }); + + this.content = librevjs.createEl('div', { + className: 'librevjs-current-time-display', + innerHTML: '<span class="librevjs-control-text">Current Time </span>' + '0:00', // label the current time for screen reader users + 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes + }); + + el.appendChild(librevjs.createEl('div').appendChild(this.content)); + return el; +}; + +librevjs.CurrentTimeDisplay.prototype.updateContent = function () { + // Allows for smooth scrubbing, when player can't keep up. + var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); + this.content.innerHTML = '<span class="librevjs-control-text">Current Time </span>' + librevjs.formatTime(time, this.player_.duration()); +}; + +/** + * Displays the duration + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.DurationDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('timeupdate', librevjs.bind(this, this.updateContent)); // this might need to be changes to 'durationchange' instead of 'timeupdate' eventually, however the durationchange event fires before this.player_.duration() is set, so the value cannot be written out using this method. Once the order of durationchange and this.player_.duration() being set is figured out, this can be updated. + } +}); + +librevjs.DurationDisplay.prototype.createEl = function () { + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-duration librevjs-time-controls librevjs-control' + }); + + this.content = librevjs.createEl('div', { + className: 'librevjs-duration-display', + innerHTML: '<span class="librevjs-control-text">Duration Time </span>' + '0:00', // label the duration time for screen reader users + 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes + }); + + el.appendChild(librevjs.createEl('div').appendChild(this.content)); + return el; +}; + +librevjs.DurationDisplay.prototype.updateContent = function () { + var duration = this.player_.duration(); + if (duration) { + this.content.innerHTML = '<span class="librevjs-control-text">Duration Time </span>' + librevjs.formatTime(duration); // label the duration time for screen reader users + } +}; + +/** + * Time Separator (Not used in main skin, but still available, and could be used as a 'spare element') + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.TimeDivider = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.TimeDivider.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-time-divider', + innerHTML: '<div><span>/</span></div>' + }); +}; + +/** + * Displays the time left in the video + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.RemainingTimeDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('timeupdate', librevjs.bind(this, this.updateContent)); + } +}); + +librevjs.RemainingTimeDisplay.prototype.createEl = function () { + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-remaining-time librevjs-time-controls librevjs-control' + }); + + this.content = librevjs.createEl('div', { + className: 'librevjs-remaining-time-display', + innerHTML: '<span class="librevjs-control-text">Remaining Time </span>' + '-0:00', // label the remaining time for screen reader users + 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes + }); + + el.appendChild(librevjs.createEl('div').appendChild(this.content)); + return el; +}; + +librevjs.RemainingTimeDisplay.prototype.updateContent = function () { + if (this.player_.duration()) { + this.content.innerHTML = '<span class="librevjs-control-text">Remaining Time </span>' + '-' + librevjs.formatTime(this.player_.remainingTime()); + } + + // Allows for smooth scrubbing, when player can't keep up. + // var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); + // this.content.innerHTML = librevjs.formatTime(time, this.player_.duration()); +}; +/** + * Toggle fullscreen video + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.FullscreenToggle = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + } +}); + +librevjs.FullscreenToggle.prototype.buttonText = 'Fullscreen'; + +librevjs.FullscreenToggle.prototype.buildCSSClass = function () { + return 'librevjs-fullscreen-control ' + librevjs.Button.prototype.buildCSSClass.call(this); +}; + +librevjs.FullscreenToggle.prototype.onClick = function () { + if (!this.player_.isFullScreen) { + this.player_.requestFullScreen(); + this.el_.children[0].children[0].innerHTML = 'Non-Fullscreen'; // change the button text to "Non-Fullscreen" + } else { + this.player_.cancelFullScreen(); + this.el_.children[0].children[0].innerHTML = 'Fullscreen'; // change the button to "Fullscreen" + } +}; +/** + * Seek, Load Progress, and Play Progress + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.ProgressControl = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.ProgressControl.prototype.options_ = { + children: { + 'seekBar': {} + } +}; + +librevjs.ProgressControl.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-progress-control librevjs-control' + }); +}; + +/** + * Seek Bar and holder for the progress bars + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.SeekBar = librevjs.Slider.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Slider.call(this, player, options); + player.on('timeupdate', librevjs.bind(this, this.updateARIAAttributes)); + player.ready(librevjs.bind(this, this.updateARIAAttributes)); + } +}); + +librevjs.SeekBar.prototype.options_ = { + children: { + 'loadProgressBar': {}, + 'playProgressBar': {}, + 'seekHandle': {} + }, + 'barName': 'playProgressBar', + 'handleName': 'seekHandle' +}; + +librevjs.SeekBar.prototype.playerEvent = 'timeupdate'; + +librevjs.SeekBar.prototype.createEl = function () { + return librevjs.Slider.prototype.createEl.call(this, 'div', { + className: 'librevjs-progress-holder', + 'aria-label': 'video progress bar' + }); +}; + +librevjs.SeekBar.prototype.updateARIAAttributes = function () { + // Allows for smooth scrubbing, when player can't keep up. + var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); + this.el_.setAttribute('aria-valuenow', librevjs.round(this.getPercent() * 100, 2)); // machine readable value of progress bar (percentage complete) + this.el_.setAttribute('aria-valuetext', librevjs.formatTime(time, this.player_.duration())); // human readable value of progress bar (time complete) +}; + +librevjs.SeekBar.prototype.getPercent = function () { + var currentTime; + // Flash RTMP provider will not report the correct time + // immediately after a seek. This isn't noticeable if you're + // seeking while the video is playing, but it is if you seek + // while the video is paused. + if (this.player_.techName === 'Flash' && this.player_.seeking()) { + var cache = this.player_.getCache(); + if (cache.lastSetCurrentTime) { + currentTime = cache.lastSetCurrentTime; + } else { + currentTime = this.player_.currentTime(); + } + } else { + currentTime = this.player_.currentTime(); + } + + return currentTime / this.player_.duration(); +}; + +librevjs.SeekBar.prototype.onMouseDown = function (event) { + librevjs.Slider.prototype.onMouseDown.call(this, event); + + this.player_.scrubbing = true; + + this.videoWasPlaying = !this.player_.paused(); + this.player_.pause(); +}; + +librevjs.SeekBar.prototype.onMouseMove = function (event) { + var newTime = this.calculateDistance(event) * this.player_.duration(); + + // Don't let video end while scrubbing. + if (newTime == this.player_.duration()) { + newTime = newTime - 0.1; + } + + // Set new time (tell player to seek to new time) + this.player_.currentTime(newTime); +}; + +librevjs.SeekBar.prototype.onMouseUp = function (event) { + librevjs.Slider.prototype.onMouseUp.call(this, event); + + this.player_.scrubbing = false; + if (this.videoWasPlaying) { + this.player_.play(); + } +}; + +librevjs.SeekBar.prototype.stepForward = function () { + this.player_.currentTime(this.player_.currentTime() + 5); // more quickly fast forward for keyboard-only users +}; + +librevjs.SeekBar.prototype.stepBack = function () { + this.player_.currentTime(this.player_.currentTime() - 5); // more quickly rewind for keyboard-only users +}; + + +/** + * Shows load progres + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.LoadProgressBar = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + player.on('progress', librevjs.bind(this, this.update)); + } +}); + +librevjs.LoadProgressBar.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-load-progress', + innerHTML: '<span class="librevjs-control-text">Loaded: 0%</span>' + }); +}; + +librevjs.LoadProgressBar.prototype.update = function () { + if (this.el_.style) { + this.el_.style.width = librevjs.round(this.player_.bufferedPercent() * 100, 2) + '%'; + } +}; + + +/** + * Shows play progress + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.PlayProgressBar = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.PlayProgressBar.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-play-progress', + innerHTML: '<span class="librevjs-control-text">Progress: 0%</span>' + }); +}; + +/** + * SeekBar component includes play progress bar, and seek handle + * Needed so it can determine seek position based on handle position/size + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.SeekHandle = librevjs.SliderHandle.extend(); + +/** @inheritDoc */ +librevjs.SeekHandle.prototype.defaultValue = '00:00'; + +/** @inheritDoc */ +librevjs.SeekHandle.prototype.createEl = function () { + return librevjs.SliderHandle.prototype.createEl.call(this, 'div', { + className: 'librevjs-seek-handle' + }); +}; +/** + * Control the volume + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeControl = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + // hide volume controls when they're not supported by the current tech + if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } + player.on('loadstart', librevjs.bind(this, function () { + if (player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } else { + this.removeClass('librevjs-hidden'); + } + })); + } +}); + +librevjs.VolumeControl.prototype.options_ = { + children: { + 'volumeBar': {} + } +}; + +librevjs.VolumeControl.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-control librevjs-control' + }); +}; + +/** + * Contains volume level + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeBar = librevjs.Slider.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Slider.call(this, player, options); + player.on('volumechange', librevjs.bind(this, this.updateARIAAttributes)); + player.ready(librevjs.bind(this, this.updateARIAAttributes)); + setTimeout(librevjs.bind(this, this.update), 0); // update when elements is in DOM + } +}); + +librevjs.VolumeBar.prototype.updateARIAAttributes = function () { + // Current value of volume bar as a percentage + this.el_.setAttribute('aria-valuenow', librevjs.round(this.player_.volume() * 100, 2)); + this.el_.setAttribute('aria-valuetext', librevjs.round(this.player_.volume() * 100, 2) + '%'); +}; + +librevjs.VolumeBar.prototype.options_ = { + children: { + 'volumeLevel': {}, + 'volumeHandle': {} + }, + 'barName': 'volumeLevel', + 'handleName': 'volumeHandle' +}; + +librevjs.VolumeBar.prototype.playerEvent = 'volumechange'; + +librevjs.VolumeBar.prototype.createEl = function () { + return librevjs.Slider.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-bar', + 'aria-label': 'volume level' + }); +}; + +librevjs.VolumeBar.prototype.onMouseMove = function (event) { + this.player_.volume(this.calculateDistance(event)); +}; + +librevjs.VolumeBar.prototype.getPercent = function () { + if (this.player_.muted()) { + return 0; + } else { + return this.player_.volume(); + } +}; + +librevjs.VolumeBar.prototype.stepForward = function () { + this.player_.volume(this.player_.volume() + 0.1); +}; + +librevjs.VolumeBar.prototype.stepBack = function () { + this.player_.volume(this.player_.volume() - 0.1); +}; + +/** + * Shows volume level + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeLevel = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.VolumeLevel.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-level', + innerHTML: '<span class="librevjs-control-text"></span>' + }); +}; + +/** + * Change volume level + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeHandle = librevjs.SliderHandle.extend(); + +/** @inheritDoc */ +librevjs.VolumeHandle.prototype.defaultValue = '00:00'; + +/** @inheritDoc */ +librevjs.VolumeHandle.prototype.createEl = function () { + return librevjs.SliderHandle.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-handle' + }); +}; +/** + * Mute the audio + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.MuteToggle = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + player.on('volumechange', librevjs.bind(this, this.update)); + + // hide mute toggle if the current tech doesn't support volume control + if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } + player.on('loadstart', librevjs.bind(this, function () { + if (player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } else { + this.removeClass('librevjs-hidden'); + } + })); + } +}); + +librevjs.MuteToggle.prototype.createEl = function () { + return librevjs.Button.prototype.createEl.call(this, 'div', { + className: 'librevjs-mute-control librevjs-control', + innerHTML: '<div><span class="librevjs-control-text">Mute</span></div>' + }); +}; + +librevjs.MuteToggle.prototype.onClick = function () { + this.player_.muted(this.player_.muted() ? false : true); +}; + +librevjs.MuteToggle.prototype.update = function () { + var vol = this.player_.volume(), + level = 3; + + if (vol === 0 || this.player_.muted()) { + level = 0; + } else if (vol < 0.33) { + level = 1; + } else if (vol < 0.67) { + level = 2; + } + + // Don't rewrite the button text if the actual text doesn't change. + // This causes unnecessary and confusing information for screen reader users. + // This check is needed because this function gets called every time the volume level is changed. + if (this.player_.muted()) { + if (this.el_.children[0].children[0].innerHTML != 'Unmute') { + this.el_.children[0].children[0].innerHTML = 'Unmute'; // change the button text to "Unmute" + } + } else { + if (this.el_.children[0].children[0].innerHTML != 'Mute') { + this.el_.children[0].children[0].innerHTML = 'Mute'; // change the button text to "Mute" + } + } + + /* TODO improve muted icon classes */ + for (var i = 0; i < 4; i++) { + librevjs.removeClass(this.el_, 'librevjs-vol-' + i); + } + librevjs.addClass(this.el_, 'librevjs-vol-' + level); +}; +/** + * Menu button with a popup for showing the volume slider. + * @constructor + */ +librevjs.VolumeMenuButton = librevjs.MenuButton.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.MenuButton.call(this, player, options); + + // Same listeners as MuteToggle + player.on('volumechange', librevjs.bind(this, this.update)); + + // hide mute toggle if the current tech doesn't support volume control + if (player.tech && player.tech.features && player.tech.features.volumeControl === false) { + this.addClass('librevjs-hidden'); + } + player.on('loadstart', librevjs.bind(this, function () { + if (player.tech.features && player.tech.features.volumeControl === false) { + this.addClass('librevjs-hidden'); + } else { + this.removeClass('librevjs-hidden'); + } + })); + this.addClass('librevjs-menu-button'); + } +}); + +librevjs.VolumeMenuButton.prototype.createMenu = function () { + var menu = new librevjs.Menu(this.player_, { + contentElType: 'div' + }); + var vc = new librevjs.VolumeBar(this.player_, librevjs.obj.merge({ + vertical: true + }, this.options_.volumeBar)); + menu.addChild(vc); + return menu; +}; + +librevjs.VolumeMenuButton.prototype.onClick = function () { + librevjs.MuteToggle.prototype.onClick.call(this); + librevjs.MenuButton.prototype.onClick.call(this); +}; + +librevjs.VolumeMenuButton.prototype.createEl = function () { + return librevjs.Button.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-menu-button librevjs-menu-button librevjs-control', + innerHTML: '<div><span class="librevjs-control-text">Mute</span></div>' + }); +}; +librevjs.VolumeMenuButton.prototype.update = librevjs.MuteToggle.prototype.update; +/* Poster Image +================================================================================ */ +/** + * Poster image. Shows before the video plays. + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.PosterImage = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + if (!player.poster() || !player.controls()) { + this.hide(); + } + + player.on('play', librevjs.bind(this, this.hide)); + } +}); + +librevjs.PosterImage.prototype.createEl = function () { + var el = librevjs.createEl('div', { + className: 'librevjs-poster', + + // Don't want poster to be tabbable. + tabIndex: -1 + }), + poster = this.player_.poster(); + + if (poster) { + if ('backgroundSize' in el.style) { + el.style.backgroundImage = 'url("' + poster + '")'; + } else { + el.appendChild(librevjs.createEl('img', { + src: poster + })); + } + } + + return el; +}; + +librevjs.PosterImage.prototype.onClick = function () { + // Only accept clicks when controls are enabled + if (this.player().controls()) { + this.player_.play(); + } +}; +/* Loading Spinner +================================================================================ */ +/** + * Loading spinner for waiting events + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.LoadingSpinner = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('canplay', librevjs.bind(this, this.hide)); + player.on('canplaythrough', librevjs.bind(this, this.hide)); + player.on('playing', librevjs.bind(this, this.hide)); + player.on('seeked', librevjs.bind(this, this.hide)); + + player.on('seeking', librevjs.bind(this, this.show)); + + // in some browsers seeking does not trigger the 'playing' event, + // so we also need to trap 'seeked' if we are going to set a + // 'seeking' event + player.on('seeked', librevjs.bind(this, this.hide)); + + player.on('error', librevjs.bind(this, this.show)); + + // Not showing spinner on stalled any more. Browsers may stall and then not trigger any events that would remove the spinner. + // player.on('stalled', librevjs.bind(this, this.show)); + + player.on('waiting', librevjs.bind(this, this.show)); + } +}); + +librevjs.LoadingSpinner.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-loading-spinner' + }); +}; +/* Big Play Button +================================================================================ */ +/** + * Initial play button. Shows before the video has played. The hiding of the + * big play button is done via CSS and player states. + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.BigPlayButton = librevjs.Button.extend(); + +librevjs.BigPlayButton.prototype.createEl = function () { + return librevjs.Button.prototype.createEl.call(this, 'div', { + className: 'librevjs-big-play-button', + innerHTML: '<span></span>', + 'aria-label': 'play video' + }); +}; + +librevjs.BigPlayButton.prototype.onClick = function () { + this.player_.play(); +}; +/** + * @fileoverview Media Technology Controller - Base class for media playback + * technology controllers like Flash and HTML5 + */ + +/** + * Base class for media (HTML5 Video, Flash) controllers + * @param {librevjs.Player|Object} player Central player instance + * @param {Object=} options Options object + * @constructor + */ +librevjs.MediaTechController = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.Component.call(this, player, options, ready); + + this.initControlsListeners(); + } +}); + +/** + * Set up click and touch listeners for the playback element + * On desktops, a click on the video itself will toggle playback, + * on a mobile device a click on the video toggles controls. + * (toggling controls is done by toggling the user state between active and + * inactive) + * + * A tap can signal that a user has become active, or has become inactive + * e.g. a quick tap on an iPhone movie should reveal the controls. Another + * quick tap should hide them again (signaling the user is in an inactive + * viewing state) + * + * In addition to this, we still want the user to be considered inactive after + * a few seconds of inactivity. + * + * Note: the only part of iOS interaction we can't mimic with this setup + * is a touch and hold on the video element counting as activity in order to + * keep the controls showing, but that shouldn't be an issue. A touch and hold on + * any controls will still keep the user active + */ +librevjs.MediaTechController.prototype.initControlsListeners = function () { + var player, tech, activateControls, deactivateControls; + + tech = this; + player = this.player(); + + var activateControls = function () { + if (player.controls() && !player.usingNativeControls()) { + tech.addControlsListeners(); + } + }; + + deactivateControls = librevjs.bind(tech, tech.removeControlsListeners); + + // Set up event listeners once the tech is ready and has an element to apply + // listeners to + this.ready(activateControls); + player.on('controlsenabled', activateControls); + player.on('controlsdisabled', deactivateControls); +}; + +librevjs.MediaTechController.prototype.addControlsListeners = function () { + var preventBubble, userWasActive; + + // Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do + // trigger mousedown/up. + // http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object + // Any touch events are set to block the mousedown event from happening + this.on('mousedown', this.onClick); + + // We need to block touch events on the video element from bubbling up, + // otherwise they'll signal activity prematurely. The specific use case is + // when the video is playing and the controls have faded out. In this case + // only a tap (fast touch) should toggle the user active state and turn the + // controls back on. A touch and move or touch and hold should not trigger + // the controls (per iOS as an example at least) + // + // We always want to stop propagation on touchstart because touchstart + // at the player level starts the touchInProgress interval. We can still + // report activity on the other events, but won't let them bubble for + // consistency. We don't want to bubble a touchend without a touchstart. + this.on('touchstart', function (event) { + // Stop the mouse events from also happening + event.preventDefault(); + event.stopPropagation(); + // Record if the user was active now so we don't have to keep polling it + userWasActive = this.player_.userActive(); + }); + + preventBubble = function (event) { + event.stopPropagation(); + if (userWasActive) { + this.player_.reportUserActivity(); + } + }; + + // Treat all touch events the same for consistency + this.on('touchmove', preventBubble); + this.on('touchleave', preventBubble); + this.on('touchcancel', preventBubble); + this.on('touchend', preventBubble); + + // Turn on component tap events + this.emitTapEvents(); + + // The tap listener needs to come after the touchend listener because the tap + // listener cancels out any reportedUserActivity when setting userActive(false) + this.on('tap', this.onTap); +}; + +/** + * Remove the listeners used for click and tap controls. This is needed for + * toggling to controls disabled, where a tap/touch should do nothing. + */ +librevjs.MediaTechController.prototype.removeControlsListeners = function () { + // We don't want to just use `this.off()` because there might be other needed + // listeners added by techs that extend this. + this.off('tap'); + this.off('touchstart'); + this.off('touchmove'); + this.off('touchleave'); + this.off('touchcancel'); + this.off('touchend'); + this.off('click'); + this.off('mousedown'); +}; + +/** + * Handle a click on the media element. By default will play/pause the media. + */ +librevjs.MediaTechController.prototype.onClick = function (event) { + // We're using mousedown to detect clicks thanks to Flash, but mousedown + // will also be triggered with right-clicks, so we need to prevent that + if (event.button !== 0) return; + + // When controls are disabled a click should not toggle playback because + // the click is considered a control + if (this.player().controls()) { + if (this.player().paused()) { + this.player().play(); + } else { + this.player().pause(); + } + } +}; + +/** + * Handle a tap on the media element. By default it will toggle the user + * activity state, which hides and shows the controls. + */ + +librevjs.MediaTechController.prototype.onTap = function () { + this.player().userActive(!this.player().userActive()); +}; + +librevjs.MediaTechController.prototype.features = { + 'volumeControl': true, + + // Resizing plugins using request fullscreen reloads the plugin + 'fullscreenResize': false, + + // Optional events that we can manually mimic with timers + // currently not triggered by video-js-swf + 'progressEvents': false, + 'timeupdateEvents': false +}; + +librevjs.media = {}; + +/** + * List of default API methods for any MediaTechController + * @type {String} + */ +librevjs.media.ApiMethods = 'play,pause,paused,currentTime,setCurrentTime,duration,buffered,volume,setVolume,muted,setMuted,width,height,supportsFullScreen,enterFullScreen,src,load,currentSrc,preload,setPreload,autoplay,setAutoplay,loop,setLoop,error,networkState,readyState,seeking,initialTime,startOffsetTime,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks,defaultPlaybackRate,playbackRate,mediaGroup,controller,controls,defaultMuted'.split(','); +// Create placeholder methods for each that warn when a method isn't supported by the current playback technology + +function createMethod(methodName) { + return function () { + throw new Error('The "' + methodName + '" method is not available on the playback technology\'s API'); + }; +} + +for (var i = librevjs.media.ApiMethods.length - 1; i >= 0; i--) { + var methodName = librevjs.media.ApiMethods[i]; + librevjs.MediaTechController.prototype[librevjs.media.ApiMethods[i]] = createMethod(methodName); +} +/** + * @fileoverview HTML5 Media Controller - Wrapper for HTML5 Media API + */ + +/** + * HTML5 Media Controller - Wrapper for HTML5 Media API + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @param {Function=} ready + * @constructor + */ +librevjs.Html5 = librevjs.MediaTechController.extend({ + /** @constructor */ + init: function (player, options, ready) { + // volume cannot be changed from 1 on iOS + this.features['volumeControl'] = librevjs.Html5.canControlVolume(); + + // In iOS, if you move a video element in the DOM, it breaks video playback. + this.features['movingMediaElementInDOM'] = !librevjs.IS_IOS; + + // HTML video is able to automatically resize when going to fullscreen + this.features['fullscreenResize'] = true; + + librevjs.MediaTechController.call(this, player, options, ready); + + var source = options['source']; + + // If the element source is already set, we may have missed the loadstart event, and want to trigger it. + // We don't want to set the source again and interrupt playback. + if (source && this.el_.currentSrc === source.src && this.el_.networkState > 0) { + player.trigger('loadstart'); + + // Otherwise set the source if one was provided. + } else if (source) { + this.el_.src = source.src; + } + + // Determine if native controls should be used + // Our goal should be to get the custom controls on mobile solid everywhere + // so we can remove this all together. Right now this will block custom + // controls on touch enabled laptops like the Chrome Pixel + if (librevjs.TOUCH_ENABLED && player.options()['nativeControlsForTouch'] === true) { + this.useNativeControls(); + } + + // Chrome and Safari both have issues with autoplay. + // In Safari (5.1.1), when we move the video element into the container div, autoplay doesn't work. + // In Chrome (15), if you have autoplay + a poster + no controls, the video gets hidden (but audio plays) + // This fixes both issues. Need to wait for API, so it updates displays correctly + player.ready(function () { + if (this.tag && this.options_['autoplay'] && this.paused()) { + delete this.tag['poster']; // Chrome Fix. Fixed in Chrome v16. + this.play(); + } + }); + + this.setupTriggers(); + this.triggerReady(); + } +}); + +librevjs.Html5.prototype.dispose = function () { + librevjs.MediaTechController.prototype.dispose.call(this); +}; + +librevjs.Html5.prototype.createEl = function () { + var player = this.player_, + // If possible, reuse original tag for HTML5 playback technology element + el = player.tag, + newEl, + clone; + + // Check if this browser supports moving the element into the box. + // On the iPhone video will break if you move the element, + // So we have to create a brand new element. + if (!el || this.features['movingMediaElementInDOM'] === false) { + + // If the original tag is still there, clone and remove it. + if (el) { + clone = el.cloneNode(false); + librevjs.Html5.disposeMediaElement(el); + el = clone; + player.tag = null; + } else { + el = librevjs.createEl('video', { + id: player.id() + '_html5_api', + className: 'librevjs-tech' + }); + } + // associate the player with the new tag + el['player'] = player; + + librevjs.insertFirst(el, player.el()); + } + + // Update specific tag settings, in case they were overridden + var attrs = ['autoplay', 'preload', 'loop', 'muted']; + for (var i = attrs.length - 1; i >= 0; i--) { + var attr = attrs[i]; + if (player.options_[attr] !== null) { + el[attr] = player.options_[attr]; + } + } + + return el; + // jenniisawesome = true; +}; + +// Make video events trigger player events +// May seem verbose here, but makes other APIs possible. +librevjs.Html5.prototype.setupTriggers = function () { + for (var i = librevjs.Html5.Events.length - 1; i >= 0; i--) { + librevjs.on(this.el_, librevjs.Html5.Events[i], librevjs.bind(this.player_, this.eventHandler)); + } +}; +// Triggers removed using this.off when disposed + +librevjs.Html5.prototype.eventHandler = function (e) { + this.trigger(e); + + // No need for media events to bubble up. + e.stopPropagation(); +}; + +librevjs.Html5.prototype.useNativeControls = function () { + var tech, player, controlsOn, controlsOff, cleanUp; + + tech = this; + player = this.player(); + + // If the player controls are enabled turn on the native controls + tech.setControls(player.controls()); + + // Update the native controls when player controls state is updated + controlsOn = function () { + tech.setControls(true); + }; + controlsOff = function () { + tech.setControls(false); + }; + player.on('controlsenabled', controlsOn); + player.on('controlsdisabled', controlsOff); + + // Clean up when not using native controls anymore + cleanUp = function () { + player.off('controlsenabled', controlsOn); + player.off('controlsdisabled', controlsOff); + }; + tech.on('dispose', cleanUp); + player.on('usingcustomcontrols', cleanUp); + + // Update the state of the player to using native controls + player.usingNativeControls(true); +}; + + +librevjs.Html5.prototype.play = function () { + this.el_.play(); +}; +librevjs.Html5.prototype.pause = function () { + this.el_.pause(); +}; +librevjs.Html5.prototype.paused = function () { + return this.el_.paused; +}; + +librevjs.Html5.prototype.currentTime = function () { + return this.el_.currentTime; +}; +librevjs.Html5.prototype.setCurrentTime = function (seconds) { + try { + this.el_.currentTime = seconds; + } catch (e) { + librevjs.log(e, 'Video is not ready. (LibreVideo.js)'); + // this.warning(LibreVideoJS.warnings.videoNotReady); + } +}; + +librevjs.Html5.prototype.duration = function () { + return this.el_.duration || 0; +}; +librevjs.Html5.prototype.buffered = function () { + return this.el_.buffered; +}; + +librevjs.Html5.prototype.volume = function () { + return this.el_.volume; +}; +librevjs.Html5.prototype.setVolume = function (percentAsDecimal) { + this.el_.volume = percentAsDecimal; +}; +librevjs.Html5.prototype.muted = function () { + return this.el_.muted; +}; +librevjs.Html5.prototype.setMuted = function (muted) { + this.el_.muted = muted; +}; + +librevjs.Html5.prototype.width = function () { + return this.el_.offsetWidth; +}; +librevjs.Html5.prototype.height = function () { + return this.el_.offsetHeight; +}; + +librevjs.Html5.prototype.supportsFullScreen = function () { + if (typeof this.el_.webkitEnterFullScreen == 'function') { + + // Seems to be broken in Chromium/Chrome && Safari in Leopard + if (/Android/.test(librevjs.USER_AGENT) || !/Chrome|Mac OS X 10.5/.test(librevjs.USER_AGENT)) { + return true; + } + } + return false; +}; + +librevjs.Html5.prototype.enterFullScreen = function () { + var video = this.el_; + if (video.paused && video.networkState <= video.HAVE_METADATA) { + // attempt to prime the video element for programmatic access + // this isn't necessary on the desktop but shouldn't hurt + this.el_.play(); + + // playing and pausing synchronously during the transition to fullscreen + // can get iOS ~6.1 devices into a play/pause loop + setTimeout(function () { + video.pause(); + video.webkitEnterFullScreen(); + }, 0); + } else { + video.webkitEnterFullScreen(); + } +}; +librevjs.Html5.prototype.exitFullScreen = function () { + this.el_.webkitExitFullScreen(); +}; +librevjs.Html5.prototype.src = function (src) { + this.el_.src = src; +}; +librevjs.Html5.prototype.load = function () { + this.el_.load(); +}; +librevjs.Html5.prototype.currentSrc = function () { + return this.el_.currentSrc; +}; + +librevjs.Html5.prototype.preload = function () { + return this.el_.preload; +}; +librevjs.Html5.prototype.setPreload = function (val) { + this.el_.preload = val; +}; + +librevjs.Html5.prototype.autoplay = function () { + return this.el_.autoplay; +}; +librevjs.Html5.prototype.setAutoplay = function (val) { + this.el_.autoplay = val; +}; + +librevjs.Html5.prototype.controls = function () { + return this.el_.controls; +} +librevjs.Html5.prototype.setControls = function (val) { + this.el_.controls = !! val; +} + +librevjs.Html5.prototype.loop = function () { + return this.el_.loop; +}; +librevjs.Html5.prototype.setLoop = function (val) { + this.el_.loop = val; +}; + +librevjs.Html5.prototype.error = function () { + return this.el_.error; +}; +librevjs.Html5.prototype.seeking = function () { + return this.el_.seeking; +}; +librevjs.Html5.prototype.ended = function () { + return this.el_.ended; +}; +librevjs.Html5.prototype.defaultMuted = function () { + return this.el_.defaultMuted; +}; + +/* HTML5 Support Testing ---------------------------------------------------- */ + +librevjs.Html5.isSupported = function () { + return !!librevjs.TEST_VID.canPlayType; +}; + +librevjs.Html5.canPlaySource = function (srcObj) { + // MediaPlayer throws an error here + try { + return !!librevjs.TEST_VID.canPlayType(srcObj.type); + } catch (e) { + return ''; + } + // TODO: Check Type + // If no Type, check ext + // Check Media Type +}; + +librevjs.Html5.canControlVolume = function () { + var volume = librevjs.TEST_VID.volume; + librevjs.TEST_VID.volume = (volume / 2) + 0.1; + return volume !== librevjs.TEST_VID.volume; +}; + +// List of all HTML5 events (various uses). +librevjs.Html5.Events = 'loadstart,suspend,abort,error,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,playing,waiting,seeking,seeked,ended,durationchange,timeupdate,progress,play,pause,ratechange,volumechange'.split(','); + +librevjs.Html5.disposeMediaElement = function (el) { + if (!el) { + return; + } + + el['player'] = null; + + if (el.parentNode) { + el.parentNode.removeChild(el); + } + + // remove any child track or source nodes to prevent their loading + while (el.hasChildNodes()) { + el.removeChild(el.firstChild); + } + + // remove any src reference. not setting `src=''` because that causes a warning + // in firefox + el.removeAttribute('src'); + + // force the media element to update its loading state by calling load() + if (typeof el.load === 'function') { + el.load(); + } +}; + +// HTML5 Feature detection and Device Fixes --------------------------------- // + +// Override Android 2.2 and less canPlayType method which is broken +if (librevjs.IS_OLD_ANDROID) { + document.createElement('video').constructor.prototype.canPlayType = function (type) { + return (type && type.toLowerCase().indexOf('video/mp4') != -1) ? 'maybe' : ''; + }; +} +/** + * @fileoverview LibreVideoJS NO use flash + * Not using setupTriggers. Using global onEvent func to distribute events + */ + +/** + * HTML5 Media Controller - Wrapper for HTML5 Media API + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @param {Function=} ready + * @constructor + */ +librevjs.Flash = librevjs.MediaTechController.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.MediaTechController.call(this, player, options, ready); + + var source = options['source'], + + // Which element to embed in + parentEl = options['parentEl'], + + // Create a temporary element to be replaced by swf object + placeHolder = this.el_ = librevjs.createEl('div', { + id: player.id() + '_temp_flash' + }), + + // Generate ID for swf object + objId = player.id() + '_flash_api', + + // Store player options in local var for optimization + // TODO: switch to using player methods instead of options + // e.g. player.autoplay(); + playerOptions = player.options_, + + // Merge default flashvars with ones passed in to init + flashVars = librevjs.obj.merge({ + + // SWF Callback Functions + 'readyFunction': 'cliplibrejs.Flash.onReady', + 'eventProxyFunction': 'cliplibrejs.Flash.onEvent', + 'errorEventProxyFunction': 'cliplibrejs.Flash.onError', + + // Player Settings + 'autoplay': playerOptions.autoplay, + 'preload': playerOptions.preload, + 'loop': playerOptions.loop, + 'muted': playerOptions.muted + + }, options['flashVars']), + + // Merge default parames with ones passed in + params = librevjs.obj.merge({ + 'wmode': 'opaque', // Opaque is needed to overlay controls, but can affect playback performance + 'bgcolor': '#000000' // Using bgcolor prevents a white flash when the object is loading + }, options['params']), + + // Merge default attributes with ones passed in + attributes = librevjs.obj.merge({ + 'id': objId, + 'name': objId, // Both ID and Name needed or swf to identifty itself + 'class': 'librevjs-tech' + }, options['attributes']); + + // If source was supplied pass as a flash var. + if (source) { + if (source.type && librevjs.Flash.isStreamingType(source.type)) { + var parts = librevjs.Flash.streamToParts(source.src); + flashVars['rtmpConnection'] = encodeURIComponent(parts.connection); + flashVars['rtmpStream'] = encodeURIComponent(parts.stream); + } else { + flashVars['src'] = encodeURIComponent(librevjs.getAbsoluteURL(source.src)); + } + } + + // Add placeholder to player div + librevjs.insertFirst(placeHolder, parentEl); + + // Having issues with Flash reloading on certain page actions (hide/resize/fullscreen) in certain browsers + // This allows resetting the playhead when we catch the reload + if (options['startTime']) { + this.ready(function () { + this.load(); + this.play(); + this.currentTime(options['startTime']); + }); + } + + // Flash iFrame Mode + // In web browsers there are multiple instances where changing the parent element or visibility of a plugin causes the plugin to reload. + // - Firefox just about always. https://bugzilla.mozilla.org/show_bug.cgi?id=90268 (might be fixed by version 13) + // - Webkit when hiding the plugin + // - Webkit and Firefox when using requestFullScreen on a parent element + // Loading the flash plugin into a dynamically generated iFrame gets around most of these issues. + // Issues that remain include hiding the element and requestFullScreen in Firefox specifically + + // There's on particularly annoying issue with this method which is that Firefox throws a security error on an offsite Flash object loaded into a dynamically created iFrame. + // Even though the iframe was inserted into a page on the web, Firefox + Flash considers it a local app trying to access an internet file. + // I tried mulitple ways of setting the iframe src attribute but couldn't find a src that worked well. Tried a real/fake source, in/out of domain. + // Also tried a method from stackoverflow that caused a security error in all browsers. http://stackoverflow.com/questions/2486901/how-to-set-document-domain-for-a-dynamically-generated-iframe + // In the end the solution I found to work was setting the iframe window.location.href right before doing a document.write of the Flash object. + // The only downside of this it seems to trigger another http request to the original page (no matter what's put in the href). Not sure why that is. + + // NOTE (2012-01-29): Cannot get Firefox to load the remote hosted SWF into a dynamically created iFrame + // Firefox 9 throws a security error, unleess you call location.href right before doc.write. + // Not sure why that even works, but it causes the browser to look like it's continuously trying to load the page. + // Firefox 3.6 keeps calling the iframe onload function anytime I write to it, causing an endless loop. + + if (options['iFrameMode'] === true && !librevjs.IS_FIREFOX) { + + // Create iFrame with librevjs-tech class so it's 100% width/height + var iFrm = librevjs.createEl('iframe', { + 'id': objId + '_iframe', + 'name': objId + '_iframe', + 'className': 'librevjs-tech', + 'scrolling': 'no', + 'marginWidth': 0, + 'marginHeight': 0, + 'frameBorder': 0 + }); + + // Update ready function names in flash vars for iframe window + flashVars['readyFunction'] = 'ready'; + flashVars['eventProxyFunction'] = 'events'; + flashVars['errorEventProxyFunction'] = 'errors'; + + // Tried multiple methods to get this to work in all browsers + + // Tried embedding the flash object in the page first, and then adding a place holder to the iframe, then replacing the placeholder with the page object. + // The goal here was to try to load the swf URL in the parent page first and hope that got around the firefox security error + // var newObj = librevjs.Flash.embed(options['swf'], placeHolder, flashVars, params, attributes); + // (in onload) + // var temp = librevjs.createEl('a', { id:'asdf', innerHTML: 'asdf' } ); + // iDoc.body.appendChild(temp); + + // Tried embedding the flash object through javascript in the iframe source. + // This works in webkit but still triggers the firefox security error + // iFrm.src = 'javascript: document.write('"+librevjs.Flash.getEmbedCode(options['swf'], flashVars, params, attributes)+"');"; + + // Tried an actual local iframe just to make sure that works, but it kills the easiness of the CDN version if you require the user to host an iframe + // We should add an option to host the iframe locally though, because it could help a lot of issues. + // iFrm.src = "iframe.html"; + + // Wait until iFrame has loaded to write into it. + librevjs.on(iFrm, 'load', librevjs.bind(this, function () { + + var iDoc, + iWin = iFrm.contentWindow; + + // The one working method I found was to use the iframe's document.write() to create the swf object + // This got around the security issue in all browsers except firefox. + // I did find a hack where if I call the iframe's window.location.href='', it would get around the security error + // However, the main page would look like it was loading indefinitely (URL bar loading spinner would never stop) + // Plus Firefox 3.6 didn't work no matter what I tried. + // if (librevjs.USER_AGENT.match('Firefox')) { + // iWin.location.href = ''; + // } + + // Get the iFrame's document depending on what the browser supports + iDoc = iFrm.contentDocument ? iFrm.contentDocument : iFrm.contentWindow.document; + + // Tried ensuring both document domains were the same, but they already were, so that wasn't the issue. + // Even tried adding /. that was mentioned in a browser security writeup + // document.domain = document.domain+'/.'; + // iDoc.domain = document.domain+'/.'; + + // Tried adding the object to the iframe doc's innerHTML. Security error in all browsers. + // iDoc.body.innerHTML = swfObjectHTML; + + // Tried appending the object to the iframe doc's body. Security error in all browsers. + // iDoc.body.appendChild(swfObject); + + // Using document.write actually got around the security error that browsers were throwing. + // Again, it's a dynamically generated (same domain) iframe, loading an external Flash swf. + // Not sure why that's a security issue, but apparently it is. + iDoc.write(librevjs.Flash.getEmbedCode(options['swf'], flashVars, params, attributes)); + + // Setting variables on the window needs to come after the doc write because otherwise they can get reset in some browsers + // So far no issues with swf ready event being called before it's set on the window. + iWin['player'] = this.player_; + + // Create swf ready function for iFrame window + iWin['ready'] = librevjs.bind(this.player_, function (currSwf) { + var el = iDoc.getElementById(currSwf), + player = this, + tech = player.tech; + + // Update reference to playback technology element + tech.el_ = el; + + // Make sure swf is actually ready. Sometimes the API isn't actually yet. + librevjs.Flash.checkReady(tech); + }); + + // Create event listener for all swf events + iWin['events'] = librevjs.bind(this.player_, function (swfID, eventName) { + var player = this; + if (player && player.techName === 'flash') { + player.trigger(eventName); + } + }); + + // Create error listener for all swf errors + iWin['errors'] = librevjs.bind(this.player_, function (swfID, eventName) { + librevjs.log('Flash Error', eventName); + }); + + })); + + // Replace placeholder with iFrame (it will load now) + placeHolder.parentNode.replaceChild(iFrm, placeHolder); + + // If not using iFrame mode, embed as normal object + } else { + librevjs.Flash.embed(options['swf'], placeHolder, flashVars, params, attributes); + } + } +}); + +librevjs.Flash.prototype.dispose = function () { + librevjs.MediaTechController.prototype.dispose.call(this); +}; + +librevjs.Flash.prototype.play = function () { + this.el_.librevjs_play(); +}; + +librevjs.Flash.prototype.pause = function () { + this.el_.librevjs_pause(); +}; + +librevjs.Flash.prototype.src = function (src) { + if (librevjs.Flash.isStreamingSrc(src)) { + src = librevjs.Flash.streamToParts(src); + this.setRtmpConnection(src.connection); + this.setRtmpStream(src.stream); + } else { + // Make sure source URL is abosolute. + src = librevjs.getAbsoluteURL(src); + this.el_.librevjs_src(src); + } + + // Currently the SWF doesn't autoplay if you load a source later. + // e.g. Load player w/ no source, wait 2s, set src. + if (this.player_.autoplay()) { + var tech = this; + setTimeout(function () { + tech.play(); + }, 0); + } +}; + +librevjs.Flash.prototype.currentSrc = function () { + var src = this.el_.librevjs_getProperty('currentSrc'); + // no src, check and see if RTMP + if (src == null) { + var connection = this.rtmpConnection(), + stream = this.rtmpStream(); + + if (connection && stream) { + src = librevjs.Flash.streamFromParts(connection, stream); + } + } + return src; +}; + +librevjs.Flash.prototype.load = function () { + this.el_.librevjs_load(); +}; + +librevjs.Flash.prototype.poster = function () { + this.el_.librevjs_getProperty('poster'); +}; + +librevjs.Flash.prototype.buffered = function () { + return librevjs.createTimeRange(0, this.el_.librevjs_getProperty('buffered')); +}; + +librevjs.Flash.prototype.supportsFullScreen = function () { + return false; // Flash does not allow fullscreen through javascript +}; + +librevjs.Flash.prototype.enterFullScreen = function () { + return false; +}; + + +// Create setters and getters for attributes +var api = librevjs.Flash.prototype, + readWrite = 'rtmpConnection,rtmpStream,preload,currentTime,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted'.split(','), + readOnly = 'error,currentSrc,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks'.split(','); +// Overridden: buffered + +/** + * @this {*} + */ +var createSetter = function (attr) { + var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1); + api['set' + attrUpper] = function (val) { + return this.el_.librevjs_setProperty(attr, val); + }; +}; + +/** + * @this {*} + */ +var createGetter = function (attr) { + api[attr] = function () { + return this.el_.librevjs_getProperty(attr); + }; +}; + +(function () { + var i; + // Create getter and setters for all read/write attributes + for (i = 0; i < readWrite.length; i++) { + createGetter(readWrite[i]); + createSetter(readWrite[i]); + } + + // Create getters for read-only attributes + for (i = 0; i < readOnly.length; i++) { + createGetter(readOnly[i]); + } +})(); + +/* MediaLoader REQUIRED*/ +/** + * @constructor + */ +librevjs.MediaLoader = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.Component.call(this, player, options, ready); + + // If there are no sources when the player is initialized, + // load the first supported playback technology. + if (!player.options_['sources'] || player.options_['sources'].length === 0) { + for (var i = 0, j = player.options_['techOrder']; i < j.length; i++) { + var techName = librevjs.capitalize(j[i]), + tech = window['cliplibrejs'][techName]; + + // Check if the browser supports this technology + if (tech && tech.isSupported()) { + player.loadTech(techName); + break; + } + } + } else { + // // Loop through playback technologies (HTML5, Flash) and check for support. + // // Then load the best source. + // // A few assumptions here: + // // All playback technologies respect preload false. + player.src(player.options_['sources']); + } + } +}); +/** + * @fileoverview Text Tracks + * Text tracks are tracks of timed text events. + * Captions - text displayed over the video for the hearing impared + * Subtitles - text displayed over the video for those who don't understand langauge in the video + * Chapters - text displayed in a menu allowing the user to jump to particular points (chapters) in the video + * Descriptions (not supported yet) - audio descriptions that are read back to the user by a screen reading device + */ + +// Player Additions - Functions add to the player object for easier access to tracks + +/** + * List of associated text tracks + * @type {Array} + * @private + */ +librevjs.Player.prototype.textTracks_; + +/** + * Get an array of associated text tracks. captions, subtitles, chapters, descriptions + * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks + * @return {Array} Array of track objects + */ +librevjs.Player.prototype.textTracks = function () { + this.textTracks_ = this.textTracks_ || []; + return this.textTracks_; +}; + +/** + * Add a text track + * In addition to the W3C settings we allow adding additional info through options. + * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack + * @param {String} kind Captions, subtitles, chapters, descriptions, or metadata + * @param {String=} label Optional label + * @param {String=} language Optional language + * @param {Object=} options Additional track options, like src + */ +librevjs.Player.prototype.addTextTrack = function (kind, label, language, options) { + var tracks = this.textTracks_ = this.textTracks_ || []; + options = options || {}; + + options['kind'] = kind; + options['label'] = label; + options['language'] = language; + + // HTML5 Spec says default to subtitles. + // Uppercase first letter to match class names + var Kind = librevjs.capitalize(kind || 'subtitles'); + + // Create correct texttrack class. CaptionsTrack, etc. + var track = new window['cliplibrejs'][Kind + 'Track'](this, options); + + tracks.push(track); + + // If track.dflt() is set, start showing immediately + // TODO: Add a process to deterime the best track to show for the specific kind + // Incase there are mulitple defaulted tracks of the same kind + // Or the user has a set preference of a specific language that should override the default + // if (track.dflt()) { + // this.ready(librevjs.bind(track, track.show)); + // } + + return track; +}; + +/** + * Add an array of text tracks. captions, subtitles, chapters, descriptions + * Track objects will be stored in the player.textTracks() array + * @param {Array} trackList Array of track elements or objects (fake track elements) + */ +librevjs.Player.prototype.addTextTracks = function (trackList) { + var trackObj; + + for (var i = 0; i < trackList.length; i++) { + trackObj = trackList[i]; + this.addTextTrack(trackObj['kind'], trackObj['label'], trackObj['language'], trackObj); + } + + return this; +}; + +// Show a text track +// disableSameKind: disable all other tracks of the same kind. Value should be a track kind (captions, etc.) +librevjs.Player.prototype.showTextTrack = function (id, disableSameKind) { + var tracks = this.textTracks_, + i = 0, + j = tracks.length, + track, showTrack, kind; + + // Find Track with same ID + for (; i < j; i++) { + track = tracks[i]; + if (track.id() === id) { + track.show(); + showTrack = track; + + // Disable tracks of the same kind + } else if (disableSameKind && track.kind() == disableSameKind && track.mode() > 0) { + track.disable(); + } + } + + // Get track kind from shown track or disableSameKind + kind = (showTrack) ? showTrack.kind() : ((disableSameKind) ? disableSameKind : false); + + // Trigger trackchange event, captionstrackchange, subtitlestrackchange, etc. + if (kind) { + this.trigger(kind + 'trackchange'); + } + + return this; +}; + +/** + * Track Class + * Contains track methods for loading, showing, parsing cues of tracks + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.TextTrack = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + // Apply track info to track object + // Options will often be a track element + + // Build ID if one doesn't exist + this.id_ = options['id'] || ('librevjs_' + options['kind'] + '_' + options['language'] + '_' + librevjs.guid++); + this.src_ = options['src']; + // 'default' is a reserved keyword in js so we use an abbreviated version + this.dflt_ = options['default'] || options['dflt']; + this.title_ = options['title']; + this.language_ = options['srclang']; + this.label_ = options['label']; + this.cues_ = []; + this.activeCues_ = []; + this.readyState_ = 0; + this.mode_ = 0; + + this.player_.on('fullscreenchange', librevjs.bind(this, this.adjustFontSize)); + } +}); + +/** + * Track kind value. Captions, subtitles, etc. + * @private + */ +librevjs.TextTrack.prototype.kind_; + +/** + * Get the track kind value + * @return {String} + */ +librevjs.TextTrack.prototype.kind = function () { + return this.kind_; +}; + +/** + * Track src value + * @private + */ +librevjs.TextTrack.prototype.src_; + +/** + * Get the track src value + * @return {String} + */ +librevjs.TextTrack.prototype.src = function () { + return this.src_; +}; + +/** + * Track default value + * If default is used, subtitles/captions to start showing + * @private + */ +librevjs.TextTrack.prototype.dflt_; + +/** + * Get the track default value + * 'default' is a reserved keyword + * @return {Boolean} + */ +librevjs.TextTrack.prototype.dflt = function () { + return this.dflt_; +}; + +/** + * Track title value + * @private + */ +librevjs.TextTrack.prototype.title_; + +/** + * Get the track title value + * @return {String} + */ +librevjs.TextTrack.prototype.title = function () { + return this.title_; +}; + +/** + * Language - two letter string to represent track language, e.g. 'en' for English + * Spec def: readonly attribute DOMString language; + * @private + */ +librevjs.TextTrack.prototype.language_; + +/** + * Get the track language value + * @return {String} + */ +librevjs.TextTrack.prototype.language = function () { + return this.language_; +}; + +/** + * Track label e.g. 'English' + * Spec def: readonly attribute DOMString label; + * @private + */ +librevjs.TextTrack.prototype.label_; + +/** + * Get the track label value + * @return {String} + */ +librevjs.TextTrack.prototype.label = function () { + return this.label_; +}; + +/** + * All cues of the track. Cues have a startTime, endTime, text, and other properties. + * Spec def: readonly attribute TextTrackCueList cues; + * @private + */ +librevjs.TextTrack.prototype.cues_; + +/** + * Get the track cues + * @return {Array} + */ +librevjs.TextTrack.prototype.cues = function () { + return this.cues_; +}; + +/** + * ActiveCues is all cues that are currently showing + * Spec def: readonly attribute TextTrackCueList activeCues; + * @private + */ +librevjs.TextTrack.prototype.activeCues_; + +/** + * Get the track active cues + * @return {Array} + */ +librevjs.TextTrack.prototype.activeCues = function () { + return this.activeCues_; +}; + +/** + * ReadyState describes if the text file has been loaded + * const unsigned short NONE = 0; + * const unsigned short LOADING = 1; + * const unsigned short LOADED = 2; + * const unsigned short ERROR = 3; + * readonly attribute unsigned short readyState; + * @private + */ +librevjs.TextTrack.prototype.readyState_; + +/** + * Get the track readyState + * @return {Number} + */ +librevjs.TextTrack.prototype.readyState = function () { + return this.readyState_; +}; + +/** + * Mode describes if the track is showing, hidden, or disabled + * const unsigned short OFF = 0; + * const unsigned short HIDDEN = 1; (still triggering cuechange events, but not visible) + * const unsigned short SHOWING = 2; + * attribute unsigned short mode; + * @private + */ +librevjs.TextTrack.prototype.mode_; + +/** + * Get the track mode + * @return {Number} + */ +librevjs.TextTrack.prototype.mode = function () { + return this.mode_; +}; + +/** + * Change the font size of the text track to make it larger when playing in fullscreen mode + * and restore it to its normal size when not in fullscreen mode. + */ +librevjs.TextTrack.prototype.adjustFontSize = function () { + if (this.player_.isFullScreen) { + // Scale the font by the same factor as increasing the video width to the full screen window width. + // Additionally, multiply that factor by 1.8, which is the default font size for + // the caption track (from the CSS) + this.el_.style.fontSize = screen.width / this.player_.width() * 2.5 * 100 + '%'; + } else { + // Change the font size of the text track back to its original non-fullscreen size + this.el_.style.fontSize = ''; + } +}; + +/** + * Create basic div to hold cue text + * @return {Element} + */ +librevjs.TextTrack.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-' + this.kind_ + ' librevjs-text-track' + }); +}; + +/** + * Show: Mode Showing (2) + * Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. + * The user agent is maintaining a list of which cues are active, and events are being fired accordingly. + * In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate; + * for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; + * and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue. + * The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute. + * This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences. + */ +librevjs.TextTrack.prototype.show = function () { + this.activate(); + + this.mode_ = 2; + + // Show element. + librevjs.Component.prototype.show.call(this); +}; + +/** + * Hide: Mode Hidden (1) + * Indicates that the text track is active, but that the user agent is not actively displaying the cues. + * If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. + * The user agent is maintaining a list of which cues are active, and events are being fired accordingly. + */ +librevjs.TextTrack.prototype.hide = function () { + // When hidden, cues are still triggered. Disable to stop triggering. + this.activate(); + + this.mode_ = 1; + + // Hide element. + librevjs.Component.prototype.hide.call(this); +}; + +/** + * Disable: Mode Off/Disable (0) + * Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. + * No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues. + */ +librevjs.TextTrack.prototype.disable = function () { + // If showing, hide. + if (this.mode_ == 2) { + this.hide(); + } + + // Stop triggering cues + this.deactivate(); + + // Switch Mode to Off + this.mode_ = 0; +}; + +/** + * Turn on cue tracking. Tracks that are showing OR hidden are active. + */ +librevjs.TextTrack.prototype.activate = function () { + // Load text file if it hasn't been yet. + if (this.readyState_ === 0) { + this.load(); + } + + // Only activate if not already active. + if (this.mode_ === 0) { + // Update current cue on timeupdate + // Using unique ID for bind function so other tracks don't remove listener + this.player_.on('timeupdate', librevjs.bind(this, this.update, this.id_)); + + // Reset cue time on media end + this.player_.on('ended', librevjs.bind(this, this.reset, this.id_)); + + // Add to display + if (this.kind_ === 'captions' || this.kind_ === 'subtitles') { + this.player_.getChild('textTrackDisplay').addChild(this); + } + } +}; + +/** + * Turn off cue tracking. + */ +librevjs.TextTrack.prototype.deactivate = function () { + // Using unique ID for bind function so other tracks don't remove listener + this.player_.off('timeupdate', librevjs.bind(this, this.update, this.id_)); + this.player_.off('ended', librevjs.bind(this, this.reset, this.id_)); + this.reset(); // Reset + + // Remove from display + this.player_.getChild('textTrackDisplay').removeChild(this); +}; + +// A readiness state +// One of the following: +// +// Not loaded +// Indicates that the text track is known to exist (e.g. it has been declared with a track element), but its cues have not been obtained. +// +// Loading +// Indicates that the text track is loading and there have been no fatal errors encountered so far. Further cues might still be added to the track. +// +// Loaded +// Indicates that the text track has been loaded with no fatal errors. No new cues will be added to the track except if the text track corresponds to a MutableTextTrack object. +// +// Failed to load +// Indicates that the text track was enabled, but when the user agent attempted to obtain it, this failed in some way (e.g. URL could not be resolved, network error, unknown text track format). Some or all of the cues are likely missing and will not be obtained. +librevjs.TextTrack.prototype.load = function () { + + // Only load if not loaded yet. + if (this.readyState_ === 0) { + this.readyState_ = 1; + librevjs.get(this.src_, librevjs.bind(this, this.parseCues), librevjs.bind(this, this.onError)); + } + +}; + +librevjs.TextTrack.prototype.onError = function (err) { + this.error = err; + this.readyState_ = 3; + this.trigger('error'); +}; + +// Parse the WebVTT text format for cue times. +// TODO: Separate parser into own class so alternative timed text formats can be used. (TTML, DFXP) +librevjs.TextTrack.prototype.parseCues = function (srcContent) { + var cue, time, text, + lines = srcContent.split('\n'), + line = '', + id; + + for (var i = 1, j = lines.length; i < j; i++) { + // Line 0 should be 'WEBVTT', so skipping i=0 + + line = librevjs.trim(lines[i]); // Trim whitespace and linebreaks + + if (line) { // Loop until a line with content + + // First line could be an optional cue ID + // Check if line has the time separator + if (line.indexOf('-->') == -1) { + id = line; + // Advance to next line for timing. + line = librevjs.trim(lines[++i]); + } else { + id = this.cues_.length; + } + + // First line - Number + cue = { + id: id, // Cue Number + index: this.cues_.length // Position in Array + }; + + // Timing line + time = line.split(' --> '); + cue.startTime = this.parseCueTime(time[0]); + cue.endTime = this.parseCueTime(time[1]); + + // Additional lines - Cue Text + text = []; + + // Loop until a blank line or end of lines + // Assumeing trim('') returns false for blank lines + while (lines[++i] && (line = librevjs.trim(lines[i]))) { + text.push(line); + } + + cue.text = text.join('<br/>'); + + // Add this cue + this.cues_.push(cue); + } + } + + this.readyState_ = 2; + this.trigger('loaded'); +}; + + +librevjs.TextTrack.prototype.parseCueTime = function (timeText) { + var parts = timeText.split(':'), + time = 0, + hours, minutes, other, seconds, ms; + + // Check if optional hours place is included + // 00:00:00.000 vs. 00:00.000 + if (parts.length == 3) { + hours = parts[0]; + minutes = parts[1]; + other = parts[2]; + } else { + hours = 0; + minutes = parts[0]; + other = parts[1]; + } + + // Break other (seconds, milliseconds, and flags) by spaces + // TODO: Make additional cue layout settings work with flags + other = other.split(/\s+/); + // Remove seconds. Seconds is the first part before any spaces. + seconds = other.splice(0, 1)[0]; + // Could use either . or , for decimal + seconds = seconds.split(/\.|,/); + // Get milliseconds + ms = parseFloat(seconds[1]); + seconds = seconds[0]; + + // hours => seconds + time += parseFloat(hours) * 3600; + // minutes => seconds + time += parseFloat(minutes) * 60; + // Add seconds + time += parseFloat(seconds); + // Add milliseconds + if (ms) { + time += ms / 1000; + } + + return time; +}; + +// Update active cues whenever timeupdate events are triggered on the player. +librevjs.TextTrack.prototype.update = function () { + if (this.cues_.length > 0) { + + // Get curent player time + var time = this.player_.currentTime(); + + // Check if the new time is outside the time box created by the the last update. + if (this.prevChange === undefined || time < this.prevChange || this.nextChange <= time) { + var cues = this.cues_, + + // Create a new time box for this state. + newNextChange = this.player_.duration(), // Start at beginning of the timeline + newPrevChange = 0, // Start at end + + reverse = false, // Set the direction of the loop through the cues. Optimized the cue check. + newCues = [], // Store new active cues. + + // Store where in the loop the current active cues are, to provide a smart starting point for the next loop. + firstActiveIndex, lastActiveIndex, + cue, i; // Loop vars + + // Check if time is going forwards or backwards (scrubbing/rewinding) + // If we know the direction we can optimize the starting position and direction of the loop through the cues array. + if (time >= this.nextChange || this.nextChange === undefined) { // NextChange should happen + // Forwards, so start at the index of the first active cue and loop forward + i = (this.firstActiveIndex !== undefined) ? this.firstActiveIndex : 0; + } else { + // Backwards, so start at the index of the last active cue and loop backward + reverse = true; + i = (this.lastActiveIndex !== undefined) ? this.lastActiveIndex : cues.length - 1; + } + + while (true) { // Loop until broken + cue = cues[i]; + + // Cue ended at this point + if (cue.endTime <= time) { + newPrevChange = Math.max(newPrevChange, cue.endTime); + + if (cue.active) { + cue.active = false; + } + + // No earlier cues should have an active start time. + // Nevermind. Assume first cue could have a duration the same as the video. + // In that case we need to loop all the way back to the beginning. + // if (reverse && cue.startTime) { break; } + + // Cue hasn't started + } else if (time < cue.startTime) { + newNextChange = Math.min(newNextChange, cue.startTime); + + if (cue.active) { + cue.active = false; + } + + // No later cues should have an active start time. + if (!reverse) { + break; + } + + // Cue is current + } else { + + if (reverse) { + // Add cue to front of array to keep in time order + newCues.splice(0, 0, cue); + + // If in reverse, the first current cue is our lastActiveCue + if (lastActiveIndex === undefined) { + lastActiveIndex = i; + } + firstActiveIndex = i; + } else { + // Add cue to end of array + newCues.push(cue); + + // If forward, the first current cue is our firstActiveIndex + if (firstActiveIndex === undefined) { + firstActiveIndex = i; + } + lastActiveIndex = i; + } + + newNextChange = Math.min(newNextChange, cue.endTime); + newPrevChange = Math.max(newPrevChange, cue.startTime); + + cue.active = true; + } + + if (reverse) { + // Reverse down the array of cues, break if at first + if (i === 0) { + break; + } else { + i--; + } + } else { + // Walk up the array fo cues, break if at last + if (i === cues.length - 1) { + break; + } else { + i++; + } + } + + } + + this.activeCues_ = newCues; + this.nextChange = newNextChange; + this.prevChange = newPrevChange; + this.firstActiveIndex = firstActiveIndex; + this.lastActiveIndex = lastActiveIndex; + + this.updateDisplay(); + + this.trigger('cuechange'); + } + } +}; + +// Add cue HTML to display +librevjs.TextTrack.prototype.updateDisplay = function () { + var cues = this.activeCues_, + html = '', + i = 0, + j = cues.length; + + for (; i < j; i++) { + html += '<span class="librevjs-tt-cue">' + cues[i].text + '</span>'; + } + + this.el_.innerHTML = html; +}; + +// Set all loop helper values back +librevjs.TextTrack.prototype.reset = function () { + this.nextChange = 0; + this.prevChange = this.player_.duration(); + this.firstActiveIndex = 0; + this.lastActiveIndex = 0; +}; + +// Create specific track types +/** + * @constructor + */ +librevjs.CaptionsTrack = librevjs.TextTrack.extend(); +librevjs.CaptionsTrack.prototype.kind_ = 'captions'; +// Exporting here because Track creation requires the track kind +// to be available on global object. e.g. new window['cliplibrejs'][Kind + 'Track'] + +/** + * @constructor + */ +librevjs.SubtitlesTrack = librevjs.TextTrack.extend(); +librevjs.SubtitlesTrack.prototype.kind_ = 'subtitles'; + +/** + * @constructor + */ +librevjs.ChaptersTrack = librevjs.TextTrack.extend(); +librevjs.ChaptersTrack.prototype.kind_ = 'chapters'; + + +/* Text Track Display +============================================================================= */ +// Global container for both subtitle and captions text. Simple div container. + +/** + * @constructor + */ +librevjs.TextTrackDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.Component.call(this, player, options, ready); + + // This used to be called during player init, but was causing an error + // if a track should show by default and the display hadn't loaded yet. + // Should probably be moved to an external track loader when we support + // tracks that don't need a display. + if (player.options_['tracks'] && player.options_['tracks'].length > 0) { + this.player_.addTextTracks(player.options_['tracks']); + } + } +}); + +librevjs.TextTrackDisplay.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-text-track-display' + }); +}; + + +/* Text Track Menu Items +============================================================================= */ +/** + * @constructor + */ +librevjs.TextTrackMenuItem = librevjs.MenuItem.extend({ + /** @constructor */ + init: function (player, options) { + var track = this.track = options['track']; + + // Modify options for parent MenuItem class's init. + options['label'] = track.label(); + options['selected'] = track.dflt(); + librevjs.MenuItem.call(this, player, options); + + this.player_.on(track.kind() + 'trackchange', librevjs.bind(this, this.update)); + /** + * @author Jesús Eduardo + * my modification: + */ + if (track.dflt()) { + this.player_.showTextTrack(this.track.id_, this.track.kind()); + } + } +}); + +librevjs.TextTrackMenuItem.prototype.onClick = function () { + librevjs.MenuItem.prototype.onClick.call(this); + this.player_.showTextTrack(this.track.id_, this.track.kind()); +}; + +librevjs.TextTrackMenuItem.prototype.update = function () { + this.selected(this.track.mode() == 2); +}; + +/** + * @constructor + */ +librevjs.OffTextTrackMenuItem = librevjs.TextTrackMenuItem.extend({ + /** @constructor */ + init: function (player, options) { + // Create pseudo track info + // Requires options['kind'] + options['track'] = { + kind: function () { + return options['kind']; + }, + player: player, + label: function () { + return options['kind'] + ' off'; + }, + dflt: function () { + return false; + }, + mode: function () { + return false; + } + }; + librevjs.TextTrackMenuItem.call(this, player, options); + this.selected(true); + } +}); + +librevjs.OffTextTrackMenuItem.prototype.onClick = function () { + librevjs.TextTrackMenuItem.prototype.onClick.call(this); + this.player_.showTextTrack(this.track.id_, this.track.kind()); +}; + +librevjs.OffTextTrackMenuItem.prototype.update = function () { + var tracks = this.player_.textTracks(), + i = 0, + j = tracks.length, + track, + off = true; + + for (; i < j; i++) { + track = tracks[i]; + if (track.kind() == this.track.kind() && track.mode() == 2) { + off = false; + } + } + + this.selected(off); +}; + +/* Captions Button +================================================================================ */ +/** + * @constructor + */ +librevjs.TextTrackButton = librevjs.MenuButton.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.MenuButton.call(this, player, options); + + if (this.items.length <= 1) { + this.hide(); + } + } +}); + +// librevjs.TextTrackButton.prototype.buttonPressed = false; + +// librevjs.TextTrackButton.prototype.createMenu = function(){ +// var menu = new librevjs.Menu(this.player_); + +// // Add a title list item to the top +// // menu.el().appendChild(librevjs.createEl('li', { +// // className: 'librevjs-menu-title', +// // innerHTML: librevjs.capitalize(this.kind_), +// // tabindex: -1 +// // })); + +// this.items = this.createItems(); + +// // Add menu items to the menu +// for (var i = 0; i < this.items.length; i++) { +// menu.addItem(this.items[i]); +// } + +// // Add list to element +// this.addChild(menu); + +// return menu; +// }; + +// Create a menu item for each text track +librevjs.TextTrackButton.prototype.createItems = function () { + var items = [], + track; + + // Add an OFF menu item to turn all tracks off + items.push(new librevjs.OffTextTrackMenuItem(this.player_, { + 'kind': this.kind_ + })); + + for (var i = 0; i < this.player_.textTracks().length; i++) { + track = this.player_.textTracks()[i]; + if (track.kind() === this.kind_) { + items.push(new librevjs.TextTrackMenuItem(this.player_, { + 'track': track + })); + } + } + + return items; +}; + +/** + * @constructor + */ +librevjs.CaptionsButton = librevjs.TextTrackButton.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.TextTrackButton.call(this, player, options, ready); + this.el_.setAttribute('aria-label', 'Captions Menu'); + } +}); +librevjs.CaptionsButton.prototype.kind_ = 'captions'; +librevjs.CaptionsButton.prototype.buttonText = 'Captions'; +librevjs.CaptionsButton.prototype.className = 'librevjs-captions-button'; + +/** + * @constructor + */ +librevjs.SubtitlesButton = librevjs.TextTrackButton.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.TextTrackButton.call(this, player, options, ready); + this.el_.setAttribute('aria-label', 'Subtitles Menu'); + } +}); +librevjs.SubtitlesButton.prototype.kind_ = 'subtitles'; +librevjs.SubtitlesButton.prototype.buttonText = 'Subtitles'; +librevjs.SubtitlesButton.prototype.className = 'librevjs-subtitles-button'; + +// Chapters act much differently than other text tracks +// Cues are navigation vs. other tracks of alternative languages +/** + * @constructor + */ +librevjs.ChaptersButton = librevjs.TextTrackButton.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.TextTrackButton.call(this, player, options, ready); + this.el_.setAttribute('aria-label', 'Chapters Menu'); + } +}); +librevjs.ChaptersButton.prototype.kind_ = 'chapters'; +librevjs.ChaptersButton.prototype.buttonText = 'Chapters'; +librevjs.ChaptersButton.prototype.className = 'librevjs-chapters-button'; + +// Create a menu item for each text track +librevjs.ChaptersButton.prototype.createItems = function () { + var items = [], + track; + + for (var i = 0; i < this.player_.textTracks().length; i++) { + track = this.player_.textTracks()[i]; + if (track.kind() === this.kind_) { + items.push(new librevjs.TextTrackMenuItem(this.player_, { + 'track': track + })); + } + } + + return items; +}; + +librevjs.ChaptersButton.prototype.createMenu = function () { + var tracks = this.player_.textTracks(), + i = 0, + j = tracks.length, + track, chaptersTrack, + items = this.items = []; + + for (; i < j; i++) { + track = tracks[i]; + if (track.kind() == this.kind_ && track.dflt()) { + if (track.readyState() < 2) { + this.chaptersTrack = track; + track.on('loaded', librevjs.bind(this, this.createMenu)); + return; + } else { + chaptersTrack = track; + break; + } + } + } + + var menu = this.menu = new librevjs.Menu(this.player_); + + menu.el_.appendChild(librevjs.createEl('li', { + className: 'librevjs-menu-title', + innerHTML: librevjs.capitalize(this.kind_), + tabindex: -1 + })); + + if (chaptersTrack) { + var cues = chaptersTrack.cues_, + cue, mi; + i = 0; + j = cues.length; + + for (; i < j; i++) { + cue = cues[i]; + + mi = new librevjs.ChaptersTrackMenuItem(this.player_, { + 'track': chaptersTrack, + 'cue': cue + }); + + items.push(mi); + + menu.addChild(mi); + } + } + + if (this.items.length > 0) { + this.show(); + } + + return menu; +}; + + +/** + * @constructor + */ +librevjs.ChaptersTrackMenuItem = librevjs.MenuItem.extend({ + /** @constructor */ + init: function (player, options) { + var track = this.track = options['track'], + cue = this.cue = options['cue'], + currentTime = player.currentTime(); + + // Modify options for parent MenuItem class's init. + options['label'] = cue.text; + options['selected'] = (cue.startTime <= currentTime && currentTime < cue.endTime); + librevjs.MenuItem.call(this, player, options); + + track.on('cuechange', librevjs.bind(this, this.update)); + } +}); + +librevjs.ChaptersTrackMenuItem.prototype.onClick = function () { + librevjs.MenuItem.prototype.onClick.call(this); + this.player_.currentTime(this.cue.startTime); + this.update(this.cue.startTime); +}; + +librevjs.ChaptersTrackMenuItem.prototype.update = function () { + var cue = this.cue, + currentTime = this.player_.currentTime(); + + // librevjs.log(currentTime, cue.startTime); + this.selected(cue.startTime <= currentTime && currentTime < cue.endTime); +}; + +// Add Buttons to controlBar +librevjs.obj.merge(librevjs.ControlBar.prototype.options_['children'], { + 'subtitlesButton': {}, + 'captionsButton': {}, + 'chaptersButton': {} +}); + +// librevjs.Cue = librevjs.Component.extend({ +// /** @constructor */ +// init: function(player, options){ +// librevjs.Component.call(this, player, options); +// } +// }); +/** + * @fileoverview Add JSON support + * @suppress {undefinedVars} + * (Compiler doesn't like JSON not being declared) + */ + +/** + * Javascript JSON implementation + * (Parse Method Only) + * https://github.com/douglascrockford/JSON-js/blob/master/json2.js + * Only using for parse method when parsing data-setup attribute JSON. + * @type {Object} + * @suppress {undefinedVars} + */ +librevjs.JSON; + +/** + * @suppress {undefinedVars} + */ +if (typeof window.JSON !== 'undefined' && window.JSON.parse === 'function') { + librevjs.JSON = window.JSON; + +} else { + librevjs.JSON = {}; + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + + librevjs.JSON.parse = function (text, reviver) { + var j; + + function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + + if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + + j = eval('(' + text + ')'); + + return typeof reviver === 'function' ? walk({ + '': j + }, '') : j; + } + + throw new SyntaxError('JSON.parse(): invalid or malformed JSON data'); + }; +} +/** + * @fileoverview Functions for automatically setting up a player + * based on the data-setup attribute of the video tag + */ + +// Automatically set up any tags that have a data-setup attribute +librevjs.autoSetup = function () { + var options, vid, player, + vids = document.getElementsByTagName('video'); + + // Check if any media elements exist + if (vids && vids.length > 0) { + + for (var i = 0, j = vids.length; i < j; i++) { + vid = vids[i]; + + // Check if element exists, has getAttribute func. + // IE seems to consider typeof el.getAttribute == 'object' instead of 'function' like expected, at least when loading the player immediately. + if (vid && vid.getAttribute) { + + // Make sure this player hasn't already been set up. + if (vid['player'] === undefined) { + options = vid.getAttribute('data-setup'); + + // Check if data-setup attr exists. + // We only auto-setup if they've added the data-setup attr. + if (options !== null) { + + // Parse options JSON + // If empty string, make it a parsable json object. + options = librevjs.JSON.parse(options || '{}'); + + // Create new video.js instance. + player = cliplibrejs(vid, options); + } + } + + // If getAttribute isn't defined, we need to wait for the DOM. + } else { + librevjs.autoSetupTimeout(1); + break; + } + } + + // No videos were found, so keep looping unless page is finisehd loading. + } else if (!librevjs.windowLoaded) { + librevjs.autoSetupTimeout(1); + } +}; + +// Pause to let the DOM keep processing +librevjs.autoSetupTimeout = function (wait) { + setTimeout(librevjs.autoSetup, wait); +}; + +if (document.readyState === 'complete') { + librevjs.windowLoaded = true; +} else { + librevjs.one(window, 'load', function () { + librevjs.windowLoaded = true; + }); +} + +// Run Auto-load players +// You have to wait at least once in case this script is loaded after your video in the DOM (weird behavior only with minified version) +librevjs.autoSetupTimeout(1); +librevjs.plugin = function (name, init) { + librevjs.Player.prototype[name] = init; +}; +/* Selector Quality +@base: https://github.com/dominic-p/videojs-resolution-selector +================================================================================ */ +(function (_V_) { + /*********************************************************************************** + * Define some helper functions + ***********************************************************************************/ + var methods = { + /** + * Utility function for merging 2 objects recursively. It treats + * arrays like plain objects and it relies on a for...in loop which will + * break if the Object prototype is messed with. + * + * @param (object) destination The object to modify and return + * @param (object) source The object to use to overwrite the first + * object + * + * @returns (object) The modified first object is returned + */ + extend: function (destination, source) { + for (var prop in source) { + // Sanity check + if (!source.hasOwnProperty(prop)) { + continue; + } + + // Enable recursive (deep) object extension + if (typeof source[prop] == 'object' && null !== source[prop]) { + destination[prop] = methods.extend(destination[prop] || {}, source[prop]); + } else { + destination[prop] = source[prop]; + } + } + return destination; + }, + + /** + * In a future version, this can be made more intelligent, + * but for now, we'll just add a "p" at the end if we are passed + * numbers. + * + * @param (string) res The resolution to make a label for + * + * @returns (string) The label text string + */ + res_label: function (res) { + return (/^\d+$/.test(res)) ? res + 'p' : res; + }, + matchResolution: function (resStack, res) {}, + + /** + * returns a dummy object that implements the basic get/set + * functionality of the Cookies library. Used in the case where + * the Cookies library is not present + */ + buildCookiesDummy: function () { + return { + get: function (key) { + return ""; + }, + set: function (key, val) { + return false; + } + }; + } + }; + + /*********************************************************************************** + * Setup our resolution menu items + ***********************************************************************************/ + _V_.ResolutionMenuItem = _V_.MenuItem.extend({ + + /** @constructor */ + init: function (player, options) { + + // Modify options for parent MenuItem class's init. + options.label = methods.res_label(options.res); + options.selected = (options.res.toString() === player.getCurrentRes().toString()); + + // Call the parent constructor + _V_.MenuItem.call(this, player, options); + + // Store the resolution as a call property + this.resolution = options.res; + + // Register our click handler + this.on('click', this.onClick); + + // Toggle the selected class whenever the resolution changes + player.on('changeRes', _V_.bind(this, function () { + if (this.resolution == player.getCurrentRes()) { + this.selected(true); + } else { + this.selected(false); + } + })); + } + }); + + // Handle clicks on the menu items + _V_.ResolutionMenuItem.prototype.onClick = function () { + var player = this.player(), + video_el = player.el().firstChild, + current_time = player.currentTime(), + is_paused = player.paused(), + button_nodes = player.controlBar.resolutionSelector.el().firstChild.children, + button_node_count = button_nodes.length; + + // Do nothing if we aren't changing resolutions + if (player.getCurrentRes() == this.resolution) { + return; + } + + // Make sure the loadedmetadata event will fire + if ('none' == video_el.preload) { + video_el.preload = 'metadata'; + } + + // Change the source and make sure we don't start the video over + player.src(player.availableRes[this.resolution]).one('loadedmetadata', function () { + player.currentTime(current_time); + if (!is_paused) { + player.play(); + } + }); + + // Save the newly selected resolution in our player options property + player.currentRes = this.resolution; + + // Update the button text + while (button_node_count > 0) { + button_node_count--; + if ('librevjs-current-res' == button_nodes[button_node_count].className) { + button_nodes[button_node_count].innerHTML = methods.res_label(this.resolution); + break; + } + } + + // Update the classes to reflect the currently selected resolution + player.trigger('changeRes'); + }; + + /*********************************************************************************** + * Setup our resolution menu title item + ***********************************************************************************/ + _V_.ResolutionTitleMenuItem = _V_.MenuItem.extend({ + + init: function (player, options) { + + // Call the parent constructor + _V_.MenuItem.call(this, player, options); + + // No click handler for the menu title + this.off('click'); + } + }); + + /*********************************************************************************** + * Define our resolution selector button + ***********************************************************************************/ + _V_.ResolutionSelector = _V_.MenuButton.extend({ + + /** @constructor */ + init: function (player, options) { + + // Add our list of available resolutions to the player object + player.availableRes = options.available_res; + + // Call the parent constructor + _V_.MenuButton.call(this, player, options); + } + }); + + // Create a menu item for each available resolution + _V_.ResolutionSelector.prototype.createItems = function () { + + var player = this.player(), + items = [], + current_res; + + // Add the menu title item + items.push(new _V_.ResolutionTitleMenuItem(player, { + el: _V_.Component.prototype.createEl('li', { + className: 'librevjs-menu-title librevjs-res-menu-title', + innerHTML: 'Calidad' + }) + })); + + // Add an item for each available resolution + for (current_res in player.availableRes) { + // Don't add an item for the length attribute + if ('length' == current_res) { + continue; + } + items.push(new _V_.ResolutionMenuItem(player, { + res: current_res + })); + } + + // Sort the available resolutions in descending order + items.sort(function (a, b) { + if (typeof a.resolution == 'undefined') { + return -1; + } else { + return parseInt(b.resolution) - parseInt(a.resolution); + } + }); + return items; + }; + + /*********************************************************************************** + * Register the plugin with cliplibrejs, main plugin function + ***********************************************************************************/ + _V_.plugin('resolutionSelector', function (options) { + + // Only enable the plugin on HTML5 videos + if (!this.el().firstChild.canPlayType) { + return; + } + + var player = this, + sources = player.options().sources, + i = sources.length, + j, + found_type, + + // Override default options with those provided + settings = methods.extend({ + + default_res: '', // (string) The resolution that should be selected by default ( '480' or '480,1080,240' ) + force_types: false // (array) List of media types. If passed, we need to have source for each type in each resolution or that resolution will not be an option + + }, options || {}), + + available_res = { + length: 0 + }, + current_res, + resolutionSelector, + + // Split default resolutions if set and valid, otherwise default to an empty array + default_resolutions = (settings.default_res && typeof settings.default_res == 'string') ? settings.default_res.split(',') : [], + cookieNamespace = 'cliplibrejs.resolutionSelector', + resCookieName = cookieNamespace + '.res', + cookieRef = (typeof (Cookies) === "function") ? Cookies : methods.buildCookiesDummy(); + + // Get all of the available resoloutions + while (i > 0) { + + i--; + + // Skip sources that don't have data-res attributes + if (!sources[i]['data-res']) { + continue; + } + current_res = sources[i]['data-res']; + if (typeof available_res[current_res] !== 'object') { + available_res[current_res] = []; + available_res.length++; + } + available_res[current_res].push(sources[i]); + } + + // Check for forced types + if (settings.force_types) { + // Loop through all available resoultions + for (current_res in available_res) { + // Don't count the length property as a resolution + if ('length' == current_res) { + continue; + } + i = settings.force_types.length; + // For each resolution loop through the required types + while (i > 0) { + + i--; + + j = available_res[current_res].length; + found_types = 0; + + // For each required type loop through the available sources to check if its there + while (j > 0) { + + j--; + + if (settings.force_types[i] === available_res[current_res][j].type) { + found_types++; + } + } // End loop through current resolution sources + + if (found_types < settings.force_types.length) { + delete available_res[current_res]; + available_res.length--; + break; + } + } // End loop through required types + } // End loop through resolutions + } + + // Make sure we have at least 2 available resolutions before we add the button + if (available_res.length < 2) { + return; + } + + var resCookie = cookieRef.get(resCookieName) + if (resCookie) { + // rebuild the default_resolutions stack with the cookie's resolution on top + default_resolutions = [resCookie].concat(default_resolutions); + } + + // Loop through the choosen default resolutions if there were any + for (i = 0; i < default_resolutions.length; i++) { + // Set the video to start out with the first available default res + if (available_res[default_resolutions[i]]) { + player.src(available_res[default_resolutions[i]]); + player.currentRes = default_resolutions[i]; + break; + } + } + + // Helper function to get the current resolution + player.getCurrentRes = function () { + if (typeof player.currentRes !== 'undefined') { + return player.currentRes; + } else { + try { + return res = player.options().sources[0]['data-res']; + } catch (e) { + return ''; + } + } + }; + + // Get the started resolution + current_res = player.getCurrentRes(); + + if (current_res) { + current_res = methods.res_label(current_res); + } + + // Add the resolution selector button + resolutionSelector = new _V_.ResolutionSelector(player, { + el: _V_.Component.prototype.createEl(null, { + className: 'librevjs-res-button librevjs-menu-button librevjs-control', + innerHTML: '<div class="librevjs-control-content"><span class="librevjs-current-res">' + (current_res || 'Quality') + '</span></div>', + role: 'button', + 'aria-live': 'polite', // let the screen reader user know that the text of the button may change + tabIndex: 0 + }), + available_res: available_res + }); + + // Attach an event to remember previous res selection via cookie + this.on('changeRes', function () { + cookieRef.set(resCookieName, player.getCurrentRes()); + }); + + // Attach an event to update player.src once on loadedmetadata + // if a resolution was previously set + this.one('loadedmetadata', function () { + var resCookie = cookieRef.get(resCookieName); + + if (resCookie) { + player.src(player.availableRes[resCookie]); + player.currentRes = resCookie; + player.trigger('changeRes'); + } + }); + + // Add the button to the control bar object and the DOM + player.controlBar.resolutionSelector = player.controlBar.addChild(resolutionSelector); + }); +})(cliplibrejs); + +/* Hotkeys for LibreVideoJS +@base: https://github.com/ctd1500/videojs-hotkeys +================================================================================ */ +! function (e, t) { + "use strict"; + e.cliplibrejs_hotkeys = { + version: "0.2.5" //correction FullScreen + }; + var r = function (e) { + var t = this, + r = { + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }; + e = e || {}; + var l = e.volumeStep || r.volumeStep, + n = e.seekStep || r.seekStep, + u = e.enableMute || r.enableMute, + a = e.enableFullscreen || r.enableFullscreen, + s = e.enableNumbers || r.enableNumbers; + t.el().hasAttribute("tabIndex") || t.el().setAttribute("tabIndex", "-1"), t.on("play", function () { + var e = t.el().querySelector(".iframeblocker"); + e && "" == e.style.display && (e.style.display = "block", e.style.bottom = "39px") + }); + var c = function (e) { + var r = e.which; + if (t.controls()) { + { + document.activeElement + } + switch (r) { + // Spacebar toggles play/pause + case 32: + e.preventDefault(), t.paused() ? t.play() : t.pause(); + break; + // Seeking with the left/right arrow keys + case 37: + // Left Arrow + e.preventDefault(); + var c = t.currentTime() - n; + t.currentTime() <= n && (c = 0), t.currentTime(c); + break; + case 39: + // Right Arrow + e.preventDefault(), t.currentTime(t.currentTime() + n); + break; + // Volume control with the up/down arrow keys + case 40: + // Down Arrow + e.preventDefault(), t.volume(t.volume() - l); + break; + case 38: + // Up Arrow + e.preventDefault(), t.volume(t.volume() + l); + break; + // Toggle Mute with the M key + case 77: + u && t.muted(t.muted() ? !1 : !0); + break; + // Toggle Fullscreen with the F key + case 70: + a && (t.isFullScreen ? t.player_.cancelFullScreen() : t.player_.requestFullScreen()); + break; + default: + // Number keys from 0-9 skip to a percentage of the video. 0 is 0% and 9 is 90% + if ((r > 47 && 59 > r || r > 95 && 106 > r) && s) { + var i = 48; + r > 95 && (i = 96); + var o = r - i; + e.preventDefault(), t.currentTime(t.duration() * o * .1) + } + } + } + }, i = function () { + t.controls() && a && (t.isFullScreen ? t.player_.cancelFullScreen() : t.player_.requestFullScreen()) + }; + return t.on("keydown", c), t.on("dblclick", i), this + }; + t.plugin("hotkeys", r) +}(window, window.cliplibrejs); diff --git a/js/cliplibrejs.developer.js b/js/cliplibrejs.developer.js new file mode 100644 index 0000000..42deaf0 --- /dev/null +++ b/js/cliplibrejs.developer.js @@ -0,0 +1,6979 @@ +/*! + * @base: https://github.com/videojs/video.js + * + * @Source: cliplibrejs.dev.js + * + * @licstart The following is the entire license notice for the + * JavaScript code in this page. + * + * Copyleft 2017 Jesus Eduardo + * + * The JavaScript code in this page is free software: you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License (GNU GPL) as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) + * any later version. The code is distributed WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + * + * As additional permission under GNU GPL version 3 section 7, you + * may distribute non-source (e.g., minimized or compacted) forms of + * that code without the copy of the GNU GPL normally required by + * section 4, provided you include this license notice and a URL + * through which recipients can access the Corresponding Source. + * + * @licend The above is the entire license notice + * for the JavaScript code in this page. + * + */ +/** + * @fileoverview Main function src. + */ +// HTML5 Shiv. Must be in <head> to support older browsers. +document.createElement('video'); +document.createElement('audio'); +document.createElement('track'); + +/** + * Doubles as the main function for users to create a player instance and also + * the main library object. + * + * @param {String|Element} id Video element or video element ID + * @param {Object=} options Optional options object for config/settings + * @param {Function=} ready Optional ready callback + * @return {librevjs.Player} A player instance + * @namespace + */ +var librevjs = function (id, options, ready) { + var tag; // Element of ID + + // Allow for element or ID to be passed in + // String ID + if (typeof id === 'string') { + + // Adjust for jQuery ID syntax + if (id.indexOf('#') === 0) { + id = id.slice(1); + } + + // If a player instance has already been created for this ID return it. + if (librevjs.players[id]) { + // If options or ready funtion are passed, warn + return librevjs.players[id]; + + // Otherwise get element for ID + } else { + tag = librevjs.el(id); + } + + // ID is a media element + } else { + tag = id; + } + + // Check for a useable element + if (!tag || !tag.nodeName) { // re: nodeName, could be a box div also + throw new TypeError('The element or ID supplied is not valid. (cliplibrejs)'); // Returns + } + + // Element may have a player attr referring to an already created player instance. + // If not, set up a new player and return the instance. + return tag['player'] || new librevjs.Player(tag, options, ready); +}; + +// Extended name, also available externally, window.cliplibrejs +var cliplibrejs = window['cliplibrejs'] = librevjs; + +// CDN Version. Used to target right flash swf. +librevjs.CDN_VERSION = '2.1'; +librevjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://'); + +/** + * Global Player instance options, surfaced from librevjs.Player.prototype.options_ + * librevjs.options = librevjs.Player.prototype.options_ + * All options should use string keys so they avoid + * renaming by closure compiler + * @type {Object} + */ +librevjs.options = { + // Default order of fallback technology + 'techOrder': ['html5', 'flash'], + // techOrder: ['flash','html5'], + + 'html5': {}, + 'flash': {}, + + // Default of web browser is 300x150. Should rely on source width/height. + 'width': 300, + 'height': 150, + // defaultVolume: 0.85, + 'defaultVolume': 0.00, // The freakin seaguls are driving me crazy! + + // Included control sets + 'children': { + 'mediaLoader': {}, + 'posterImage': {}, + 'textTrackDisplay': {}, + 'loadingSpinner': {}, + 'bigPlayButton': {}, + 'controlBar': {} + }, + + // Default message to show when a video cannot be played. + 'notSupportedMessage': 'No compatible source was found for this video.' +}; + +/** + * Global player list + * @type {Object} + */ +librevjs.players = {}; +/** + * Core Object/Class for objects that use inheritance + constructors + * @constructor + */ +librevjs.CoreObject = librevjs['CoreObject'] = function () {}; +// Manually exporting librevjs['CoreObject'] here for Closure Compiler +// because of the use of the extend/create class methods +// If we didn't do this, those functions would get flattend to something like +// `a = ...` and `this.prototype` would refer to the global object instead of +// CoreObject + +/** + * Create a new object that inherits from this Object + * @param {Object} props Functions and properties to be applied to the + * new object's prototype + * @return {librevjs.CoreObject} Returns an object that inherits from CoreObject + * @this {*} + */ +librevjs.CoreObject.extend = function (props) { + var init, subObj; + + props = props || {}; + // Set up the constructor using the supplied init method + // or using the init of the parent object + // Make sure to check the unobfuscated version for external libs + init = props['init'] || props.init || this.prototype['init'] || this.prototype.init || function () {}; + // In Resig's simple class inheritance (previously used) the constructor + // is a function that calls `this.init.apply(arguments)` + // However that would prevent us from using `ParentObject.call(this);` + // in a Child constuctor because the `this` in `this.init` + // would still refer to the Child and cause an inifinite loop. + // We would instead have to do + // `ParentObject.prototype.init.apply(this, argumnents);` + // Bleh. We're not creating a _super() function, so it's good to keep + // the parent constructor reference simple. + subObj = function () { + init.apply(this, arguments); + }; + + // Inherit from this object's prototype + subObj.prototype = librevjs.obj.create(this.prototype); + // Reset the constructor property for subObj otherwise + // instances of subObj would have the constructor of the parent Object + subObj.prototype.constructor = subObj; + + // Make the class extendable + subObj.extend = librevjs.CoreObject.extend; + // Make a function for creating instances + subObj.create = librevjs.CoreObject.create; + + // Extend subObj's prototype with functions and other properties from props + for (var name in props) { + if (props.hasOwnProperty(name)) { + subObj.prototype[name] = props[name]; + } + } + + return subObj; +}; + +/** + * Create a new instace of this Object class + * @return {librevjs.CoreObject} Returns an instance of a CoreObject subclass + * @this {*} + */ +librevjs.CoreObject.create = function () { + // Create a new object that inherits from this object's prototype + var inst = librevjs.obj.create(this.prototype); + + // Apply this constructor function to the new object + this.apply(inst, arguments); + + // Return the new object + return inst; +}; +/** + * @fileoverview Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/) + * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible) + * This should work very similarly to jQuery's events, however it's based off the book version which isn't as + * robust as jquery's, so there's probably some differences. + */ + +/** + * Add an event listener to element + * It stores the handler function in a separate cache object + * and adds a generic handler to the element's event, + * along with a unique id (guid) to the element. + * @param {Element|Object} elem Element or object to bind listeners to + * @param {String} type Type of event to bind to. + * @param {Function} fn Event listener. + */ +librevjs.on = function (elem, type, fn) { + var data = librevjs.getData(elem); + + // We need a place to store all our handler data + if (!data.handlers) data.handlers = {}; + + if (!data.handlers[type]) data.handlers[type] = []; + + if (!fn.guid) fn.guid = librevjs.guid++; + + data.handlers[type].push(fn); + + if (!data.dispatcher) { + data.disabled = false; + + data.dispatcher = function (event) { + + if (data.disabled) return; + event = librevjs.fixEvent(event); + + var handlers = data.handlers[event.type]; + + if (handlers) { + // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off. + var handlersCopy = handlers.slice(0); + + for (var m = 0, n = handlersCopy.length; m < n; m++) { + if (event.isImmediatePropagationStopped()) { + break; + } else { + handlersCopy[m].call(elem, event); + } + } + } + }; + } + + if (data.handlers[type].length == 1) { + if (document.addEventListener) { + elem.addEventListener(type, data.dispatcher, false); + } else if (document.attachEvent) { + elem.attachEvent('on' + type, data.dispatcher); + } + } +}; + +/** + * Removes event listeners from an element + * @param {Element|Object} elem Object to remove listeners from + * @param {String=} type Type of listener to remove. Don't include to remove all events from element. + * @param {Function} fn Specific listener to remove. Don't incldue to remove listeners for an event type. + */ +librevjs.off = function (elem, type, fn) { + // Don't want to add a cache object through getData if not needed + if (!librevjs.hasData(elem)) return; + + var data = librevjs.getData(elem); + + // If no events exist, nothing to unbind + if (!data.handlers) { + return; + } + + // Utility function + var removeType = function (t) { + data.handlers[t] = []; + librevjs.cleanUpEvents(elem, t); + }; + + // Are we removing all bound events? + if (!type) { + for (var t in data.handlers) removeType(t); + return; + } + + var handlers = data.handlers[type]; + + // If no handlers exist, nothing to unbind + if (!handlers) return; + + // If no listener was provided, remove all listeners for type + if (!fn) { + removeType(type); + return; + } + + // We're only removing a single handler + if (fn.guid) { + for (var n = 0; n < handlers.length; n++) { + if (handlers[n].guid === fn.guid) { + handlers.splice(n--, 1); + } + } + } + + librevjs.cleanUpEvents(elem, type); +}; + +/** + * Clean up the listener cache and dispatchers + * @param {Element|Object} elem Element to clean up + * @param {String} type Type of event to clean up + */ +librevjs.cleanUpEvents = function (elem, type) { + var data = librevjs.getData(elem); + + // Remove the events of a particular type if there are none left + if (data.handlers[type].length === 0) { + delete data.handlers[type]; + // data.handlers[type] = null; + // Setting to null was causing an error with data.handlers + + // Remove the meta-handler from the element + if (elem.removeEventListener) { + elem.removeEventListener(type, data.dispatcher, false); + } else if (elem.detachEvent) { + elem.detachEvent('on' + type, data.dispatcher); + } + } + + // Remove the events object if there are no types left + if (librevjs.isEmpty(data.handlers)) { + delete data.handlers; + delete data.dispatcher; + delete data.disabled; + + // data.handlers = null; + // data.dispatcher = null; + // data.disabled = null; + } + + // Finally remove the expando if there is no data left + if (librevjs.isEmpty(data)) { + librevjs.removeData(elem); + } +}; + +/** + * Fix a native event to have standard property values + * @param {Object} event Event object to fix + * @return {Object} + */ +librevjs.fixEvent = function (event) { + + function returnTrue() { + return true; + } + + function returnFalse() { + return false; + } + + // Test if fixing up is needed + // Used to check if !event.stopPropagation instead of isPropagationStopped + // But native events return true for stopPropagation, but don't have + // other expected methods like isPropagationStopped. Seems to be a problem + // with the Javascript Ninja code. So we're just overriding all events now. + if (!event || !event.isPropagationStopped) { + var old = event || window.event; + + event = {}; + // Clone the old object so that we can modify the values event = {}; + // IE8 Doesn't like when you mess with native event properties + // Firefox returns false for event.hasOwnProperty('type') and other props + // which makes copying more difficult. + // TODO: Probably best to create a whitelist of event props + for (var key in old) { + // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y + if (key !== 'layerX' && key !== 'layerY') { + event[key] = old[key]; + } + } + + // The event occurred on this element + if (!event.target) { + event.target = event.srcElement || document; + } + + // Handle which other element the event is related to + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + + // Stop the default browser action + event.preventDefault = function () { + if (old.preventDefault) { + old.preventDefault(); + } + event.returnValue = false; + event.isDefaultPrevented = returnTrue; + }; + + event.isDefaultPrevented = returnFalse; + + // Stop the event from bubbling + event.stopPropagation = function () { + if (old.stopPropagation) { + old.stopPropagation(); + } + event.cancelBubble = true; + event.isPropagationStopped = returnTrue; + }; + + event.isPropagationStopped = returnFalse; + + // Stop the event from bubbling and executing other handlers + event.stopImmediatePropagation = function () { + if (old.stopImmediatePropagation) { + old.stopImmediatePropagation(); + } + event.isImmediatePropagationStopped = returnTrue; + event.stopPropagation(); + }; + + event.isImmediatePropagationStopped = returnFalse; + + // Handle mouse position + if (event.clientX != null) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Handle key presses + event.which = event.charCode || event.keyCode; + + // Fix button for mouse clicks: + // 0 == left; 1 == middle; 2 == right + if (event.button != null) { + event.button = (event.button & 1 ? 0 : (event.button & 4 ? 1 : (event.button & 2 ? 2 : 0))); + } + } + + // Returns fixed-up instance + return event; +}; + +/** + * Trigger an event for an element + * @param {Element|Object} elem Element to trigger an event on + * @param {String} event Type of event to trigger + */ +librevjs.trigger = function (elem, event) { + // Fetches element data and a reference to the parent (for bubbling). + // Don't want to add a data object to cache for every parent, + // so checking hasData first. + var elemData = (librevjs.hasData(elem)) ? librevjs.getData(elem) : {}; + var parent = elem.parentNode || elem.ownerDocument; + // type = event.type || event, + // handler; + + // If an event name was passed as a string, creates an event out of it + if (typeof event === 'string') { + event = { + type: event, + target: elem + }; + } + // Normalizes the event properties. + event = librevjs.fixEvent(event); + + // If the passed element has a dispatcher, executes the established handlers. + if (elemData.dispatcher) { + elemData.dispatcher.call(elem, event); + } + + // Unless explicitly stopped or the event does not bubble (e.g. media events) + // recursively calls this function to bubble the event up the DOM. + if (parent && !event.isPropagationStopped() && event.bubbles !== false) { + librevjs.trigger(parent, event); + + // If at the top of the DOM, triggers the default action unless disabled. + } else if (!parent && !event.isDefaultPrevented()) { + var targetData = librevjs.getData(event.target); + + // Checks if the target has a default action for this event. + if (event.target[event.type]) { + // Temporarily disables event dispatching on the target as we have already executed the handler. + targetData.disabled = true; + // Executes the default action. + if (typeof event.target[event.type] === 'function') { + event.target[event.type](); + } + // Re-enables event dispatching. + targetData.disabled = false; + } + } + + // Inform the triggerer if the default was prevented by returning false + return !event.isDefaultPrevented(); + /* Original version of js ninja events wasn't complete. + * We've since updated to the latest version, but keeping this around + * for now just in case. + */ + // // Added in attion to book. Book code was broke. + // event = typeof event === 'object' ? + // event[librevjs.expando] ? + // event : + // new librevjs.Event(type, event) : + // new librevjs.Event(type); + + // event.type = type; + // if (handler) { + // handler.call(elem, event); + // } + + // // Clean up the event in case it is being reused + // event.result = undefined; + // event.target = elem; +}; + +/** + * Trigger a listener only once for an event + * @param {Element|Object} elem Element or object to + * @param {[type]} type [description] + * @param {Function} fn [description] + * @return {[type]} + */ +librevjs.one = function (elem, type, fn) { + var func = function () { + librevjs.off(elem, type, func); + fn.apply(this, arguments); + }; + func.guid = fn.guid = fn.guid || librevjs.guid++; + librevjs.on(elem, type, func); +}; +var hasOwnProp = Object.prototype.hasOwnProperty; + +/** + * Creates an element and applies properties. + * @param {String=} tagName Name of tag to be created. + * @param {Object=} properties Element properties to be applied. + * @return {Element} + */ +librevjs.createEl = function (tagName, properties) { + var el, propName; + + el = document.createElement(tagName || 'div'); + + for (propName in properties) { + if (hasOwnProp.call(properties, propName)) { + //el[propName] = properties[propName]; + // Not remembering why we were checking for dash + // but using setAttribute means you have to use getAttribute + + // The check for dash checks for the aria-* attributes, like aria-label, aria-valuemin. + // The additional check for "role" is because the default method for adding attributes does not + // add the attribute "role". My guess is because it's not a valid attribute in some namespaces, although + // browsers handle the attribute just fine. The W3C allows for aria-* attributes to be used in pre-HTML5 docs. + // http://www.w3.org/TR/wai-aria-primer/#ariahtml. Using setAttribute gets around this problem. + + if (propName.indexOf('aria-') !== -1 || propName == 'role') { + el.setAttribute(propName, properties[propName]); + } else { + el[propName] = properties[propName]; + } + } + } + return el; +}; + +/** + * Uppercase the first letter of a string + * @param {String} string String to be uppercased + * @return {String} + */ +librevjs.capitalize = function (string) { + return string.charAt(0).toUpperCase() + string.slice(1); +}; + +/** + * Object functions container + * @type {Object} + */ +librevjs.obj = {}; + +/** + * Object.create shim for prototypal inheritance. + * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create + * @param {Object} obj Object to use as prototype + */ +librevjs.obj.create = Object.create || function (obj) { + //Create a new function called 'F' which is just an empty object. + function F() {} + + //the prototype of the 'F' function should point to the + //parameter of the anonymous function. + F.prototype = obj; + + //create a new constructor function based off of the 'F' function. + return new F(); +}; + +/** + * Loop through each property in an object and call a function + * whose arguments are (key,value) + * @param {Object} obj Object of properties + * @param {Function} fn Function to be called on each property. + * @this {*} + */ +librevjs.obj.each = function (obj, fn, context) { + for (var key in obj) { + if (hasOwnProp.call(obj, key)) { + fn.call(context || this, key, obj[key]); + } + } +}; + +/** + * Merge two objects together and return the original. + * @param {Object} obj1 + * @param {Object} obj2 + * @return {Object} + */ +librevjs.obj.merge = function (obj1, obj2) { + if (!obj2) { + return obj1; + } + for (var key in obj2) { + if (hasOwnProp.call(obj2, key)) { + obj1[key] = obj2[key]; + } + } + return obj1; +}; + +/** + * Merge two objects, and merge any properties that are objects + * instead of just overwriting one. Uses to merge options hashes + * where deeper default settings are important. + * @param {Object} obj1 Object to override + * @param {Object} obj2 Overriding object + * @return {Object} New object. Obj1 and Obj2 will be untouched. + */ +librevjs.obj.deepMerge = function (obj1, obj2) { + var key, val1, val2; + + // make a copy of obj1 so we're not ovewriting original values. + // like prototype.options_ and all sub options objects + obj1 = librevjs.obj.copy(obj1); + + for (key in obj2) { + if (hasOwnProp.call(obj2, key)) { + val1 = obj1[key]; + val2 = obj2[key]; + + // Check if both properties are pure objects and do a deep merge if so + if (librevjs.obj.isPlain(val1) && librevjs.obj.isPlain(val2)) { + obj1[key] = librevjs.obj.deepMerge(val1, val2); + } else { + obj1[key] = obj2[key]; + } + } + } + return obj1; +}; + +/** + * Make a copy of the supplied object + * @param {Object} obj Object to copy + * @return {Object} Copy of object + */ +librevjs.obj.copy = function (obj) { + return librevjs.obj.merge({}, obj); +}; + +/** + * Check if an object is plain, and not a dom node or any object sub-instance + * @param {Object} obj Object to check + * @return {Boolean} True if plain, false otherwise + */ +librevjs.obj.isPlain = function (obj) { + return !!obj && typeof obj === 'object' && obj.toString() === '[object Object]' && obj.constructor === Object; +}; + +/** +* Bind (a.k.a proxy or Context). A simple method for changing the context of a function + It also stores a unique id on the function so it can be easily removed from events +* @param {*} context The object to bind as scope +* @param {Function} fn The function to be bound to a scope +* @param {Number=} uid An optional unique ID for the function to be set +* @return {Function} +*/ +librevjs.bind = function (context, fn, uid) { + // Make sure the function has a unique ID + if (!fn.guid) { + fn.guid = librevjs.guid++; + } + + // Create the new function that changes the context + var ret = function () { + return fn.apply(context, arguments); + }; + + // Allow for the ability to individualize this function + // Needed in the case where multiple objects might share the same prototype + // IF both items add an event listener with the same function, then you try to remove just one + // it will remove both because they both have the same guid. + // when using this, you need to use the bind method when you remove the listener as well. + // currently used in text tracks + ret.guid = (uid) ? uid + '_' + fn.guid : fn.guid; + + return ret; +}; + +/** + * Element Data Store. Allows for binding data to an element without putting it directly on the element. + * Ex. Event listneres are stored here. + * (also from jsninja.com, slightly modified and updated for closure compiler) + * @type {Object} + */ +librevjs.cache = {}; + +/** + * Unique ID for an element or function + * @type {Number} + */ +librevjs.guid = 1; + +/** + * Unique attribute name to store an element's guid in + * @type {String} + * @constant + */ +librevjs.expando = 'vdata' + (new Date()).getTime(); + +/** + * Returns the cache object where data for an element is stored + * @param {Element} el Element to store data for. + * @return {Object} + */ +librevjs.getData = function (el) { + var id = el[librevjs.expando]; + if (!id) { + id = el[librevjs.expando] = librevjs.guid++; + librevjs.cache[id] = {}; + } + return librevjs.cache[id]; +}; + +/** + * Returns the cache object where data for an element is stored + * @param {Element} el Element to store data for. + * @return {Object} + */ +librevjs.hasData = function (el) { + var id = el[librevjs.expando]; + return !(!id || librevjs.isEmpty(librevjs.cache[id])); +}; + +/** + * Delete data for the element from the cache and the guid attr from getElementById + * @param {Element} el Remove data for an element + */ +librevjs.removeData = function (el) { + var id = el[librevjs.expando]; + if (!id) { + return; + } + // Remove all stored data + // Changed to = null + // http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-javascript/ + // librevjs.cache[id] = null; + delete librevjs.cache[id]; + + // Remove the expando property from the DOM node + try { + delete el[librevjs.expando]; + } catch (e) { + if (el.removeAttribute) { + el.removeAttribute(librevjs.expando); + } else { + // IE doesn't appear to support removeAttribute on the document element + el[librevjs.expando] = null; + } + } +}; + +librevjs.isEmpty = function (obj) { + for (var prop in obj) { + // Inlude null properties as empty. + if (obj[prop] !== null) { + return false; + } + } + return true; +}; + +/** + * Add a CSS class name to an element + * @param {Element} element Element to add class name to + * @param {String} classToAdd Classname to add + */ +librevjs.addClass = function (element, classToAdd) { + if ((' ' + element.className + ' ').indexOf(' ' + classToAdd + ' ') == -1) { + element.className = element.className === '' ? classToAdd : element.className + ' ' + classToAdd; + } +}; + +/** + * Remove a CSS class name from an element + * @param {Element} element Element to remove from class name + * @param {String} classToAdd Classname to remove + */ +librevjs.removeClass = function (element, classToRemove) { + var classNames, i; + + if (element.className.indexOf(classToRemove) == -1) { + return; + } + + classNames = element.className.split(' '); + + // no arr.indexOf in ie8, and we don't want to add a big shim + for (i = classNames.length - 1; i >= 0; i--) { + if (classNames[i] === classToRemove) { + classNames.splice(i, 1); + } + } + + element.className = classNames.join(' '); +}; + +/** + * Element for testing browser HTML5 video capabilities + * @type {Element} + * @constant + */ +librevjs.TEST_VID = librevjs.createEl('video'); + +/** + * Useragent for browser testing. + * @type {String} + * @constant + */ +librevjs.USER_AGENT = navigator.userAgent; + +/** + * Device is an iPhone + * @type {Boolean} + * @constant + */ +librevjs.IS_IPHONE = (/iPhone/i).test(librevjs.USER_AGENT); +librevjs.IS_IPAD = (/iPad/i).test(librevjs.USER_AGENT); +librevjs.IS_IPOD = (/iPod/i).test(librevjs.USER_AGENT); +librevjs.IS_IOS = librevjs.IS_IPHONE || librevjs.IS_IPAD || librevjs.IS_IPOD; + +librevjs.IOS_VERSION = (function () { + var match = librevjs.USER_AGENT.match(/OS (\d+)_/i); + if (match && match[1]) { + return match[1]; + } +})(); + +librevjs.IS_ANDROID = (/Android/i).test(librevjs.USER_AGENT); +librevjs.ANDROID_VERSION = (function () { + // This matches Android Major.Minor.Patch versions + // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned + var match = librevjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i), + major, + minor; + + if (!match) { + return null; + } + + major = match[1] && parseFloat(match[1]); + minor = match[2] && parseFloat(match[2]); + + if (major && minor) { + return parseFloat(match[1] + '.' + match[2]); + } else if (major) { + return major; + } else { + return null; + } +})(); +// Old Android is defined as Version older than 2.3, and requiring a webkit version of the android browser +librevjs.IS_OLD_ANDROID = librevjs.IS_ANDROID && (/webkit/i).test(librevjs.USER_AGENT) && librevjs.ANDROID_VERSION < 2.3; + +librevjs.IS_FIREFOX = (/Firefox/i).test(librevjs.USER_AGENT); +librevjs.IS_CHROME = (/Chrome/i).test(librevjs.USER_AGENT); + +librevjs.TOUCH_ENABLED = ('ontouchstart' in window); + +/** + * Get an element's attribute values, as defined on the HTML tag + * Attributs are not the same as properties. They're defined on the tag + * or with setAttribute (which shouldn't be used with HTML) + * This will return true or false for boolean attributes. + * @param {Element} tag Element from which to get tag attributes + * @return {Object} + */ +librevjs.getAttributeValues = function (tag) { + var obj, knownBooleans, attrs, attrName, attrVal; + + obj = {}; + + // known boolean attributes + // we can check for matching boolean properties, but older browsers + // won't know about HTML5 boolean attributes that we still read from + knownBooleans = ',' + 'autoplay,controls,loop,muted,default' + ','; + + if (tag && tag.attributes && tag.attributes.length > 0) { + attrs = tag.attributes; + + for (var i = attrs.length - 1; i >= 0; i--) { + attrName = attrs[i].name; + attrVal = attrs[i].value; + + // check for known booleans + // the matching element property will return a value for typeof + if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) { + // the value of an included boolean attribute is typically an empty + // string ('') which would equal false if we just check for a false value. + // we also don't want support bad code like autoplay='false' + attrVal = (attrVal !== null) ? true : false; + } + + obj[attrName] = attrVal; + } + } + + return obj; +}; + +/** + * Get the computed style value for an element + * From http://robertnyman.com/2006/04/24/get-the-rendered-style-of-an-element/ + * @param {Element} el Element to get style value for + * @param {String} strCssRule Style name + * @return {String} Style value + */ +librevjs.getComputedDimension = function (el, strCssRule) { + var strValue = ''; + if (document.defaultView && document.defaultView.getComputedStyle) { + strValue = document.defaultView.getComputedStyle(el, '').getPropertyValue(strCssRule); + + } else if (el.currentStyle) { + // IE8 Width/Height support + strValue = el['client' + strCssRule.substr(0, 1).toUpperCase() + strCssRule.substr(1)] + 'px'; + } + return strValue; +}; + +/** + * Insert an element as the first child node of another + * @param {Element} child Element to insert + * @param {[type]} parent Element to insert child into + */ +librevjs.insertFirst = function (child, parent) { + if (parent.firstChild) { + parent.insertBefore(child, parent.firstChild); + } else { + parent.appendChild(child); + } +}; + +/** + * Object to hold browser support information + * @type {Object} + */ +librevjs.support = {}; + +/** + * Shorthand for document.getElementById() + * Also allows for CSS (jQuery) ID syntax. But nothing other than IDs. + * @param {String} id Element ID + * @return {Element} Element with supplied ID + */ +librevjs.el = function (id) { + if (id.indexOf('#') === 0) { + id = id.slice(1); + } + + return document.getElementById(id); +}; + +/** + * Format seconds as a time string, H:MM:SS or M:SS + * Supplying a guide (in seconds) will force a number of leading zeros + * to cover the length of the guide + * @param {Number} seconds Number of seconds to be turned into a string + * @param {Number} guide Number (in seconds) to model the string after + * @return {String} Time formatted as H:MM:SS or M:SS + */ +librevjs.formatTime = function (seconds, guide) { + // Default to using seconds as guide + guide = guide || seconds; + var s = Math.floor(seconds % 60), + m = Math.floor(seconds / 60 % 60), + h = Math.floor(seconds / 3600), + gm = Math.floor(guide / 60 % 60), + gh = Math.floor(guide / 3600); + + // handle invalid times + if (isNaN(seconds) || seconds === Infinity) { + // '-' is false for all relational operators (e.g. <, >=) so this setting + // will add the minimum number of fields specified by the guide + h = m = s = '-'; + } + + // Check if we need to show hours + h = (h > 0 || gh > 0) ? h + ':' : ''; + + // If hours are showing, we may need to add a leading zero. + // Always show at least one digit of minutes. + m = (((h || gm >= 10) && m < 10) ? '0' + m : m) + ':'; + + // Check if leading zero is need for seconds + s = (s < 10) ? '0' + s : s; + + return h + m + s; +}; + +// Attempt to block the ability to select text while dragging controls +librevjs.blockTextSelection = function () { + document.body.focus(); + document.onselectstart = function () { + return false; + }; +}; +// Turn off text selection blocking +librevjs.unblockTextSelection = function () { + document.onselectstart = function () { + return true; + }; +}; + +/** + * Trim whitespace from the ends of a string. + * @param {String} string String to trim + * @return {String} Trimmed string + */ +librevjs.trim = function (str) { + return (str + '').replace(/^\s+|\s+$/g, ''); +}; + +/** + * Should round off a number to a decimal place + * @param {Number} num Number to round + * @param {Number} dec Number of decimal places to round to + * @return {Number} Rounded number + */ +librevjs.round = function (num, dec) { + if (!dec) { + dec = 0; + } + return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); +}; + +/** + * Should create a fake TimeRange object + * Mimics an HTML5 time range instance, which has functions that + * return the start and end times for a range + * TimeRanges are returned by the buffered() method + * @param {Number} start Start time in seconds + * @param {Number} end End time in seconds + * @return {Object} Fake TimeRange object + */ +librevjs.createTimeRange = function (start, end) { + return { + length: 1, + start: function () { + return start; + }, + end: function () { + return end; + } + }; +}; + +/** + * Simple http request for retrieving external files (e.g. text tracks) + * @param {String} url URL of resource + * @param {Function=} onSuccess Success callback + * @param {Function=} onError Error callback + */ +librevjs.get = function (url, onSuccess, onError) { + var local, request; + + if (typeof XMLHttpRequest === 'undefined') { + window.XMLHttpRequest = function () { + try { + return new window.ActiveXObject('Msxml2.XMLHTTP.6.0'); + } catch (e) {} + try { + return new window.ActiveXObject('Msxml2.XMLHTTP.3.0'); + } catch (f) {} + try { + return new window.ActiveXObject('Msxml2.XMLHTTP'); + } catch (g) {} + throw new Error('This browser does not support XMLHttpRequest.'); + }; + } + + request = new XMLHttpRequest(); + try { + request.open('GET', url); + } catch (e) { + onError(e); + } + + local = (url.indexOf('file:') === 0 || (window.location.href.indexOf('file:') === 0 && url.indexOf('http') === -1)); + + request.onreadystatechange = function () { + if (request.readyState === 4) { + if (request.status === 200 || local && request.status === 0) { + onSuccess(request.responseText); + } else { + if (onError) { + onError(); + } + } + } + }; + + try { + request.send(); + } catch (e) { + if (onError) { + onError(e); + } + } +}; + +/* Local Storage +================================================================================ */ +librevjs.setLocalStorage = function (key, value) { + try { + // IE was throwing errors referencing the var anywhere without this + var localStorage = window.localStorage || false; + if (!localStorage) { + return; + } + localStorage[key] = value; + } catch (e) { + if (e.code == 22 || e.code == 1014) { // Webkit == 22 / Firefox == 1014 + librevjs.log('LocalStorage Full (LibreVideoJS)', e); + } else { + if (e.code == 18) { + librevjs.log('LocalStorage not allowed (LibreVideoJS)', e); + } else { + librevjs.log('LocalStorage Error (LibreVideoJS)', e); + } + } + } +}; + +/** + * Get abosolute version of relative URL. Used to tell flash correct URL. + * http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue + * @param {String} url URL to make absolute + * @return {String} Absolute URL + */ +librevjs.getAbsoluteURL = function (url) { + + // Check if absolute URL + if (!url.match(/^https?:\/\//)) { + // Convert to absolute URL. Flash hosted off-site needs an absolute URL. + url = librevjs.createEl('div', { + innerHTML: '<a href="' + url + '">x</a>' + }).firstChild.href; + } + + return url; +}; + +// usage: log('inside coolFunc',this,arguments); +// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ +librevjs.log = function () { + librevjs.log.history = librevjs.log.history || []; // store logs to an array for reference + librevjs.log.history.push(arguments); + if (window.console) { + window.console.log(Array.prototype.slice.call(arguments)); + } +}; + +// Offset Left +// getBoundingClientRect technique from John Resig http://ejohn.org/blog/getboundingclientrect-is-awesome/ +librevjs.findPosition = function (el) { + var box, docEl, body, clientLeft, scrollLeft, left, clientTop, scrollTop, top; + + if (el.getBoundingClientRect && el.parentNode) { + box = el.getBoundingClientRect(); + } + + if (!box) { + return { + left: 0, + top: 0 + }; + } + + docEl = document.documentElement; + body = document.body; + + clientLeft = docEl.clientLeft || body.clientLeft || 0; + scrollLeft = window.pageXOffset || body.scrollLeft; + left = box.left + scrollLeft - clientLeft; + + clientTop = docEl.clientTop || body.clientTop || 0; + scrollTop = window.pageYOffset || body.scrollTop; + top = box.top + scrollTop - clientTop; + + return { + left: left, + top: top + }; +}; +/** + * @fileoverview Player Component - Base class for all UI objects + * + */ + +/** + * Base UI Component class + * @param {Object} player Main Player + * @param {Object=} options + * @constructor + */ +librevjs.Component = librevjs.CoreObject.extend({ + /** @constructor */ + init: function (player, options, ready) { + this.player_ = player; + + // Make a copy of prototype.options_ to protect against overriding global defaults + this.options_ = librevjs.obj.copy(this.options_); + + // Updated options with supplied options + options = this.options(options); + + // Get ID from options, element, or create using player ID and unique ID + this.id_ = options['id'] || ((options['el'] && options['el']['id']) ? options['el']['id'] : player.id() + '_component_' + librevjs.guid++); + + this.name_ = options['name'] || null; + + // Create element if one wasn't provided in options + this.el_ = options['el'] || this.createEl(); + + this.children_ = []; + this.childIndex_ = {}; + this.childNameIndex_ = {}; + + // Add any child components in options + this.initChildren(); + + this.ready(ready); + // Don't want to trigger ready here or it will before init is actually + // finished for all children that run this constructor + } +}); + +/** + * Dispose of the component and all child components. + */ +librevjs.Component.prototype.dispose = function () { + this.trigger('dispose'); + + // Dispose all children. + if (this.children_) { + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i].dispose) { + this.children_[i].dispose(); + } + } + } + + // Delete child references + this.children_ = null; + this.childIndex_ = null; + this.childNameIndex_ = null; + + // Remove all event listeners. + this.off(); + + // Remove element from DOM + if (this.el_.parentNode) { + this.el_.parentNode.removeChild(this.el_); + } + + librevjs.removeData(this.el_); + this.el_ = null; +}; + +/** + * Reference to main player instance. + * @type {librevjs.Player} + * @private + */ +librevjs.Component.prototype.player_; + +/** + * Return the component's player. + * @return {librevjs.Player} + */ +librevjs.Component.prototype.player = function () { + return this.player_; +}; + +/** + * Component options object. + * @type {Object} + * @private + */ +librevjs.Component.prototype.options_; + +/** + * Deep merge of options objects + * Whenever a property is an object on both options objects + * the two properties will be merged using librevjs.obj.deepMerge. + * + * This is used for merging options for child components. We + * want it to be easy to override individual options on a child + * component without having to rewrite all the other default options. + * + * Parent.prototype.options_ = { + * children: { + * 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, + * 'childTwo': {}, + * 'childThree': {} + * } + * } + * newOptions = { + * children: { + * 'childOne': { 'foo': 'baz', 'abc': '123' } + * 'childTwo': null, + * 'childFour': {} + * } + * } + * + * this.options(newOptions); + * + * RESULT + * + * { + * children: { + * 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, + * 'childTwo': null, // Disabled. Won't be initialized. + * 'childThree': {}, + * 'childFour': {} + * } + * } + * + * @param {Object} obj Object whose values will be overwritten + * @return {Object} NEW merged object. Does not return obj1. + */ +librevjs.Component.prototype.options = function (obj) { + if (obj === undefined) return this.options_; + + return this.options_ = librevjs.obj.deepMerge(this.options_, obj); +}; + +/** + * The DOM element for the component. + * @type {Element} + * @private + */ +librevjs.Component.prototype.el_; + +/** + * Create the component's DOM element. + * @param {String=} tagName Element's node type. e.g. 'div' + * @param {Object=} attributes An object of element attributes that should be set on the element. + * @return {Element} + */ +librevjs.Component.prototype.createEl = function (tagName, attributes) { + return librevjs.createEl(tagName, attributes); +}; + +/** + * Return the component's DOM element. + * @return {Element} + */ +librevjs.Component.prototype.el = function () { + return this.el_; +}; + +/** + * An optional element where, if defined, children will be inserted + * instead of directly in el_ + * @type {Element} + * @private + */ +librevjs.Component.prototype.contentEl_; + +/** + * Return the component's DOM element for embedding content. + * will either be el_ or a new element defined in createEl + * @return {Element} + */ +librevjs.Component.prototype.contentEl = function () { + return this.contentEl_ || this.el_; +}; + +/** + * The ID for the component. + * @type {String} + * @private + */ +librevjs.Component.prototype.id_; + +/** + * Return the component's ID. + * @return {String} + */ +librevjs.Component.prototype.id = function () { + return this.id_; +}; + +/** + * The name for the component. Often used to reference the component. + * @type {String} + * @private + */ +librevjs.Component.prototype.name_; + +/** + * Return the component's ID. + * @return {String} + */ +librevjs.Component.prototype.name = function () { + return this.name_; +}; + +/** + * Array of child components + * @type {Array} + * @private + */ +librevjs.Component.prototype.children_; + +/** + * Returns array of all child components. + * @return {Array} + */ +librevjs.Component.prototype.children = function () { + return this.children_; +}; + +/** + * Object of child components by ID + * @type {Object} + * @private + */ +librevjs.Component.prototype.childIndex_; + +/** + * Returns a child component with the provided ID. + * @return {Array} + */ +librevjs.Component.prototype.getChildById = function (id) { + return this.childIndex_[id]; +}; + +/** + * Object of child components by Name + * @type {Object} + * @private + */ +librevjs.Component.prototype.childNameIndex_; + +/** + * Returns a child component with the provided ID. + * @return {Array} + */ +librevjs.Component.prototype.getChild = function (name) { + return this.childNameIndex_[name]; +}; + +/** + * Adds a child component inside this component. + * @param {String|librevjs.Component} child The class name or instance of a child to add. + * @param {Object=} options Optional options, including options to be passed to + * children of the child. + * @return {librevjs.Component} The child component, because it might be created in this process. + * @suppress {accessControls|checkRegExp|checkTypes|checkVars|const|constantProperty|deprecated|duplicate|es5Strict|fileoverviewTags|globalThis|invalidCasts|missingProperties|nonStandardJsDocs|strictModuleDepCheck|undefinedNames|undefinedVars|unknownDefines|uselessCode|visibility} + */ +librevjs.Component.prototype.addChild = function (child, options) { + var component, componentClass, componentName, componentId; + + // If string, create new component with options + if (typeof child === 'string') { + + componentName = child; + + // Make sure options is at least an empty object to protect against errors + options = options || {}; + + // Assume name of set is a lowercased name of the UI Class (PlayButton, etc.) + componentClass = options['componentClass'] || librevjs.capitalize(componentName); + + // Set name through options + options['name'] = componentName; + + // Create a new object & element for this controls set + // If there's no .player_, this is a player + // Closure Compiler throws an 'incomplete alias' warning if we use the librevjs variable directly. + // Every class should be exported, so this should never be a problem here. + component = new window['cliplibrejs'][componentClass](this.player_ || this, options); + + // child is a component instance + } else { + component = child; + } + + this.children_.push(component); + + if (typeof component.id === 'function') { + this.childIndex_[component.id()] = component; + } + + // If a name wasn't used to create the component, check if we can use the + // name function of the component + componentName = componentName || (component.name && component.name()); + + if (componentName) { + this.childNameIndex_[componentName] = component; + } + + // Add the UI object's element to the container div (box) + // Having an element is not required + if (typeof component['el'] === 'function' && component['el']()) { + this.contentEl().appendChild(component['el']()); + } + + // Return so it can stored on parent object if desired. + return component; +}; + +librevjs.Component.prototype.removeChild = function (component) { + if (typeof component === 'string') { + component = this.getChild(component); + } + + if (!component || !this.children_) return; + + var childFound = false; + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i] === component) { + childFound = true; + this.children_.splice(i, 1); + break; + } + } + + if (!childFound) return; + + this.childIndex_[component.id] = null; + this.childNameIndex_[component.name] = null; + + var compEl = component.el(); + if (compEl && compEl.parentNode === this.contentEl()) { + this.contentEl().removeChild(component.el()); + } +}; + +/** + * Initialize default child components from options + */ +librevjs.Component.prototype.initChildren = function () { + var options = this.options_; + + if (options && options['children']) { + var self = this; + + // Loop through components and add them to the player + librevjs.obj.each(options['children'], function (name, opts) { + // Allow for disabling default components + // e.g. librevjs.options['children']['posterImage'] = false + if (opts === false) return; + + // Allow waiting to add components until a specific event is called + var tempAdd = function () { + // Set property name on player. Could cause conflicts with other prop names, but it's worth making refs easy. + self[name] = self.addChild(name, opts); + }; + + if (opts['loadEvent']) { + // this.one(opts.loadEvent, tempAdd) + } else { + tempAdd(); + } + }); + } +}; + +librevjs.Component.prototype.buildCSSClass = function () { + // Child classes can include a function that does: + // return 'CLASS NAME' + this._super(); + return ''; +}; + +/* Events +============================================================================= */ + +/** + * Add an event listener to this component's element. Context will be the component. + * @param {String} type Event type e.g. 'click' + * @param {Function} fn Event listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.on = function (type, fn) { + librevjs.on(this.el_, type, librevjs.bind(this, fn)); + return this; +}; + +/** + * Remove an event listener from the component's element + * @param {String=} type Optional event type. Without type it will remove all listeners. + * @param {Function=} fn Optional event listener. Without fn it will remove all listeners for a type. + * @return {librevjs.Component} + */ +librevjs.Component.prototype.off = function (type, fn) { + librevjs.off(this.el_, type, fn); + return this; +}; + +/** + * Add an event listener to be triggered only once and then removed + * @param {String} type Event type + * @param {Function} fn Event listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.one = function (type, fn) { + librevjs.one(this.el_, type, librevjs.bind(this, fn)); + return this; +}; + +/** + * Trigger an event on an element + * @param {String} type Event type to trigger + * @param {Event|Object} event Event object to be passed to the listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.trigger = function (type, event) { + librevjs.trigger(this.el_, type, event); + return this; +}; + +/* Ready +================================================================================ */ +/** + * Is the component loaded. + * @type {Boolean} + * @private + */ +librevjs.Component.prototype.isReady_; + +/** + * Trigger ready as soon as initialization is finished. + * Allows for delaying ready. Override on a sub class prototype. + * If you set this.isReadyOnInitFinish_ it will affect all components. + * Specially used when waiting for the Flash player to asynchrnously load. + * @type {Boolean} + * @private + */ +librevjs.Component.prototype.isReadyOnInitFinish_ = true; + +/** + * List of ready listeners + * @type {Array} + * @private + */ +librevjs.Component.prototype.readyQueue_; + +/** + * Bind a listener to the component's ready state. + * Different from event listeners in that if the ready event has already happend + * it will trigger the function immediately. + * @param {Function} fn Ready listener + * @return {librevjs.Component} + */ +librevjs.Component.prototype.ready = function (fn) { + if (fn) { + if (this.isReady_) { + fn.call(this); + } else { + if (this.readyQueue_ === undefined) { + this.readyQueue_ = []; + } + this.readyQueue_.push(fn); + } + } + return this; +}; + +/** + * Trigger the ready listeners + * @return {librevjs.Component} + */ +librevjs.Component.prototype.triggerReady = function () { + this.isReady_ = true; + + var readyQueue = this.readyQueue_; + + if (readyQueue && readyQueue.length > 0) { + + for (var i = 0, j = readyQueue.length; i < j; i++) { + readyQueue[i].call(this); + } + + // Reset Ready Queue + this.readyQueue_ = []; + + // Allow for using event listeners also, in case you want to do something everytime a source is ready. + this.trigger('ready'); + } +}; + +/* Display +============================================================================= */ + +/** + * Add a CSS class name to the component's element + * @param {String} classToAdd Classname to add + * @return {librevjs.Component} + */ +librevjs.Component.prototype.addClass = function (classToAdd) { + librevjs.addClass(this.el_, classToAdd); + return this; +}; + +/** + * Remove a CSS class name from the component's element + * @param {String} classToRemove Classname to remove + * @return {librevjs.Component} + */ +librevjs.Component.prototype.removeClass = function (classToRemove) { + librevjs.removeClass(this.el_, classToRemove); + return this; +}; + +/** + * Show the component element if hidden + * @return {librevjs.Component} + */ +librevjs.Component.prototype.show = function () { + this.el_.style.display = 'block'; + return this; +}; + +/** + * Hide the component element if hidden + * @return {librevjs.Component} + */ +librevjs.Component.prototype.hide = function () { + this.el_.style.display = 'none'; + return this; +}; + +/** + * Lock an item in its visible state. To be used with fadeIn/fadeOut. + * @return {librevjs.Component} + */ +librevjs.Component.prototype.lockShowing = function () { + this.addClass('librevjs-lock-showing'); + return this; +}; + +/** + * Unlock an item to be hidden. To be used with fadeIn/fadeOut. + * @return {librevjs.Component} + */ +librevjs.Component.prototype.unlockShowing = function () { + this.removeClass('librevjs-lock-showing'); + return this; +}; + +/** + * Disable component by making it unshowable + */ +librevjs.Component.prototype.disable = function () { + this.hide(); + this.show = function () {}; +}; + +/** + * If a value is provided it will change the width of the player to that value + * otherwise the width is returned + * http://dev.w3.org/html5/spec/dimension-attributes.html#attr-dim-height + * Video tag width/height only work in pixels. No percents. + * But allowing limited percents use. e.g. width() will return number+%, not computed width + * @param {Number|String=} num Optional width number + * @param {[type]} skipListeners Skip the 'resize' event trigger + * @return {librevjs.Component|Number|String} Returns 'this' if dimension was set. + * Otherwise it returns the dimension. + */ +librevjs.Component.prototype.width = function (num, skipListeners) { + return this.dimension('width', num, skipListeners); +}; + +/** + * Get or set the height of the player + * @param {Number|String=} num Optional new player height + * @param {Boolean=} skipListeners Optional skip resize event trigger + * @return {librevjs.Component|Number|String} The player, or the dimension + */ +librevjs.Component.prototype.height = function (num, skipListeners) { + return this.dimension('height', num, skipListeners); +}; + +/** + * Set both width and height at the same time. + * @param {Number|String} width + * @param {Number|String} height + * @return {librevjs.Component} The player. + */ +librevjs.Component.prototype.dimensions = function (width, height) { + // Skip resize listeners on width for optimization + return this.width(width, true).height(height); +}; + +/** + * Get or set width or height. + * All for an integer, integer + 'px' or integer + '%'; + * Known issue: hidden elements. Hidden elements officially have a width of 0. + * So we're defaulting to the style.width value and falling back to computedStyle + * which has the hidden element issue. + * Info, but probably not an efficient fix: + * http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/ + * @param {String=} widthOrHeight 'width' or 'height' + * @param {Number|String=} num New dimension + * @param {Boolean=} skipListeners Skip resize event trigger + * @return {librevjs.Component|Number|String} Return the player if setting a dimension. + * Otherwise it returns the dimension. + */ +librevjs.Component.prototype.dimension = function (widthOrHeight, num, skipListeners) { + if (num !== undefined) { + + // Check if using css width/height (% or px) and adjust + if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) { + this.el_.style[widthOrHeight] = num; + } else if (num === 'auto') { + this.el_.style[widthOrHeight] = ''; + } else { + this.el_.style[widthOrHeight] = num + 'px'; + } + + // skipListeners allows us to avoid triggering the resize event when setting both width and height + if (!skipListeners) { + this.trigger('resize'); + } + + // Return component + return this; + } + + // Not setting a value, so getting it + // Make sure element exists + if (!this.el_) return 0; + + // Get dimension value from style + var val = this.el_.style[widthOrHeight]; + var pxIndex = val.indexOf('px'); + if (pxIndex !== -1) { + // Return the pixel value with no 'px' + return parseInt(val.slice(0, pxIndex), 10); + + // No px so using % or no style was set, so falling back to offsetWidth/height + // If component has display:none, offset will return 0 + // TODO: handle display:none and no dimension style using px + } else { + + return parseInt(this.el_['offset' + librevjs.capitalize(widthOrHeight)], 10); + + // ComputedStyle version. + // Only difference is if the element is hidden it will return + // the percent value (e.g. '100%'') + // instead of zero like offsetWidth returns. + // var val = librevjs.getComputedStyleValue(this.el_, widthOrHeight); + // var pxIndex = val.indexOf('px'); + + // if (pxIndex !== -1) { + // return val.slice(0, pxIndex); + // } else { + // return val; + // } + } +}; + +/** + * Emit 'tap' events when touch events are supported. We're requireing them to + * be enabled because otherwise every component would have this extra overhead + * unnecessarily, on mobile devices where extra overhead is especially bad. + * + * This is being implemented so we can support taps on the video element + * toggling the controls. + */ +librevjs.Component.prototype.emitTapEvents = function () { + var touchStart, touchTime, couldBeTap, noTap; + + // Track the start time so we can determine how long the touch lasted + touchStart = 0; + + this.on('touchstart', function (event) { + // Record start time so we can detect a tap vs. "touch and hold" + touchStart = new Date().getTime(); + // Reset couldBeTap tracking + couldBeTap = true; + }); + + noTap = function () { + couldBeTap = false; + }; + // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s + this.on('touchmove', noTap); + this.on('touchleave', noTap); + this.on('touchcancel', noTap); + + // When the touch ends, measure how long it took and trigger the appropriate + // event + this.on('touchend', function () { + // Proceed only if the touchmove/leave/cancel event didn't happen + if (couldBeTap === true) { + // Measure how long the touch lasted + touchTime = new Date().getTime() - touchStart; + // The touch needs to be quick in order to consider it a tap + if (touchTime < 250) { + this.trigger('tap'); + // It may be good to copy the touchend event object and change the + // type to tap, if the other event properties aren't exact after + // librevjs.fixEvent runs (e.g. event.target) + } + } + }); +}; +/* Button - Base class for all buttons +================================================================================ */ +/** + * Base class for all buttons + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.Button = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + var touchstart = false; + this.on('touchstart', function (event) { + // Stop click and other mouse events from triggering also + event.preventDefault(); + touchstart = true; + }); + this.on('touchmove', function () { + touchstart = false; + }); + var self = this; + this.on('touchend', function (event) { + if (touchstart) { + self.onClick(event); + } + event.preventDefault(); + }); + + this.on('click', this.onClick); + this.on('focus', this.onFocus); + this.on('blur', this.onBlur); + } +}); + +librevjs.Button.prototype.createEl = function (type, props) { + // Add standard Aria and Tabindex info + props = librevjs.obj.merge({ + className: this.buildCSSClass(), + innerHTML: '<div class="librevjs-control-content"><span class="librevjs-control-text">' + (this.buttonText || 'Need Text') + '</span></div>', + role: 'button', + 'aria-live': 'polite', // let the screen reader user know that the text of the button may change + tabIndex: 0 + }, props); + + return librevjs.Component.prototype.createEl.call(this, type, props); +}; + +librevjs.Button.prototype.buildCSSClass = function () { + // TODO: Change librevjs-control to librevjs-button? + return 'librevjs-control ' + librevjs.Component.prototype.buildCSSClass.call(this); +}; + +// Click - Override with specific functionality for button +librevjs.Button.prototype.onClick = function () {}; + +// Focus - Add keyboard functionality to element +librevjs.Button.prototype.onFocus = function () { + librevjs.on(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; + +// KeyPress (document level) - Trigger click when keys are pressed +librevjs.Button.prototype.onKeyPress = function (event) { + // Check for space bar (32) or enter (13) keys + if (event.which == 32 || event.which == 13) { + event.preventDefault(); + this.onClick(); + } +}; + +// Blur - Remove keyboard triggers +librevjs.Button.prototype.onBlur = function () { + librevjs.off(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; +/* Slider +================================================================================ */ +/** + * Parent for seek bar and volume slider + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.Slider = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + // Set property names to bar and handle to match with the child Slider class is looking for + this.bar = this.getChild(this.options_['barName']); + this.handle = this.getChild(this.options_['handleName']); + + player.on(this.playerEvent, librevjs.bind(this, this.update)); + + this.on('mousedown', this.onMouseDown); + this.on('touchstart', this.onMouseDown); + this.on('focus', this.onFocus); + this.on('blur', this.onBlur); + this.on('click', this.onClick); + + this.player_.on('controlsvisible', librevjs.bind(this, this.update)); + + // This is actually to fix the volume handle position. http://twitter.com/#!/gerritvanaaken/status/159046254519787520 + // this.player_.one('timeupdate', librevjs.bind(this, this.update)); + + player.ready(librevjs.bind(this, this.update)); + + this.boundEvents = {}; + } +}); + +librevjs.Slider.prototype.createEl = function (type, props) { + props = props || {}; + // Add the slider element class to all sub classes + props.className = props.className + ' librevjs-slider'; + props = librevjs.obj.merge({ + role: 'slider', + 'aria-valuenow': 0, + 'aria-valuemin': 0, + 'aria-valuemax': 100, + tabIndex: 0 + }, props); + + return librevjs.Component.prototype.createEl.call(this, type, props); +}; + +librevjs.Slider.prototype.onMouseDown = function (event) { + event.preventDefault(); + librevjs.blockTextSelection(); + + this.boundEvents.move = librevjs.bind(this, this.onMouseMove); + this.boundEvents.end = librevjs.bind(this, this.onMouseUp); + + librevjs.on(document, 'mousemove', this.boundEvents.move); + librevjs.on(document, 'mouseup', this.boundEvents.end); + librevjs.on(document, 'touchmove', this.boundEvents.move); + librevjs.on(document, 'touchend', this.boundEvents.end); + + this.onMouseMove(event); +}; + +librevjs.Slider.prototype.onMouseUp = function () { + librevjs.unblockTextSelection(); + librevjs.off(document, 'mousemove', this.boundEvents.move, false); + librevjs.off(document, 'mouseup', this.boundEvents.end, false); + librevjs.off(document, 'touchmove', this.boundEvents.move, false); + librevjs.off(document, 'touchend', this.boundEvents.end, false); + + this.update(); +}; + +librevjs.Slider.prototype.update = function () { + // In VolumeBar init we have a setTimeout for update that pops and update to the end of the + // execution stack. The player is destroyed before then update will cause an error + if (!this.el_) return; + + // If scrubbing, we could use a cached value to make the handle keep up with the user's mouse. + // On HTML5 browsers scrubbing is really smooth, but some flash players are slow, so we might want to utilize this later. + // var progress = (this.player_.scrubbing) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration(); + + var barProgress, + progress = this.getPercent(), + handle = this.handle, + bar = this.bar; + + // Protect against no duration and other division issues + if (isNaN(progress)) { + progress = 0; + } + + barProgress = progress; + + // If there is a handle, we need to account for the handle in our calculation for progress bar + // so that it doesn't fall short of or extend past the handle. + if (handle) { + + var box = this.el_, + boxWidth = box.offsetWidth, + + handleWidth = handle.el().offsetWidth, + + // The width of the handle in percent of the containing box + // In IE, widths may not be ready yet causing NaN + handlePercent = (handleWidth) ? handleWidth / boxWidth : 0, + + // Get the adjusted size of the box, considering that the handle's center never touches the left or right side. + // There is a margin of half the handle's width on both sides. + boxAdjustedPercent = 1 - handlePercent, + + // Adjust the progress that we'll use to set widths to the new adjusted box width + adjustedProgress = progress * boxAdjustedPercent; + + // The bar does reach the left side, so we need to account for this in the bar's width + barProgress = adjustedProgress + (handlePercent / 2); + + // Move the handle from the left based on the adjected progress + handle.el().style.left = librevjs.round(adjustedProgress * 100, 2) + '%'; + } + + // Set the new bar width + bar.el().style.width = librevjs.round(barProgress * 100, 2) + '%'; +}; + +librevjs.Slider.prototype.calculateDistance = function (event) { + var el, box, boxX, boxY, boxW, boxH, handle, pageX, pageY; + + el = this.el_; + box = librevjs.findPosition(el); + boxW = boxH = el.offsetWidth; + handle = this.handle; + + if (this.options_.vertical) { + boxY = box.top; + + if (event.changedTouches) { + pageY = event.changedTouches[0].pageY; + } else { + pageY = event.pageY; + } + + if (handle) { + var handleH = handle.el().offsetHeight; + // Adjusted X and Width, so handle doesn't go outside the bar + boxY = boxY + (handleH / 2); + boxH = boxH - handleH; + } + + // Percent that the click is through the adjusted area + return Math.max(0, Math.min(1, ((boxY - pageY) + boxH) / boxH)); + + } else { + boxX = box.left; + + if (event.changedTouches) { + pageX = event.changedTouches[0].pageX; + } else { + pageX = event.pageX; + } + + if (handle) { + var handleW = handle.el().offsetWidth; + + // Adjusted X and Width, so handle doesn't go outside the bar + boxX = boxX + (handleW / 2); + boxW = boxW - handleW; + } + + // Percent that the click is through the adjusted area + return Math.max(0, Math.min(1, (pageX - boxX) / boxW)); + } +}; + +librevjs.Slider.prototype.onFocus = function () { + librevjs.on(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; + +librevjs.Slider.prototype.onKeyPress = function (event) { + if (event.which == 37) { // Left Arrow + event.preventDefault(); + this.stepBack(); + } else if (event.which == 39) { // Right Arrow + event.preventDefault(); + this.stepForward(); + } +}; + +librevjs.Slider.prototype.onBlur = function () { + librevjs.off(document, 'keyup', librevjs.bind(this, this.onKeyPress)); +}; + +/** + * Listener for click events on slider, used to prevent clicks + * from bubbling up to parent elements like button menus. + * @param {Object} event Event object + */ +librevjs.Slider.prototype.onClick = function (event) { + event.stopImmediatePropagation(); + event.preventDefault(); +}; + +/** + * SeekBar Behavior includes play progress bar, and seek handle + * Needed so it can determine seek position based on handle position/size + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.SliderHandle = librevjs.Component.extend(); + +/** + * Default value of the slider + * @type {Number} + */ +librevjs.SliderHandle.prototype.defaultValue = 0; + +/** @inheritDoc */ +librevjs.SliderHandle.prototype.createEl = function (type, props) { + props = props || {}; + // Add the slider element class to all sub classes + props.className = props.className + ' librevjs-slider-handle'; + props = librevjs.obj.merge({ + innerHTML: '<span class="librevjs-control-text">' + this.defaultValue + '</span>' + }, props); + + return librevjs.Component.prototype.createEl.call(this, 'div', props); +}; +/* Menu +================================================================================ */ +/** + * The base for text track and settings menu buttons. + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.Menu = librevjs.Component.extend(); + +/** + * Add a menu item to the menu + * @param {Object|String} component Component or component type to add + */ +librevjs.Menu.prototype.addItem = function (component) { + this.addChild(component); + component.on('click', librevjs.bind(this, function () { + this.unlockShowing(); + })); +}; + +/** @inheritDoc */ +librevjs.Menu.prototype.createEl = function () { + var contentElType = this.options().contentElType || 'ul'; + this.contentEl_ = librevjs.createEl(contentElType, { + className: 'librevjs-menu-content' + }); + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + append: this.contentEl_, + className: 'librevjs-menu' + }); + el.appendChild(this.contentEl_); + + // Prevent clicks from bubbling up. Needed for Menu Buttons, + // where a click on the parent is significant + librevjs.on(el, 'click', function (event) { + event.preventDefault(); + event.stopImmediatePropagation(); + }); + + return el; +}; + +/** + * Menu item + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.MenuItem = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + this.selected(options['selected']); + } +}); + +/** @inheritDoc */ +librevjs.MenuItem.prototype.createEl = function (type, props) { + return librevjs.Button.prototype.createEl.call(this, 'li', librevjs.obj.merge({ + className: 'librevjs-menu-item', + innerHTML: this.options_['label'] + }, props)); +}; + +/** @inheritDoc */ +librevjs.MenuItem.prototype.onClick = function () { + this.selected(true); +}; + +/** + * Set this menu item as selected or not + * @param {Boolean} selected + */ +librevjs.MenuItem.prototype.selected = function (selected) { + if (selected) { + this.addClass('librevjs-selected'); + this.el_.setAttribute('aria-selected', true); + } else { + this.removeClass('librevjs-selected'); + this.el_.setAttribute('aria-selected', false); + } +}; + + +/** + * A button class with a popup menu + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.MenuButton = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + this.menu = this.createMenu(); + + // Add list to element + this.addChild(this.menu); + + // Automatically hide empty menu buttons + if (this.items && this.items.length === 0) { + this.hide(); + } + + this.on('keyup', this.onKeyPress); + this.el_.setAttribute('aria-haspopup', true); + this.el_.setAttribute('role', 'button'); + } +}); + +/** + * Track the state of the menu button + * @type {Boolean} + */ +librevjs.MenuButton.prototype.buttonPressed_ = false; + +librevjs.MenuButton.prototype.createMenu = function () { + var menu = new librevjs.Menu(this.player_); + + // Add a title list item to the top + if (this.options().title) { + menu.el().appendChild(librevjs.createEl('li', { + className: 'librevjs-menu-title', + innerHTML: librevjs.capitalize(this.kind_), + tabindex: -1 + })); + } + + this.items = this['createItems'](); + + if (this.items) { + // Add menu items to the menu + for (var i = 0; i < this.items.length; i++) { + menu.addItem(this.items[i]); + } + } + + return menu; +}; + +/** + * Create the list of menu items. Specific to each subclass. + */ +librevjs.MenuButton.prototype.createItems = function () {}; + +/** @inheritDoc */ +librevjs.MenuButton.prototype.buildCSSClass = function () { + return this.className + ' librevjs-menu-button ' + librevjs.Button.prototype.buildCSSClass.call(this); +}; + +// Focus - Add keyboard functionality to element +// This function is not needed anymore. Instead, the keyboard functionality is handled by +// treating the button as triggering a submenu. When the button is pressed, the submenu +// appears. Pressing the button again makes the submenu disappear. +librevjs.MenuButton.prototype.onFocus = function () {}; +// Can't turn off list display that we turned on with focus, because list would go away. +librevjs.MenuButton.prototype.onBlur = function () {}; + +librevjs.MenuButton.prototype.onClick = function () { + // When you click the button it adds focus, which will show the menu indefinitely. + // So we'll remove focus when the mouse leaves the button. + // Focus is needed for tab navigation. + this.one('mouseout', librevjs.bind(this, function () { + this.menu.unlockShowing(); + this.el_.blur(); + })); + if (this.buttonPressed_) { + this.unpressButton(); + } else { + this.pressButton(); + } +}; + +librevjs.MenuButton.prototype.onKeyPress = function (event) { + event.preventDefault(); + + // Check for space bar (32) or enter (13) keys + if (event.which == 32 || event.which == 13) { + if (this.buttonPressed_) { + this.unpressButton(); + } else { + this.pressButton(); + } + // Check for escape (27) key + } else if (event.which == 27) { + if (this.buttonPressed_) { + this.unpressButton(); + } + } +}; + +librevjs.MenuButton.prototype.pressButton = function () { + this.buttonPressed_ = true; + this.menu.lockShowing(); + this.el_.setAttribute('aria-pressed', true); + if (this.items && this.items.length > 0) { + this.items[0].el().focus(); // set the focus to the title of the submenu + } +}; + +librevjs.MenuButton.prototype.unpressButton = function () { + this.buttonPressed_ = false; + this.menu.unlockShowing(); + this.el_.setAttribute('aria-pressed', false); +}; + +/** + * Main player class. A player instance is returned by _V_(id); + * @param {Element} tag The original video tag used for configuring options + * @param {Object=} options Player options + * @param {Function=} ready Ready callback function + * @constructor + */ +librevjs.Player = librevjs.Component.extend({ + /** @constructor */ + init: function (tag, options, ready) { + this.tag = tag; // Store the original tag used to set options + + // Set Options + // The options argument overrides options set in the video tag + // which overrides globally set options. + // This latter part coincides with the load order + // (tag must exist before Player) + options = librevjs.obj.merge(this.getTagSettings(tag), options); + + // Cache for video property values. + this.cache_ = {}; + + // Set poster + this.poster_ = options['poster']; + // Set controls + this.controls_ = options['controls']; + // Original tag settings stored in options + // now remove immediately so native controls don't flash. + // May be turned back on by HTML5 tech if nativeControlsForTouch is true + tag.controls = false; + + // Run base component initializing with new options. + // Builds the element through createEl() + // Inits and embeds any child components in opts + librevjs.Component.call(this, this, options, ready); + + // Update controls className. Can't do this when the controls are initially + // set because the element doesn't exist yet. + if (this.controls()) { + this.addClass('librevjs-controls-enabled'); + } else { + this.addClass('librevjs-controls-disabled'); + } + + // TODO: Make this smarter. Toggle user state between touching/mousing + // using events, since devices can have both touch and mouse events. + // if (librevjs.TOUCH_ENABLED) { + // this.addClass('librevjs-touch-enabled'); + // } + + // Firstplay event implimentation. Not sold on the event yet. + // Could probably just check currentTime==0? + this.one('play', function (e) { + var fpEvent = { + type: 'firstplay', + target: this.el_ + }; + // Using librevjs.trigger so we can check if default was prevented + var keepGoing = librevjs.trigger(this.el_, fpEvent); + + if (!keepGoing) { + e.preventDefault(); + e.stopPropagation(); + e.stopImmediatePropagation(); + } + }); + + this.on('ended', this.onEnded); + this.on('play', this.onPlay); + this.on('firstplay', this.onFirstPlay); + this.on('pause', this.onPause); + this.on('progress', this.onProgress); + this.on('durationchange', this.onDurationChange); + this.on('error', this.onError); + this.on('fullscreenchange', this.onFullscreenChange); + + // Make player easily findable by ID + librevjs.players[this.id_] = this; + + if (options['plugins']) { + librevjs.obj.each(options['plugins'], function (key, val) { + this[key](val); + }, this); + } + + this.listenForUserActivity(); + } +}); + +/** + * Player instance options, surfaced using librevjs.options + * librevjs.options = librevjs.Player.prototype.options_ + * Make changes in librevjs.options, not here. + * All options should use string keys so they avoid + * renaming by closure compiler + * @type {Object} + * @private + */ +librevjs.Player.prototype.options_ = librevjs.options; + +librevjs.Player.prototype.dispose = function () { + this.trigger('dispose'); + // prevent dispose from being called twice + this.off('dispose'); + + // Kill reference to this player + librevjs.players[this.id_] = null; + if (this.tag && this.tag['player']) { + this.tag['player'] = null; + } + if (this.el_ && this.el_['player']) { + this.el_['player'] = null; + } + + // Ensure that tracking progress and time progress will stop and plater deleted + this.stopTrackingProgress(); + this.stopTrackingCurrentTime(); + + if (this.tech) { + this.tech.dispose(); + } + + // Component dispose + librevjs.Component.prototype.dispose.call(this); +}; + +librevjs.Player.prototype.getTagSettings = function (tag) { + var options = { + 'sources': [], + 'tracks': [] + }; + + librevjs.obj.merge(options, librevjs.getAttributeValues(tag)); + + // Get tag children settings + if (tag.hasChildNodes()) { + var children, child, childName, i, j; + + children = tag.childNodes; + + for (i = 0, j = children.length; i < j; i++) { + child = children[i]; + // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/ + childName = child.nodeName.toLowerCase(); + if (childName === 'source') { + options['sources'].push(librevjs.getAttributeValues(child)); + } else if (childName === 'track') { + options['tracks'].push(librevjs.getAttributeValues(child)); + } + } + } + + return options; +}; + +librevjs.Player.prototype.createEl = function () { + var el = this.el_ = librevjs.Component.prototype.createEl.call(this, 'div'); + var tag = this.tag; + + // Remove width/height attrs from tag so CSS can make it 100% width/height + tag.removeAttribute('width'); + tag.removeAttribute('height'); + // Empty video tag tracks so the built-in player doesn't use them also. + // This may not be fast enough to stop HTML5 browsers from reading the tags + // so we'll need to turn off any default tracks if we're manually doing + // captions and subtitles. videoElement.textTracks + if (tag.hasChildNodes()) { + var nodes, nodesLength, i, node, nodeName, removeNodes; + + nodes = tag.childNodes; + nodesLength = nodes.length; + removeNodes = []; + + while (nodesLength--) { + node = nodes[nodesLength]; + nodeName = node.nodeName.toLowerCase(); + if (nodeName === 'track') { + removeNodes.push(node); + } + } + + for (i = 0; i < removeNodes.length; i++) { + tag.removeChild(removeNodes[i]); + } + } + + // Make sure tag ID exists + tag.id = tag.id || 'librevjs_video_' + librevjs.guid++; + + // Give video tag ID and class to player div + // ID will now reference player box, not the video tag + el.id = tag.id; + el.className = tag.className; + + // Update tag id/class for use as HTML5 playback tech + // Might think we should do this after embedding in container so .librevjs-tech class + // doesn't flash 100% width/height, but class only applies with .video-js parent + tag.id += '_html5_api'; + tag.className = 'librevjs-tech'; + + // Make player findable on elements + tag['player'] = el['player'] = this; + // Default state of video is paused + this.addClass('librevjs-paused'); + + // Make box use width/height of tag, or rely on default implementation + // Enforce with CSS since width/height attrs don't work on divs + this.width(this.options_['width="100%"'], true); // (true) Skip resize listener on load + this.height(this.options_['height="auto"'], true); + + // Wrap video tag in div (el/box) container + if (tag.parentNode) { + tag.parentNode.insertBefore(el, tag); + } + librevjs.insertFirst(tag, el); // Breaks iPhone, fixed in HTML5 setup. + + return el; +}; + +// /* Media Technology (tech) +// ================================================================================ */ +// Load/Create an instance of playback technlogy including element and API methods +// And append playback element in player div. +librevjs.Player.prototype.loadTech = function (techName, source) { + + // Pause and remove current playback technology + if (this.tech) { + this.unloadTech(); + + // if this is the first time loading, HTML5 tag will exist but won't be initialized + // so we need to remove it if we're not loading HTML5 + } else if (techName !== 'Html5' && this.tag) { + librevjs.Html5.disposeMediaElement(this.tag); + this.tag = null; + } + + this.techName = techName; + + // Turn off API access because we're loading a new tech that might load asynchronously + this.isReady_ = false; + + var techReady = function () { + this.player_.triggerReady(); + + // Manually track progress in cases where the browser/flash player doesn't report it. + if (!this.features['progressEvents']) { + this.player_.manualProgressOn(); + } + + // Manually track timeudpates in cases where the browser/flash player doesn't report it. + if (!this.features['timeupdateEvents']) { + this.player_.manualTimeUpdatesOn(); + } + }; + + // Grab tech-specific options from player options and add source and parent element to use. + var techOptions = librevjs.obj.merge({ + 'source': source, + 'parentEl': this.el_ + }, this.options_[techName.toLowerCase()]); + + if (source) { + if (source.src == this.cache_.src && this.cache_.currentTime > 0) { + techOptions['startTime'] = this.cache_.currentTime; + } + + this.cache_.src = source.src; + } + + // Initialize tech instance + this.tech = new window['cliplibrejs'][techName](this, techOptions); + + this.tech.ready(techReady); +}; + +librevjs.Player.prototype.unloadTech = function () { + this.isReady_ = false; + this.tech.dispose(); + + // Turn off any manual progress or timeupdate tracking + if (this.manualProgress) { + this.manualProgressOff(); + } + + if (this.manualTimeUpdates) { + this.manualTimeUpdatesOff(); + } + + this.tech = false; +}; + +// There's many issues around changing the size of a Flash (or other plugin) object. +// First is a plugin reload issue in Firefox that has been around for 11 years: https://bugzilla.mozilla.org/show_bug.cgi?id=90268 +// Then with the new fullscreen API, Mozilla and webkit browsers will reload the flash object after going to fullscreen. +// To get around this, we're unloading the tech, caching source and currentTime values, and reloading the tech once the plugin is resized. +// reloadTech: function(betweenFn){ +// librevjs.log('unloadingTech') +// this.unloadTech(); +// librevjs.log('unloadedTech') +// if (betweenFn) { betweenFn.call(); } +// librevjs.log('LoadingTech') +// this.loadTech(this.techName, { src: this.cache_.src }) +// librevjs.log('loadedTech') +// }, + +/* Fallbacks for unsupported event types +================================================================================ */ +// Manually trigger progress events based on changes to the buffered amount +// Many flash players and older HTML5 browsers don't send progress or progress-like events +librevjs.Player.prototype.manualProgressOn = function () { + this.manualProgress = true; + + // Trigger progress watching when a source begins loading + this.trackProgress(); + + // Watch for a native progress event call on the tech element + // In HTML5, some older versions don't support the progress event + // So we're assuming they don't, and turning off manual progress if they do. + // As opposed to doing user agent detection + this.tech.one('progress', function () { + + // Update known progress support for this playback technology + this.features['progressEvents'] = true; + + // Turn off manual progress tracking + this.player_.manualProgressOff(); + }); +}; + +librevjs.Player.prototype.manualProgressOff = function () { + this.manualProgress = false; + this.stopTrackingProgress(); +}; + +librevjs.Player.prototype.trackProgress = function () { + + this.progressInterval = setInterval(librevjs.bind(this, function () { + // Don't trigger unless buffered amount is greater than last time + // log(this.cache_.bufferEnd, this.buffered().end(0), this.duration()) + /* TODO: update for multiple buffered regions */ + if (this.cache_.bufferEnd < this.buffered().end(0)) { + this.trigger('progress'); + } else if (this.bufferedPercent() == 1) { + this.stopTrackingProgress(); + this.trigger('progress'); // Last update + } + }), 500); +}; +librevjs.Player.prototype.stopTrackingProgress = function () { + clearInterval(this.progressInterval); +}; + +/* Time Tracking -------------------------------------------------------------- */ +librevjs.Player.prototype.manualTimeUpdatesOn = function () { + this.manualTimeUpdates = true; + + this.on('play', this.trackCurrentTime); + this.on('pause', this.stopTrackingCurrentTime); + // timeupdate is also called by .currentTime whenever current time is set + + // Watch for native timeupdate event + this.tech.one('timeupdate', function () { + // Update known progress support for this playback technology + this.features['timeupdateEvents'] = true; + // Turn off manual progress tracking + this.player_.manualTimeUpdatesOff(); + }); +}; + +librevjs.Player.prototype.manualTimeUpdatesOff = function () { + this.manualTimeUpdates = false; + this.stopTrackingCurrentTime(); + this.off('play', this.trackCurrentTime); + this.off('pause', this.stopTrackingCurrentTime); +}; + +librevjs.Player.prototype.trackCurrentTime = function () { + if (this.currentTimeInterval) { + this.stopTrackingCurrentTime(); + } + this.currentTimeInterval = setInterval(librevjs.bind(this, function () { + this.trigger('timeupdate'); + }), 250); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15 +}; + +// Turn off play progress tracking (when paused or dragging) +librevjs.Player.prototype.stopTrackingCurrentTime = function () { + clearInterval(this.currentTimeInterval); +}; + +// /* Player event handlers (how the player reacts to certain events) +// ================================================================================ */ +librevjs.Player.prototype.onEnded = function () { + if (this.options_['loop']) { + this.currentTime(0); + this.play(); + } +}; + +librevjs.Player.prototype.onPlay = function () { + librevjs.removeClass(this.el_, 'librevjs-paused'); + librevjs.addClass(this.el_, 'librevjs-playing'); +}; + +librevjs.Player.prototype.onFirstPlay = function () { + //If the first starttime attribute is specified + //then we will start at the given offset in seconds + if (this.options_['starttime']) { + this.currentTime(this.options_['starttime']); + } + + this.addClass('librevjs-has-started'); +}; + +librevjs.Player.prototype.onPause = function () { + librevjs.removeClass(this.el_, 'librevjs-playing'); + librevjs.addClass(this.el_, 'librevjs-paused'); +}; + +librevjs.Player.prototype.onProgress = function () { + // Add custom event for when source is finished downloading. + if (this.bufferedPercent() == 1) { + this.trigger('loadedalldata'); + } +}; + +// Update duration with durationchange event +// Allows for cacheing value instead of asking player each time. +librevjs.Player.prototype.onDurationChange = function () { + this.duration(this.techGet('duration')); +}; + +librevjs.Player.prototype.onError = function (e) { + librevjs.log('Video Error', e); +}; + +librevjs.Player.prototype.onFullscreenChange = function () { + if (this.isFullScreen) { + this.addClass('librevjs-fullscreen'); + } else { + this.removeClass('librevjs-fullscreen'); + } +}; + +// /* Player API +// ================================================================================ */ + +/** + * Object for cached values. + * @private + */ +librevjs.Player.prototype.cache_; + +librevjs.Player.prototype.getCache = function () { + return this.cache_; +}; + +// Pass values to the playback tech +librevjs.Player.prototype.techCall = function (method, arg) { + // If it's not ready yet, call method when it is + if (this.tech && !this.tech.isReady_) { + this.tech.ready(function () { + this[method](arg); + }); + + // Otherwise call method now + } else { + try { + this.tech[method](arg); + } catch (e) { + librevjs.log(e); + throw e; + } + } +}; + +// Get calls can't wait for the tech, and sometimes don't need to. +librevjs.Player.prototype.techGet = function (method) { + + if (this.tech && this.tech.isReady_) { + + // Flash likes to die and reload when you hide or reposition it. + // In these cases the object methods go away and we get errors. + // When that happens we'll catch the errors and inform tech that it's not ready any more. + try { + return this.tech[method](); + } catch (e) { + // When building additional tech libs, an expected method may not be defined yet + if (this.tech[method] === undefined) { + librevjs.log('LibreVideo.js: ' + method + ' method not defined for ' + this.techName + ' playback technology.', e); + } else { + // When a method isn't available on the object it throws a TypeError + if (e.name == 'TypeError') { + librevjs.log('LibreVideo.js: ' + method + ' unavailable on ' + this.techName + ' playback technology element.', e); + this.tech.isReady_ = false; + } else { + librevjs.log(e); + } + } + throw e; + } + } + + return; +}; + +/** + * Start media playback + * http://dev.w3.org/html5/spec/video.html#dom-media-play + * We're triggering the 'play' event here instead of relying on the + * media element to allow using event.preventDefault() to stop + * play from happening if desired. Usecase: preroll ads. + */ +librevjs.Player.prototype.play = function () { + this.techCall('play'); + return this; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-pause +librevjs.Player.prototype.pause = function () { + this.techCall('pause'); + return this; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-paused +// The initial state of paused should be true (in Safari it's actually false) +librevjs.Player.prototype.paused = function () { + return (this.techGet('paused') === false) ? false : true; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-currenttime +librevjs.Player.prototype.currentTime = function (seconds) { + if (seconds !== undefined) { + + // Cache the last set value for smoother scrubbing. + this.cache_.lastSetCurrentTime = seconds; + + this.techCall('setCurrentTime', seconds); + + // Improve the accuracy of manual timeupdates + if (this.manualTimeUpdates) { + this.trigger('timeupdate'); + } + + return this; + } + + // Cache last currentTime and return + // Default to 0 seconds + return this.cache_.currentTime = (this.techGet('currentTime') || 0); +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-duration +// Duration should return NaN if not available. ParseFloat will turn false-ish values to NaN. +librevjs.Player.prototype.duration = function (seconds) { + if (seconds !== undefined) { + + // Cache the last set value for optimiized scrubbing (esp. Flash) + this.cache_.duration = parseFloat(seconds); + + return this; + } + + if (this.cache_.duration === undefined) { + this.onDurationChange(); + } + + return this.cache_.duration; +}; + +// Calculates how much time is left. Not in spec, but useful. +librevjs.Player.prototype.remainingTime = function () { + return this.duration() - this.currentTime(); +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-buffered +// Buffered returns a timerange object. +// Kind of like an array of portions of the video that have been downloaded. +// So far no browsers return more than one range (portion) +librevjs.Player.prototype.buffered = function () { + var buffered = this.techGet('buffered'), + start = 0, + buflast = buffered.length - 1, + // Default end to 0 and store in values + end = this.cache_.bufferEnd = this.cache_.bufferEnd || 0; + + if (buffered && buflast >= 0 && buffered.end(buflast) !== end) { + end = buffered.end(buflast); + // Storing values allows them be overridden by setBufferedFromProgress + this.cache_.bufferEnd = end; + } + + return librevjs.createTimeRange(start, end); +}; + +// Calculates amount of buffer is full. Not in spec but useful. +librevjs.Player.prototype.bufferedPercent = function () { + return (this.duration()) ? this.buffered().end(0) / this.duration() : 0; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-volume +librevjs.Player.prototype.volume = function (percentAsDecimal) { + var vol; + + if (percentAsDecimal !== undefined) { + vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal))); // Force value to between 0 and 1 + this.cache_.volume = vol; + this.techCall('setVolume', vol); + librevjs.setLocalStorage('volume', vol); + return this; + } + + // Default to 1 when returning current volume. + vol = parseFloat(this.techGet('volume')); + return (isNaN(vol)) ? 1 : vol; +}; + +// http://dev.w3.org/html5/spec/video.html#attr-media-muted +librevjs.Player.prototype.muted = function (muted) { + if (muted !== undefined) { + this.techCall('setMuted', muted); + return this; + } + return this.techGet('muted') || false; // Default to false +}; + +// Check if current tech can support native fullscreen (e.g. with built in controls lik iOS, so not our flash swf) +librevjs.Player.prototype.supportsFullScreen = function () { + return this.techGet('supportsFullScreen') || false; +}; + +// Turn on fullscreen (or window) mode +librevjs.Player.prototype.requestFullScreen = function () { + var requestFullScreen = librevjs.support.requestFullScreen; + this.isFullScreen = true; + + if (requestFullScreen) { + // the browser supports going fullscreen at the element level so we can + // take the controls fullscreen as well as the video + + // Trigger fullscreenchange event after change + // We have to specifically add this each time, and remove + // when cancelling fullscreen. Otherwise if there's multiple + // players on a page, they would all be reacting to the same fullscreen + // events + librevjs.on(document, requestFullScreen.eventName, librevjs.bind(this, function (e) { + this.isFullScreen = document[requestFullScreen.isFullScreen]; + + // If cancelling fullscreen, remove event listener. + if (this.isFullScreen === false) { + librevjs.off(document, requestFullScreen.eventName, arguments.callee); + } + + this.trigger('fullscreenchange'); + })); + + this.el_[requestFullScreen.requestFn](); + + } else if (this.tech.supportsFullScreen()) { + // we can't take the video.js controls fullscreen but we can go fullscreen + // with native controls + this.techCall('enterFullScreen'); + } else { + // fullscreen isn't supported so we'll just stretch the video element to + // fill the viewport + this.enterFullWindow(); + this.trigger('fullscreenchange'); + } + + return this; +}; + +librevjs.Player.prototype.cancelFullScreen = function () { + var requestFullScreen = librevjs.support.requestFullScreen; + this.isFullScreen = false; + + // Check for browser element fullscreen support + if (requestFullScreen) { + document[requestFullScreen.cancelFn](); + } else if (this.tech.supportsFullScreen()) { + this.techCall('exitFullScreen'); + } else { + this.exitFullWindow(); + this.trigger('fullscreenchange'); + } + + return this; +}; + +// When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us. +librevjs.Player.prototype.enterFullWindow = function () { + this.isFullWindow = true; + + // Storing original doc overflow value to return to when fullscreen is off + this.docOrigOverflow = document.documentElement.style.overflow; + + // Add listener for esc key to exit fullscreen + librevjs.on(document, 'keydown', librevjs.bind(this, this.fullWindowOnEscKey)); + + // Hide any scroll bars + document.documentElement.style.overflow = 'hidden'; + + // Apply fullscreen styles + librevjs.addClass(document.body, 'librevjs-full-window'); + + this.trigger('enterFullWindow'); +}; +librevjs.Player.prototype.fullWindowOnEscKey = function (event) { + if (event.keyCode === 27) { + if (this.isFullScreen === true) { + this.cancelFullScreen(); + } else { + this.exitFullWindow(); + } + } +}; + +librevjs.Player.prototype.exitFullWindow = function () { + this.isFullWindow = false; + librevjs.off(document, 'keydown', this.fullWindowOnEscKey); + + // Unhide scroll bars. + document.documentElement.style.overflow = this.docOrigOverflow; + + // Remove fullscreen styles + librevjs.removeClass(document.body, 'librevjs-full-window'); + + // Resize the box, controller, and poster to original sizes + // this.positionAll(); + this.trigger('exitFullWindow'); +}; + +librevjs.Player.prototype.selectSource = function (sources) { + + // Loop through each playback technology in the options order + for (var i = 0, j = this.options_['techOrder']; i < j.length; i++) { + var techName = librevjs.capitalize(j[i]), + tech = window['cliplibrejs'][techName]; + + // Check if the browser supports this technology + if (tech.isSupported()) { + // Loop through each source object + for (var a = 0, b = sources; a < b.length; a++) { + var source = b[a]; + + // Check if source can be played with this technology + if (tech['canPlaySource'](source)) { + return { + source: source, + tech: techName + }; + } + } + } + } + + return false; +}; + +// src is a pretty powerful function +// If you pass it an array of source objects, it will find the best source to play and use that object.src +// If the new source requires a new playback technology, it will switch to that. +// If you pass it an object, it will set the source to object.src +// If you pass it anything else (url string) it will set the video source to that +librevjs.Player.prototype.src = function (source) { + // Case: Array of source objects to choose from and pick the best to play + if (source instanceof Array) { + + var sourceTech = this.selectSource(source), + techName; + + if (sourceTech) { + source = sourceTech.source; + techName = sourceTech.tech; + + // If this technology is already loaded, set source + if (techName == this.techName) { + this.src(source); // Passing the source object + // Otherwise load this technology with chosen source + } else { + this.loadTech(techName, source); + } + } else { + this.el_.appendChild(librevjs.createEl('p', { + innerHTML: this.options()['notSupportedMessage'] + })); + } + + // Case: Source object { src: '', type: '' ... } + } else if (source instanceof Object) { + + if (window['cliplibrejs'][this.techName]['canPlaySource'](source)) { + this.src(source.src); + } else { + // Send through tech loop to check for a compatible technology. + this.src([source]); + } + + // Case: URL String (http://myvideo...) + } else { + // Cache for getting last set source + this.cache_.src = source; + + if (!this.isReady_) { + this.ready(function () { + this.src(source); + }); + } else { + this.techCall('src', source); + if (this.options_['preload'] == 'auto') { + this.load(); + } + if (this.options_['autoplay']) { + this.play(); + } + } + } + return this; +}; + +// Begin loading the src data +// http://dev.w3.org/html5/spec/video.html#dom-media-load +librevjs.Player.prototype.load = function () { + this.techCall('load'); + return this; +}; + +// http://dev.w3.org/html5/spec/video.html#dom-media-currentsrc +librevjs.Player.prototype.currentSrc = function () { + return this.techGet('currentSrc') || this.cache_.src || ''; +}; + +// Attributes/Options +librevjs.Player.prototype.preload = function (value) { + if (value !== undefined) { + this.techCall('setPreload', value); + this.options_['preload'] = value; + return this; + } + return this.techGet('preload'); +}; +librevjs.Player.prototype.autoplay = function (value) { + if (value !== undefined) { + this.techCall('setAutoplay', value); + this.options_['autoplay'] = value; + return this; + } + return this.techGet('autoplay', value); +}; +librevjs.Player.prototype.loop = function (value) { + if (value !== undefined) { + this.techCall('setLoop', value); + this.options_['loop'] = value; + return this; + } + return this.techGet('loop'); +}; + +/** + * The url of the poster image source. + * @type {String} + * @private + */ +librevjs.Player.prototype.poster_; + +/** + * Get or set the poster image source url. + * @param {String} src Poster image source URL + * @return {String} Poster image source URL or null + */ +librevjs.Player.prototype.poster = function (src) { + if (src !== undefined) { + this.poster_ = src; + } + return this.poster_; +}; + +/** + * Whether or not the controls are showing + * @type {Boolean} + * @private + */ +librevjs.Player.prototype.controls_; + +/** + * Get or set whether or not the controls are showing. + * @param {Boolean} controls Set controls to showing or not + * @return {Boolean} Controls are showing + */ +librevjs.Player.prototype.controls = function (bool) { + if (bool !== undefined) { + bool = !! bool; // force boolean + // Don't trigger a change event unless it actually changed + if (this.controls_ !== bool) { + this.controls_ = bool; + if (bool) { + this.removeClass('librevjs-controls-disabled'); + this.addClass('librevjs-controls-enabled'); + this.trigger('controlsenabled'); + } else { + this.removeClass('librevjs-controls-enabled'); + this.addClass('librevjs-controls-disabled'); + this.trigger('controlsdisabled'); + } + } + return this; + } + return this.controls_; +}; + +librevjs.Player.prototype.usingNativeControls_; + +/** + * Toggle native controls on/off. Native controls are the controls built into + * devices (e.g. default iPhone controls), Flash, or other techs + * (e.g. Vimeo Controls) + * + * **This should only be set by the current tech, because only the tech knows + * if it can support native controls** + * + * @param {Boolean} bool True signals that native controls are on + * @return {librevjs.Player} Returns the player + */ +librevjs.Player.prototype.usingNativeControls = function (bool) { + if (bool !== undefined) { + bool = !! bool; // force boolean + // Don't trigger a change event unless it actually changed + if (this.usingNativeControls_ !== bool) { + this.usingNativeControls_ = bool; + if (bool) { + this.addClass('librevjs-using-native-controls'); + this.trigger('usingnativecontrols'); + } else { + this.removeClass('librevjs-using-native-controls'); + this.trigger('usingcustomcontrols'); + } + } + return this; + } + return this.usingNativeControls_; +}; + +librevjs.Player.prototype.error = function () { + return this.techGet('error'); +}; +librevjs.Player.prototype.ended = function () { + return this.techGet('ended'); +}; +librevjs.Player.prototype.seeking = function () { + return this.techGet('seeking'); +}; + +// When the player is first initialized, trigger activity so components +// like the control bar show themselves if needed +librevjs.Player.prototype.userActivity_ = true; +librevjs.Player.prototype.reportUserActivity = function (event) { + this.userActivity_ = true; +}; + +librevjs.Player.prototype.userActive_ = true; +librevjs.Player.prototype.userActive = function (bool) { + if (bool !== undefined) { + bool = !! bool; + if (bool !== this.userActive_) { + this.userActive_ = bool; + if (bool) { + // If the user was inactive and is now active we want to reset the + // inactivity timer + this.userActivity_ = true; + this.removeClass('librevjs-user-inactive'); + this.addClass('librevjs-user-active'); + this.trigger('useractive'); + } else { + // We're switching the state to inactive manually, so erase any other + // activity + this.userActivity_ = false; + + // Chrome/Safari/IE have bugs where when you change the cursor it can + // trigger a mousemove event. This causes an issue when you're hiding + // the cursor when the user is inactive, and a mousemove signals user + // activity. Making it impossible to go into inactive mode. Specifically + // this happens in fullscreen when we really need to hide the cursor. + // + // When this gets resolved in ALL browsers it can be removed + // https://code.google.com/p/chromium/issues/detail?id=103041 + this.tech.one('mousemove', function (e) { + e.stopPropagation(); + e.preventDefault(); + }); + this.removeClass('librevjs-user-active'); + this.addClass('librevjs-user-inactive'); + this.trigger('userinactive'); + } + } + return this; + } + return this.userActive_; +}; + +librevjs.Player.prototype.listenForUserActivity = function () { + var onMouseActivity, onMouseDown, mouseInProgress, onMouseUp, + activityCheck, inactivityTimeout; + + onMouseActivity = this.reportUserActivity; + + onMouseDown = function () { + onMouseActivity(); + // For as long as the they are touching the device or have their mouse down, + // we consider them active even if they're not moving their finger or mouse. + // So we want to continue to update that they are active + clearInterval(mouseInProgress); + // Setting userActivity=true now and setting the interval to the same time + // as the activityCheck interval (250) should ensure we never miss the + // next activityCheck + mouseInProgress = setInterval(librevjs.bind(this, onMouseActivity), 250); + }; + + onMouseUp = function (event) { + onMouseActivity(); + // Stop the interval that maintains activity if the mouse/touch is down + clearInterval(mouseInProgress); + }; + + // Any mouse movement will be considered user activity + this.on('mousedown', onMouseDown); + this.on('mousemove', onMouseActivity); + this.on('mouseup', onMouseUp); + + // Listen for keyboard navigation + // Shouldn't need to use inProgress interval because of key repeat + this.on('keydown', onMouseActivity); + this.on('keyup', onMouseActivity); + + // Consider any touch events that bubble up to be activity + // Certain touches on the tech will be blocked from bubbling because they + // toggle controls + this.on('touchstart', onMouseDown); + this.on('touchmove', onMouseActivity); + this.on('touchend', onMouseUp); + this.on('touchcancel', onMouseUp); + + // Run an interval every 250 milliseconds instead of stuffing everything into + // the mousemove/touchmove function itself, to prevent performance degradation. + // `this.reportUserActivity` simply sets this.userActivity_ to true, which + // then gets picked up by this loop + // http://ejohn.org/blog/learning-from-twitter/ + activityCheck = setInterval(librevjs.bind(this, function () { + // Check to see if mouse/touch activity has happened + if (this.userActivity_) { + // Reset the activity tracker + this.userActivity_ = false; + + // If the user state was inactive, set the state to active + this.userActive(true); + + // Clear any existing inactivity timeout to start the timer over + clearTimeout(inactivityTimeout); + + // In X seconds, if no more activity has occurred the user will be + // considered inactive + inactivityTimeout = setTimeout(librevjs.bind(this, function () { + // Protect against the case where the inactivityTimeout can trigger just + // before the next user activity is picked up by the activityCheck loop + // causing a flicker + if (!this.userActivity_) { + this.userActive(false); + } + }), 2000); + } + }), 250); + + // Clean up the intervals when we kill the player + this.on('dispose', function () { + clearInterval(activityCheck); + clearTimeout(inactivityTimeout); + }); +}; + +// Methods to add support for +// networkState: function(){ return this.techCall('networkState'); }, +// readyState: function(){ return this.techCall('readyState'); }, +// seeking: function(){ return this.techCall('seeking'); }, +// initialTime: function(){ return this.techCall('initialTime'); }, +// startOffsetTime: function(){ return this.techCall('startOffsetTime'); }, +// played: function(){ return this.techCall('played'); }, +// seekable: function(){ return this.techCall('seekable'); }, +// videoTracks: function(){ return this.techCall('videoTracks'); }, +// audioTracks: function(){ return this.techCall('audioTracks'); }, +// videoWidth: function(){ return this.techCall('videoWidth'); }, +// videoHeight: function(){ return this.techCall('videoHeight'); }, +// defaultPlaybackRate: function(){ return this.techCall('defaultPlaybackRate'); }, +// playbackRate: function(){ return this.techCall('playbackRate'); }, +// mediaGroup: function(){ return this.techCall('mediaGroup'); }, +// controller: function(){ return this.techCall('controller'); }, +// defaultMuted: function(){ return this.techCall('defaultMuted'); } + +// TODO +// currentSrcList: the array of sources including other formats and bitrates +// playList: array of source lists in order of playback + +// RequestFullscreen API +(function () { + var prefix, requestFS, div; + + div = document.createElement('div'); + + requestFS = {}; + + // Current W3C Spec + // http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#api + // Mozilla Draft: https://wiki.mozilla.org/Gecko:FullScreenAPI#fullscreenchange_event + // New: https://dvcs.w3.org/hg/fullscreen/raw-file/529a67b8d9f3/Overview.html + if (div.cancelFullscreen !== undefined) { + requestFS.requestFn = 'requestFullscreen'; + requestFS.cancelFn = 'exitFullscreen'; + requestFS.eventName = 'fullscreenchange'; + requestFS.isFullScreen = 'fullScreen'; + + // Webkit (Chrome/Safari) and Mozilla (Firefox) have working implementations + // that use prefixes and vary slightly from the new W3C spec. Specifically, + // using 'exit' instead of 'cancel', and lowercasing the 'S' in Fullscreen. + // Other browsers don't have any hints of which version they might follow yet, + // so not going to try to predict by looping through all prefixes. + } else { + + if (document.mozCancelFullScreen) { + prefix = 'moz'; + requestFS.isFullScreen = prefix + 'FullScreen'; + } else { + prefix = 'webkit'; + requestFS.isFullScreen = prefix + 'IsFullScreen'; + } + + if (div[prefix + 'RequestFullScreen']) { + requestFS.requestFn = prefix + 'RequestFullScreen'; + requestFS.cancelFn = prefix + 'CancelFullScreen'; + } + requestFS.eventName = prefix + 'fullscreenchange'; + } + + if (document[requestFS.cancelFn]) { + librevjs.support.requestFullScreen = requestFS; + } + +})(); + + +/** + * Container of main controls + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.ControlBar = librevjs.Component.extend(); + +librevjs.ControlBar.prototype.options_ = { + loadEvent: 'play', + children: { + 'playToggle': {}, + 'currentTimeDisplay': {}, + 'timeDivider': {}, + 'durationDisplay': {}, + 'remainingTimeDisplay': {}, + 'progressControl': {}, + 'fullscreenToggle': {}, + 'volumeControl': {}, + 'muteToggle': {} + // 'volumeMenuButton': {} + } +}; + +librevjs.ControlBar.prototype.createEl = function () { + return librevjs.createEl('div', { + className: 'librevjs-control-bar' + }); +}; +/** + * Button to toggle between play and pause + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.PlayToggle = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + player.on('play', librevjs.bind(this, this.onPlay)); + player.on('pause', librevjs.bind(this, this.onPause)); + } +}); + +librevjs.PlayToggle.prototype.buttonText = 'Play'; + +librevjs.PlayToggle.prototype.buildCSSClass = function () { + return 'librevjs-play-control ' + librevjs.Button.prototype.buildCSSClass.call(this); +}; + +// OnClick - Toggle between play and pause +librevjs.PlayToggle.prototype.onClick = function () { + if (this.player_.paused()) { + this.player_.play(); + } else { + this.player_.pause(); + } +}; + +// OnPlay - Add the librevjs-playing class to the element so it can change appearance +librevjs.PlayToggle.prototype.onPlay = function () { + librevjs.removeClass(this.el_, 'librevjs-paused'); + librevjs.addClass(this.el_, 'librevjs-playing'); + this.el_.children[0].children[0].innerHTML = 'Pause'; // change the button text to "Pause" +}; + +// OnPause - Add the librevjs-paused class to the element so it can change appearance +librevjs.PlayToggle.prototype.onPause = function () { + librevjs.removeClass(this.el_, 'librevjs-playing'); + librevjs.addClass(this.el_, 'librevjs-paused'); + this.el_.children[0].children[0].innerHTML = 'Play'; // change the button text to "Play" +}; +/** + * Displays the current time + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.CurrentTimeDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('timeupdate', librevjs.bind(this, this.updateContent)); + } +}); + +librevjs.CurrentTimeDisplay.prototype.createEl = function () { + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-current-time librevjs-time-controls librevjs-control' + }); + + this.content = librevjs.createEl('div', { + className: 'librevjs-current-time-display', + innerHTML: '<span class="librevjs-control-text">Current Time </span>' + '0:00', // label the current time for screen reader users + 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes + }); + + el.appendChild(librevjs.createEl('div').appendChild(this.content)); + return el; +}; + +librevjs.CurrentTimeDisplay.prototype.updateContent = function () { + // Allows for smooth scrubbing, when player can't keep up. + var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); + this.content.innerHTML = '<span class="librevjs-control-text">Current Time </span>' + librevjs.formatTime(time, this.player_.duration()); +}; + +/** + * Displays the duration + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.DurationDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('timeupdate', librevjs.bind(this, this.updateContent)); // this might need to be changes to 'durationchange' instead of 'timeupdate' eventually, however the durationchange event fires before this.player_.duration() is set, so the value cannot be written out using this method. Once the order of durationchange and this.player_.duration() being set is figured out, this can be updated. + } +}); + +librevjs.DurationDisplay.prototype.createEl = function () { + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-duration librevjs-time-controls librevjs-control' + }); + + this.content = librevjs.createEl('div', { + className: 'librevjs-duration-display', + innerHTML: '<span class="librevjs-control-text">Duration Time </span>' + '0:00', // label the duration time for screen reader users + 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes + }); + + el.appendChild(librevjs.createEl('div').appendChild(this.content)); + return el; +}; + +librevjs.DurationDisplay.prototype.updateContent = function () { + var duration = this.player_.duration(); + if (duration) { + this.content.innerHTML = '<span class="librevjs-control-text">Duration Time </span>' + librevjs.formatTime(duration); // label the duration time for screen reader users + } +}; + +/** + * Time Separator (Not used in main skin, but still available, and could be used as a 'spare element') + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.TimeDivider = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.TimeDivider.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-time-divider', + innerHTML: '<div><span>/</span></div>' + }); +}; + +/** + * Displays the time left in the video + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.RemainingTimeDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('timeupdate', librevjs.bind(this, this.updateContent)); + } +}); + +librevjs.RemainingTimeDisplay.prototype.createEl = function () { + var el = librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-remaining-time librevjs-time-controls librevjs-control' + }); + + this.content = librevjs.createEl('div', { + className: 'librevjs-remaining-time-display', + innerHTML: '<span class="librevjs-control-text">Remaining Time </span>' + '-0:00', // label the remaining time for screen reader users + 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes + }); + + el.appendChild(librevjs.createEl('div').appendChild(this.content)); + return el; +}; + +librevjs.RemainingTimeDisplay.prototype.updateContent = function () { + if (this.player_.duration()) { + this.content.innerHTML = '<span class="librevjs-control-text">Remaining Time </span>' + '-' + librevjs.formatTime(this.player_.remainingTime()); + } + + // Allows for smooth scrubbing, when player can't keep up. + // var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); + // this.content.innerHTML = librevjs.formatTime(time, this.player_.duration()); +}; +/** + * Toggle fullscreen video + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.FullscreenToggle = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + } +}); + +librevjs.FullscreenToggle.prototype.buttonText = 'Fullscreen'; + +librevjs.FullscreenToggle.prototype.buildCSSClass = function () { + return 'librevjs-fullscreen-control ' + librevjs.Button.prototype.buildCSSClass.call(this); +}; + +librevjs.FullscreenToggle.prototype.onClick = function () { + if (!this.player_.isFullScreen) { + this.player_.requestFullScreen(); + this.el_.children[0].children[0].innerHTML = 'Non-Fullscreen'; // change the button text to "Non-Fullscreen" + } else { + this.player_.cancelFullScreen(); + this.el_.children[0].children[0].innerHTML = 'Fullscreen'; // change the button to "Fullscreen" + } +}; +/** + * Seek, Load Progress, and Play Progress + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.ProgressControl = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.ProgressControl.prototype.options_ = { + children: { + 'seekBar': {} + } +}; + +librevjs.ProgressControl.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-progress-control librevjs-control' + }); +}; + +/** + * Seek Bar and holder for the progress bars + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.SeekBar = librevjs.Slider.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Slider.call(this, player, options); + player.on('timeupdate', librevjs.bind(this, this.updateARIAAttributes)); + player.ready(librevjs.bind(this, this.updateARIAAttributes)); + } +}); + +librevjs.SeekBar.prototype.options_ = { + children: { + 'loadProgressBar': {}, + 'playProgressBar': {}, + 'seekHandle': {} + }, + 'barName': 'playProgressBar', + 'handleName': 'seekHandle' +}; + +librevjs.SeekBar.prototype.playerEvent = 'timeupdate'; + +librevjs.SeekBar.prototype.createEl = function () { + return librevjs.Slider.prototype.createEl.call(this, 'div', { + className: 'librevjs-progress-holder', + 'aria-label': 'video progress bar' + }); +}; + +librevjs.SeekBar.prototype.updateARIAAttributes = function () { + // Allows for smooth scrubbing, when player can't keep up. + var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); + this.el_.setAttribute('aria-valuenow', librevjs.round(this.getPercent() * 100, 2)); // machine readable value of progress bar (percentage complete) + this.el_.setAttribute('aria-valuetext', librevjs.formatTime(time, this.player_.duration())); // human readable value of progress bar (time complete) +}; + +librevjs.SeekBar.prototype.getPercent = function () { + var currentTime; + // Flash RTMP provider will not report the correct time + // immediately after a seek. This isn't noticeable if you're + // seeking while the video is playing, but it is if you seek + // while the video is paused. + if (this.player_.techName === 'Flash' && this.player_.seeking()) { + var cache = this.player_.getCache(); + if (cache.lastSetCurrentTime) { + currentTime = cache.lastSetCurrentTime; + } else { + currentTime = this.player_.currentTime(); + } + } else { + currentTime = this.player_.currentTime(); + } + + return currentTime / this.player_.duration(); +}; + +librevjs.SeekBar.prototype.onMouseDown = function (event) { + librevjs.Slider.prototype.onMouseDown.call(this, event); + + this.player_.scrubbing = true; + + this.videoWasPlaying = !this.player_.paused(); + this.player_.pause(); +}; + +librevjs.SeekBar.prototype.onMouseMove = function (event) { + var newTime = this.calculateDistance(event) * this.player_.duration(); + + // Don't let video end while scrubbing. + if (newTime == this.player_.duration()) { + newTime = newTime - 0.1; + } + + // Set new time (tell player to seek to new time) + this.player_.currentTime(newTime); +}; + +librevjs.SeekBar.prototype.onMouseUp = function (event) { + librevjs.Slider.prototype.onMouseUp.call(this, event); + + this.player_.scrubbing = false; + if (this.videoWasPlaying) { + this.player_.play(); + } +}; + +librevjs.SeekBar.prototype.stepForward = function () { + this.player_.currentTime(this.player_.currentTime() + 5); // more quickly fast forward for keyboard-only users +}; + +librevjs.SeekBar.prototype.stepBack = function () { + this.player_.currentTime(this.player_.currentTime() - 5); // more quickly rewind for keyboard-only users +}; + + +/** + * Shows load progres + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.LoadProgressBar = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + player.on('progress', librevjs.bind(this, this.update)); + } +}); + +librevjs.LoadProgressBar.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-load-progress', + innerHTML: '<span class="librevjs-control-text">Loaded: 0%</span>' + }); +}; + +librevjs.LoadProgressBar.prototype.update = function () { + if (this.el_.style) { + this.el_.style.width = librevjs.round(this.player_.bufferedPercent() * 100, 2) + '%'; + } +}; + + +/** + * Shows play progress + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.PlayProgressBar = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.PlayProgressBar.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-play-progress', + innerHTML: '<span class="librevjs-control-text">Progress: 0%</span>' + }); +}; + +/** + * SeekBar component includes play progress bar, and seek handle + * Needed so it can determine seek position based on handle position/size + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.SeekHandle = librevjs.SliderHandle.extend(); + +/** @inheritDoc */ +librevjs.SeekHandle.prototype.defaultValue = '00:00'; + +/** @inheritDoc */ +librevjs.SeekHandle.prototype.createEl = function () { + return librevjs.SliderHandle.prototype.createEl.call(this, 'div', { + className: 'librevjs-seek-handle' + }); +}; +/** + * Control the volume + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeControl = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + // hide volume controls when they're not supported by the current tech + if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } + player.on('loadstart', librevjs.bind(this, function () { + if (player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } else { + this.removeClass('librevjs-hidden'); + } + })); + } +}); + +librevjs.VolumeControl.prototype.options_ = { + children: { + 'volumeBar': {} + } +}; + +librevjs.VolumeControl.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-control librevjs-control' + }); +}; + +/** + * Contains volume level + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeBar = librevjs.Slider.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Slider.call(this, player, options); + player.on('volumechange', librevjs.bind(this, this.updateARIAAttributes)); + player.ready(librevjs.bind(this, this.updateARIAAttributes)); + setTimeout(librevjs.bind(this, this.update), 0); // update when elements is in DOM + } +}); + +librevjs.VolumeBar.prototype.updateARIAAttributes = function () { + // Current value of volume bar as a percentage + this.el_.setAttribute('aria-valuenow', librevjs.round(this.player_.volume() * 100, 2)); + this.el_.setAttribute('aria-valuetext', librevjs.round(this.player_.volume() * 100, 2) + '%'); +}; + +librevjs.VolumeBar.prototype.options_ = { + children: { + 'volumeLevel': {}, + 'volumeHandle': {} + }, + 'barName': 'volumeLevel', + 'handleName': 'volumeHandle' +}; + +librevjs.VolumeBar.prototype.playerEvent = 'volumechange'; + +librevjs.VolumeBar.prototype.createEl = function () { + return librevjs.Slider.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-bar', + 'aria-label': 'volume level' + }); +}; + +librevjs.VolumeBar.prototype.onMouseMove = function (event) { + this.player_.volume(this.calculateDistance(event)); +}; + +librevjs.VolumeBar.prototype.getPercent = function () { + if (this.player_.muted()) { + return 0; + } else { + return this.player_.volume(); + } +}; + +librevjs.VolumeBar.prototype.stepForward = function () { + this.player_.volume(this.player_.volume() + 0.1); +}; + +librevjs.VolumeBar.prototype.stepBack = function () { + this.player_.volume(this.player_.volume() - 0.1); +}; + +/** + * Shows volume level + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeLevel = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + } +}); + +librevjs.VolumeLevel.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-level', + innerHTML: '<span class="librevjs-control-text"></span>' + }); +}; + +/** + * Change volume level + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.VolumeHandle = librevjs.SliderHandle.extend(); + +/** @inheritDoc */ +librevjs.VolumeHandle.prototype.defaultValue = '00:00'; + +/** @inheritDoc */ +librevjs.VolumeHandle.prototype.createEl = function () { + return librevjs.SliderHandle.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-handle' + }); +}; +/** + * Mute the audio + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.MuteToggle = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + player.on('volumechange', librevjs.bind(this, this.update)); + + // hide mute toggle if the current tech doesn't support volume control + if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } + player.on('loadstart', librevjs.bind(this, function () { + if (player.tech.features && player.tech.features['volumeControl'] === false) { + this.addClass('librevjs-hidden'); + } else { + this.removeClass('librevjs-hidden'); + } + })); + } +}); + +librevjs.MuteToggle.prototype.createEl = function () { + return librevjs.Button.prototype.createEl.call(this, 'div', { + className: 'librevjs-mute-control librevjs-control', + innerHTML: '<div><span class="librevjs-control-text">Mute</span></div>' + }); +}; + +librevjs.MuteToggle.prototype.onClick = function () { + this.player_.muted(this.player_.muted() ? false : true); +}; + +librevjs.MuteToggle.prototype.update = function () { + var vol = this.player_.volume(), + level = 3; + + if (vol === 0 || this.player_.muted()) { + level = 0; + } else if (vol < 0.33) { + level = 1; + } else if (vol < 0.67) { + level = 2; + } + + // Don't rewrite the button text if the actual text doesn't change. + // This causes unnecessary and confusing information for screen reader users. + // This check is needed because this function gets called every time the volume level is changed. + if (this.player_.muted()) { + if (this.el_.children[0].children[0].innerHTML != 'Unmute') { + this.el_.children[0].children[0].innerHTML = 'Unmute'; // change the button text to "Unmute" + } + } else { + if (this.el_.children[0].children[0].innerHTML != 'Mute') { + this.el_.children[0].children[0].innerHTML = 'Mute'; // change the button text to "Mute" + } + } + + /* TODO improve muted icon classes */ + for (var i = 0; i < 4; i++) { + librevjs.removeClass(this.el_, 'librevjs-vol-' + i); + } + librevjs.addClass(this.el_, 'librevjs-vol-' + level); +}; +/** + * Menu button with a popup for showing the volume slider. + * @constructor + */ +librevjs.VolumeMenuButton = librevjs.MenuButton.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.MenuButton.call(this, player, options); + + // Same listeners as MuteToggle + player.on('volumechange', librevjs.bind(this, this.update)); + + // hide mute toggle if the current tech doesn't support volume control + if (player.tech && player.tech.features && player.tech.features.volumeControl === false) { + this.addClass('librevjs-hidden'); + } + player.on('loadstart', librevjs.bind(this, function () { + if (player.tech.features && player.tech.features.volumeControl === false) { + this.addClass('librevjs-hidden'); + } else { + this.removeClass('librevjs-hidden'); + } + })); + this.addClass('librevjs-menu-button'); + } +}); + +librevjs.VolumeMenuButton.prototype.createMenu = function () { + var menu = new librevjs.Menu(this.player_, { + contentElType: 'div' + }); + var vc = new librevjs.VolumeBar(this.player_, librevjs.obj.merge({ + vertical: true + }, this.options_.volumeBar)); + menu.addChild(vc); + return menu; +}; + +librevjs.VolumeMenuButton.prototype.onClick = function () { + librevjs.MuteToggle.prototype.onClick.call(this); + librevjs.MenuButton.prototype.onClick.call(this); +}; + +librevjs.VolumeMenuButton.prototype.createEl = function () { + return librevjs.Button.prototype.createEl.call(this, 'div', { + className: 'librevjs-volume-menu-button librevjs-menu-button librevjs-control', + innerHTML: '<div><span class="librevjs-control-text">Mute</span></div>' + }); +}; +librevjs.VolumeMenuButton.prototype.update = librevjs.MuteToggle.prototype.update; +/* Poster Image +================================================================================ */ +/** + * Poster image. Shows before the video plays. + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.PosterImage = librevjs.Button.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Button.call(this, player, options); + + if (!player.poster() || !player.controls()) { + this.hide(); + } + + player.on('play', librevjs.bind(this, this.hide)); + } +}); + +librevjs.PosterImage.prototype.createEl = function () { + var el = librevjs.createEl('div', { + className: 'librevjs-poster', + + // Don't want poster to be tabbable. + tabIndex: -1 + }), + poster = this.player_.poster(); + + if (poster) { + if ('backgroundSize' in el.style) { + el.style.backgroundImage = 'url("' + poster + '")'; + } else { + el.appendChild(librevjs.createEl('img', { + src: poster + })); + } + } + + return el; +}; + +librevjs.PosterImage.prototype.onClick = function () { + // Only accept clicks when controls are enabled + if (this.player().controls()) { + this.player_.play(); + } +}; +/* Loading Spinner +================================================================================ */ +/** + * Loading spinner for waiting events + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.LoadingSpinner = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + player.on('canplay', librevjs.bind(this, this.hide)); + player.on('canplaythrough', librevjs.bind(this, this.hide)); + player.on('playing', librevjs.bind(this, this.hide)); + player.on('seeked', librevjs.bind(this, this.hide)); + + player.on('seeking', librevjs.bind(this, this.show)); + + // in some browsers seeking does not trigger the 'playing' event, + // so we also need to trap 'seeked' if we are going to set a + // 'seeking' event + player.on('seeked', librevjs.bind(this, this.hide)); + + player.on('error', librevjs.bind(this, this.show)); + + // Not showing spinner on stalled any more. Browsers may stall and then not trigger any events that would remove the spinner. + // player.on('stalled', librevjs.bind(this, this.show)); + + player.on('waiting', librevjs.bind(this, this.show)); + } +}); + +librevjs.LoadingSpinner.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-loading-spinner' + }); +}; +/* Big Play Button +================================================================================ */ +/** + * Initial play button. Shows before the video has played. The hiding of the + * big play button is done via CSS and player states. + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.BigPlayButton = librevjs.Button.extend(); + +librevjs.BigPlayButton.prototype.createEl = function () { + return librevjs.Button.prototype.createEl.call(this, 'div', { + className: 'librevjs-big-play-button', + innerHTML: '<span></span>', + 'aria-label': 'play video' + }); +}; + +librevjs.BigPlayButton.prototype.onClick = function () { + this.player_.play(); +}; +/** + * @fileoverview Media Technology Controller - Base class for media playback + * technology controllers like Flash and HTML5 + */ + +/** + * Base class for media (HTML5 Video, Flash) controllers + * @param {librevjs.Player|Object} player Central player instance + * @param {Object=} options Options object + * @constructor + */ +librevjs.MediaTechController = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.Component.call(this, player, options, ready); + + this.initControlsListeners(); + } +}); + +/** + * Set up click and touch listeners for the playback element + * On desktops, a click on the video itself will toggle playback, + * on a mobile device a click on the video toggles controls. + * (toggling controls is done by toggling the user state between active and + * inactive) + * + * A tap can signal that a user has become active, or has become inactive + * e.g. a quick tap on an iPhone movie should reveal the controls. Another + * quick tap should hide them again (signaling the user is in an inactive + * viewing state) + * + * In addition to this, we still want the user to be considered inactive after + * a few seconds of inactivity. + * + * Note: the only part of iOS interaction we can't mimic with this setup + * is a touch and hold on the video element counting as activity in order to + * keep the controls showing, but that shouldn't be an issue. A touch and hold on + * any controls will still keep the user active + */ +librevjs.MediaTechController.prototype.initControlsListeners = function () { + var player, tech, activateControls, deactivateControls; + + tech = this; + player = this.player(); + + var activateControls = function () { + if (player.controls() && !player.usingNativeControls()) { + tech.addControlsListeners(); + } + }; + + deactivateControls = librevjs.bind(tech, tech.removeControlsListeners); + + // Set up event listeners once the tech is ready and has an element to apply + // listeners to + this.ready(activateControls); + player.on('controlsenabled', activateControls); + player.on('controlsdisabled', deactivateControls); +}; + +librevjs.MediaTechController.prototype.addControlsListeners = function () { + var preventBubble, userWasActive; + + // Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do + // trigger mousedown/up. + // http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object + // Any touch events are set to block the mousedown event from happening + this.on('mousedown', this.onClick); + + // We need to block touch events on the video element from bubbling up, + // otherwise they'll signal activity prematurely. The specific use case is + // when the video is playing and the controls have faded out. In this case + // only a tap (fast touch) should toggle the user active state and turn the + // controls back on. A touch and move or touch and hold should not trigger + // the controls (per iOS as an example at least) + // + // We always want to stop propagation on touchstart because touchstart + // at the player level starts the touchInProgress interval. We can still + // report activity on the other events, but won't let them bubble for + // consistency. We don't want to bubble a touchend without a touchstart. + this.on('touchstart', function (event) { + // Stop the mouse events from also happening + event.preventDefault(); + event.stopPropagation(); + // Record if the user was active now so we don't have to keep polling it + userWasActive = this.player_.userActive(); + }); + + preventBubble = function (event) { + event.stopPropagation(); + if (userWasActive) { + this.player_.reportUserActivity(); + } + }; + + // Treat all touch events the same for consistency + this.on('touchmove', preventBubble); + this.on('touchleave', preventBubble); + this.on('touchcancel', preventBubble); + this.on('touchend', preventBubble); + + // Turn on component tap events + this.emitTapEvents(); + + // The tap listener needs to come after the touchend listener because the tap + // listener cancels out any reportedUserActivity when setting userActive(false) + this.on('tap', this.onTap); +}; + +/** + * Remove the listeners used for click and tap controls. This is needed for + * toggling to controls disabled, where a tap/touch should do nothing. + */ +librevjs.MediaTechController.prototype.removeControlsListeners = function () { + // We don't want to just use `this.off()` because there might be other needed + // listeners added by techs that extend this. + this.off('tap'); + this.off('touchstart'); + this.off('touchmove'); + this.off('touchleave'); + this.off('touchcancel'); + this.off('touchend'); + this.off('click'); + this.off('mousedown'); +}; + +/** + * Handle a click on the media element. By default will play/pause the media. + */ +librevjs.MediaTechController.prototype.onClick = function (event) { + // We're using mousedown to detect clicks thanks to Flash, but mousedown + // will also be triggered with right-clicks, so we need to prevent that + if (event.button !== 0) return; + + // When controls are disabled a click should not toggle playback because + // the click is considered a control + if (this.player().controls()) { + if (this.player().paused()) { + this.player().play(); + } else { + this.player().pause(); + } + } +}; + +/** + * Handle a tap on the media element. By default it will toggle the user + * activity state, which hides and shows the controls. + */ + +librevjs.MediaTechController.prototype.onTap = function () { + this.player().userActive(!this.player().userActive()); +}; + +librevjs.MediaTechController.prototype.features = { + 'volumeControl': true, + + // Resizing plugins using request fullscreen reloads the plugin + 'fullscreenResize': false, + + // Optional events that we can manually mimic with timers + // currently not triggered by video-js-swf + 'progressEvents': false, + 'timeupdateEvents': false +}; + +librevjs.media = {}; + +/** + * List of default API methods for any MediaTechController + * @type {String} + */ +librevjs.media.ApiMethods = 'play,pause,paused,currentTime,setCurrentTime,duration,buffered,volume,setVolume,muted,setMuted,width,height,supportsFullScreen,enterFullScreen,src,load,currentSrc,preload,setPreload,autoplay,setAutoplay,loop,setLoop,error,networkState,readyState,seeking,initialTime,startOffsetTime,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks,defaultPlaybackRate,playbackRate,mediaGroup,controller,controls,defaultMuted'.split(','); +// Create placeholder methods for each that warn when a method isn't supported by the current playback technology + +function createMethod(methodName) { + return function () { + throw new Error('The "' + methodName + '" method is not available on the playback technology\'s API'); + }; +} + +for (var i = librevjs.media.ApiMethods.length - 1; i >= 0; i--) { + var methodName = librevjs.media.ApiMethods[i]; + librevjs.MediaTechController.prototype[librevjs.media.ApiMethods[i]] = createMethod(methodName); +} +/** + * @fileoverview HTML5 Media Controller - Wrapper for HTML5 Media API + */ + +/** + * HTML5 Media Controller - Wrapper for HTML5 Media API + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @param {Function=} ready + * @constructor + */ +librevjs.Html5 = librevjs.MediaTechController.extend({ + /** @constructor */ + init: function (player, options, ready) { + // volume cannot be changed from 1 on iOS + this.features['volumeControl'] = librevjs.Html5.canControlVolume(); + + // In iOS, if you move a video element in the DOM, it breaks video playback. + this.features['movingMediaElementInDOM'] = !librevjs.IS_IOS; + + // HTML video is able to automatically resize when going to fullscreen + this.features['fullscreenResize'] = true; + + librevjs.MediaTechController.call(this, player, options, ready); + + var source = options['source']; + + // If the element source is already set, we may have missed the loadstart event, and want to trigger it. + // We don't want to set the source again and interrupt playback. + if (source && this.el_.currentSrc === source.src && this.el_.networkState > 0) { + player.trigger('loadstart'); + + // Otherwise set the source if one was provided. + } else if (source) { + this.el_.src = source.src; + } + + // Determine if native controls should be used + // Our goal should be to get the custom controls on mobile solid everywhere + // so we can remove this all together. Right now this will block custom + // controls on touch enabled laptops like the Chrome Pixel + if (librevjs.TOUCH_ENABLED && player.options()['nativeControlsForTouch'] === true) { + this.useNativeControls(); + } + + // Chrome and Safari both have issues with autoplay. + // In Safari (5.1.1), when we move the video element into the container div, autoplay doesn't work. + // In Chrome (15), if you have autoplay + a poster + no controls, the video gets hidden (but audio plays) + // This fixes both issues. Need to wait for API, so it updates displays correctly + player.ready(function () { + if (this.tag && this.options_['autoplay'] && this.paused()) { + delete this.tag['poster']; // Chrome Fix. Fixed in Chrome v16. + this.play(); + } + }); + + this.setupTriggers(); + this.triggerReady(); + } +}); + +librevjs.Html5.prototype.dispose = function () { + librevjs.MediaTechController.prototype.dispose.call(this); +}; + +librevjs.Html5.prototype.createEl = function () { + var player = this.player_, + // If possible, reuse original tag for HTML5 playback technology element + el = player.tag, + newEl, + clone; + + // Check if this browser supports moving the element into the box. + // On the iPhone video will break if you move the element, + // So we have to create a brand new element. + if (!el || this.features['movingMediaElementInDOM'] === false) { + + // If the original tag is still there, clone and remove it. + if (el) { + clone = el.cloneNode(false); + librevjs.Html5.disposeMediaElement(el); + el = clone; + player.tag = null; + } else { + el = librevjs.createEl('video', { + id: player.id() + '_html5_api', + className: 'librevjs-tech' + }); + } + // associate the player with the new tag + el['player'] = player; + + librevjs.insertFirst(el, player.el()); + } + + // Update specific tag settings, in case they were overridden + var attrs = ['autoplay', 'preload', 'loop', 'muted']; + for (var i = attrs.length - 1; i >= 0; i--) { + var attr = attrs[i]; + if (player.options_[attr] !== null) { + el[attr] = player.options_[attr]; + } + } + + return el; + // jenniisawesome = true; +}; + +// Make video events trigger player events +// May seem verbose here, but makes other APIs possible. +librevjs.Html5.prototype.setupTriggers = function () { + for (var i = librevjs.Html5.Events.length - 1; i >= 0; i--) { + librevjs.on(this.el_, librevjs.Html5.Events[i], librevjs.bind(this.player_, this.eventHandler)); + } +}; +// Triggers removed using this.off when disposed + +librevjs.Html5.prototype.eventHandler = function (e) { + this.trigger(e); + + // No need for media events to bubble up. + e.stopPropagation(); +}; + +librevjs.Html5.prototype.useNativeControls = function () { + var tech, player, controlsOn, controlsOff, cleanUp; + + tech = this; + player = this.player(); + + // If the player controls are enabled turn on the native controls + tech.setControls(player.controls()); + + // Update the native controls when player controls state is updated + controlsOn = function () { + tech.setControls(true); + }; + controlsOff = function () { + tech.setControls(false); + }; + player.on('controlsenabled', controlsOn); + player.on('controlsdisabled', controlsOff); + + // Clean up when not using native controls anymore + cleanUp = function () { + player.off('controlsenabled', controlsOn); + player.off('controlsdisabled', controlsOff); + }; + tech.on('dispose', cleanUp); + player.on('usingcustomcontrols', cleanUp); + + // Update the state of the player to using native controls + player.usingNativeControls(true); +}; + + +librevjs.Html5.prototype.play = function () { + this.el_.play(); +}; +librevjs.Html5.prototype.pause = function () { + this.el_.pause(); +}; +librevjs.Html5.prototype.paused = function () { + return this.el_.paused; +}; + +librevjs.Html5.prototype.currentTime = function () { + return this.el_.currentTime; +}; +librevjs.Html5.prototype.setCurrentTime = function (seconds) { + try { + this.el_.currentTime = seconds; + } catch (e) { + librevjs.log(e, 'Video is not ready. (LibreVideo.js)'); + // this.warning(LibreVideoJS.warnings.videoNotReady); + } +}; + +librevjs.Html5.prototype.duration = function () { + return this.el_.duration || 0; +}; +librevjs.Html5.prototype.buffered = function () { + return this.el_.buffered; +}; + +librevjs.Html5.prototype.volume = function () { + return this.el_.volume; +}; +librevjs.Html5.prototype.setVolume = function (percentAsDecimal) { + this.el_.volume = percentAsDecimal; +}; +librevjs.Html5.prototype.muted = function () { + return this.el_.muted; +}; +librevjs.Html5.prototype.setMuted = function (muted) { + this.el_.muted = muted; +}; + +librevjs.Html5.prototype.width = function () { + return this.el_.offsetWidth; +}; +librevjs.Html5.prototype.height = function () { + return this.el_.offsetHeight; +}; + +librevjs.Html5.prototype.supportsFullScreen = function () { + if (typeof this.el_.webkitEnterFullScreen == 'function') { + + // Seems to be broken in Chromium/Chrome && Safari in Leopard + if (/Android/.test(librevjs.USER_AGENT) || !/Chrome|Mac OS X 10.5/.test(librevjs.USER_AGENT)) { + return true; + } + } + return false; +}; + +librevjs.Html5.prototype.enterFullScreen = function () { + var video = this.el_; + if (video.paused && video.networkState <= video.HAVE_METADATA) { + // attempt to prime the video element for programmatic access + // this isn't necessary on the desktop but shouldn't hurt + this.el_.play(); + + // playing and pausing synchronously during the transition to fullscreen + // can get iOS ~6.1 devices into a play/pause loop + setTimeout(function () { + video.pause(); + video.webkitEnterFullScreen(); + }, 0); + } else { + video.webkitEnterFullScreen(); + } +}; +librevjs.Html5.prototype.exitFullScreen = function () { + this.el_.webkitExitFullScreen(); +}; +librevjs.Html5.prototype.src = function (src) { + this.el_.src = src; +}; +librevjs.Html5.prototype.load = function () { + this.el_.load(); +}; +librevjs.Html5.prototype.currentSrc = function () { + return this.el_.currentSrc; +}; + +librevjs.Html5.prototype.preload = function () { + return this.el_.preload; +}; +librevjs.Html5.prototype.setPreload = function (val) { + this.el_.preload = val; +}; + +librevjs.Html5.prototype.autoplay = function () { + return this.el_.autoplay; +}; +librevjs.Html5.prototype.setAutoplay = function (val) { + this.el_.autoplay = val; +}; + +librevjs.Html5.prototype.controls = function () { + return this.el_.controls; +} +librevjs.Html5.prototype.setControls = function (val) { + this.el_.controls = !! val; +} + +librevjs.Html5.prototype.loop = function () { + return this.el_.loop; +}; +librevjs.Html5.prototype.setLoop = function (val) { + this.el_.loop = val; +}; + +librevjs.Html5.prototype.error = function () { + return this.el_.error; +}; +librevjs.Html5.prototype.seeking = function () { + return this.el_.seeking; +}; +librevjs.Html5.prototype.ended = function () { + return this.el_.ended; +}; +librevjs.Html5.prototype.defaultMuted = function () { + return this.el_.defaultMuted; +}; + +/* HTML5 Support Testing ---------------------------------------------------- */ + +librevjs.Html5.isSupported = function () { + return !!librevjs.TEST_VID.canPlayType; +}; + +librevjs.Html5.canPlaySource = function (srcObj) { + // MediaPlayer throws an error here + try { + return !!librevjs.TEST_VID.canPlayType(srcObj.type); + } catch (e) { + return ''; + } + // TODO: Check Type + // If no Type, check ext + // Check Media Type +}; + +librevjs.Html5.canControlVolume = function () { + var volume = librevjs.TEST_VID.volume; + librevjs.TEST_VID.volume = (volume / 2) + 0.1; + return volume !== librevjs.TEST_VID.volume; +}; + +// List of all HTML5 events (various uses). +librevjs.Html5.Events = 'loadstart,suspend,abort,error,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,playing,waiting,seeking,seeked,ended,durationchange,timeupdate,progress,play,pause,ratechange,volumechange'.split(','); + +librevjs.Html5.disposeMediaElement = function (el) { + if (!el) { + return; + } + + el['player'] = null; + + if (el.parentNode) { + el.parentNode.removeChild(el); + } + + // remove any child track or source nodes to prevent their loading + while (el.hasChildNodes()) { + el.removeChild(el.firstChild); + } + + // remove any src reference. not setting `src=''` because that causes a warning + // in firefox + el.removeAttribute('src'); + + // force the media element to update its loading state by calling load() + if (typeof el.load === 'function') { + el.load(); + } +}; + +// HTML5 Feature detection and Device Fixes --------------------------------- // + +// Override Android 2.2 and less canPlayType method which is broken +if (librevjs.IS_OLD_ANDROID) { + document.createElement('video').constructor.prototype.canPlayType = function (type) { + return (type && type.toLowerCase().indexOf('video/mp4') != -1) ? 'maybe' : ''; + }; +} +/** + * @fileoverview LibreVideoJS NO use flash + * Not using setupTriggers. Using global onEvent func to distribute events + */ + +/** + * HTML5 Media Controller - Wrapper for HTML5 Media API + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @param {Function=} ready + * @constructor + */ +librevjs.Flash = librevjs.MediaTechController.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.MediaTechController.call(this, player, options, ready); + + var source = options['source'], + + // Which element to embed in + parentEl = options['parentEl'], + + // Create a temporary element to be replaced by swf object + placeHolder = this.el_ = librevjs.createEl('div', { + id: player.id() + '_temp_flash' + }), + + // Generate ID for swf object + objId = player.id() + '_flash_api', + + // Store player options in local var for optimization + // TODO: switch to using player methods instead of options + // e.g. player.autoplay(); + playerOptions = player.options_, + + // Merge default flashvars with ones passed in to init + flashVars = librevjs.obj.merge({ + + // SWF Callback Functions + 'readyFunction': 'cliplibrejs.Flash.onReady', + 'eventProxyFunction': 'cliplibrejs.Flash.onEvent', + 'errorEventProxyFunction': 'cliplibrejs.Flash.onError', + + // Player Settings + 'autoplay': playerOptions.autoplay, + 'preload': playerOptions.preload, + 'loop': playerOptions.loop, + 'muted': playerOptions.muted + + }, options['flashVars']), + + // Merge default parames with ones passed in + params = librevjs.obj.merge({ + 'wmode': 'opaque', // Opaque is needed to overlay controls, but can affect playback performance + 'bgcolor': '#000000' // Using bgcolor prevents a white flash when the object is loading + }, options['params']), + + // Merge default attributes with ones passed in + attributes = librevjs.obj.merge({ + 'id': objId, + 'name': objId, // Both ID and Name needed or swf to identifty itself + 'class': 'librevjs-tech' + }, options['attributes']); + + // If source was supplied pass as a flash var. + if (source) { + if (source.type && librevjs.Flash.isStreamingType(source.type)) { + var parts = librevjs.Flash.streamToParts(source.src); + flashVars['rtmpConnection'] = encodeURIComponent(parts.connection); + flashVars['rtmpStream'] = encodeURIComponent(parts.stream); + } else { + flashVars['src'] = encodeURIComponent(librevjs.getAbsoluteURL(source.src)); + } + } + + // Add placeholder to player div + librevjs.insertFirst(placeHolder, parentEl); + + // Having issues with Flash reloading on certain page actions (hide/resize/fullscreen) in certain browsers + // This allows resetting the playhead when we catch the reload + if (options['startTime']) { + this.ready(function () { + this.load(); + this.play(); + this.currentTime(options['startTime']); + }); + } + + // Flash iFrame Mode + // In web browsers there are multiple instances where changing the parent element or visibility of a plugin causes the plugin to reload. + // - Firefox just about always. https://bugzilla.mozilla.org/show_bug.cgi?id=90268 (might be fixed by version 13) + // - Webkit when hiding the plugin + // - Webkit and Firefox when using requestFullScreen on a parent element + // Loading the flash plugin into a dynamically generated iFrame gets around most of these issues. + // Issues that remain include hiding the element and requestFullScreen in Firefox specifically + + // There's on particularly annoying issue with this method which is that Firefox throws a security error on an offsite Flash object loaded into a dynamically created iFrame. + // Even though the iframe was inserted into a page on the web, Firefox + Flash considers it a local app trying to access an internet file. + // I tried mulitple ways of setting the iframe src attribute but couldn't find a src that worked well. Tried a real/fake source, in/out of domain. + // Also tried a method from stackoverflow that caused a security error in all browsers. http://stackoverflow.com/questions/2486901/how-to-set-document-domain-for-a-dynamically-generated-iframe + // In the end the solution I found to work was setting the iframe window.location.href right before doing a document.write of the Flash object. + // The only downside of this it seems to trigger another http request to the original page (no matter what's put in the href). Not sure why that is. + + // NOTE (2012-01-29): Cannot get Firefox to load the remote hosted SWF into a dynamically created iFrame + // Firefox 9 throws a security error, unleess you call location.href right before doc.write. + // Not sure why that even works, but it causes the browser to look like it's continuously trying to load the page. + // Firefox 3.6 keeps calling the iframe onload function anytime I write to it, causing an endless loop. + + if (options['iFrameMode'] === true && !librevjs.IS_FIREFOX) { + + // Create iFrame with librevjs-tech class so it's 100% width/height + var iFrm = librevjs.createEl('iframe', { + 'id': objId + '_iframe', + 'name': objId + '_iframe', + 'className': 'librevjs-tech', + 'scrolling': 'no', + 'marginWidth': 0, + 'marginHeight': 0, + 'frameBorder': 0 + }); + + // Update ready function names in flash vars for iframe window + flashVars['readyFunction'] = 'ready'; + flashVars['eventProxyFunction'] = 'events'; + flashVars['errorEventProxyFunction'] = 'errors'; + + // Tried multiple methods to get this to work in all browsers + + // Tried embedding the flash object in the page first, and then adding a place holder to the iframe, then replacing the placeholder with the page object. + // The goal here was to try to load the swf URL in the parent page first and hope that got around the firefox security error + // var newObj = librevjs.Flash.embed(options['swf'], placeHolder, flashVars, params, attributes); + // (in onload) + // var temp = librevjs.createEl('a', { id:'asdf', innerHTML: 'asdf' } ); + // iDoc.body.appendChild(temp); + + // Tried embedding the flash object through javascript in the iframe source. + // This works in webkit but still triggers the firefox security error + // iFrm.src = 'javascript: document.write('"+librevjs.Flash.getEmbedCode(options['swf'], flashVars, params, attributes)+"');"; + + // Tried an actual local iframe just to make sure that works, but it kills the easiness of the CDN version if you require the user to host an iframe + // We should add an option to host the iframe locally though, because it could help a lot of issues. + // iFrm.src = "iframe.html"; + + // Wait until iFrame has loaded to write into it. + librevjs.on(iFrm, 'load', librevjs.bind(this, function () { + + var iDoc, + iWin = iFrm.contentWindow; + + // The one working method I found was to use the iframe's document.write() to create the swf object + // This got around the security issue in all browsers except firefox. + // I did find a hack where if I call the iframe's window.location.href='', it would get around the security error + // However, the main page would look like it was loading indefinitely (URL bar loading spinner would never stop) + // Plus Firefox 3.6 didn't work no matter what I tried. + // if (librevjs.USER_AGENT.match('Firefox')) { + // iWin.location.href = ''; + // } + + // Get the iFrame's document depending on what the browser supports + iDoc = iFrm.contentDocument ? iFrm.contentDocument : iFrm.contentWindow.document; + + // Tried ensuring both document domains were the same, but they already were, so that wasn't the issue. + // Even tried adding /. that was mentioned in a browser security writeup + // document.domain = document.domain+'/.'; + // iDoc.domain = document.domain+'/.'; + + // Tried adding the object to the iframe doc's innerHTML. Security error in all browsers. + // iDoc.body.innerHTML = swfObjectHTML; + + // Tried appending the object to the iframe doc's body. Security error in all browsers. + // iDoc.body.appendChild(swfObject); + + // Using document.write actually got around the security error that browsers were throwing. + // Again, it's a dynamically generated (same domain) iframe, loading an external Flash swf. + // Not sure why that's a security issue, but apparently it is. + iDoc.write(librevjs.Flash.getEmbedCode(options['swf'], flashVars, params, attributes)); + + // Setting variables on the window needs to come after the doc write because otherwise they can get reset in some browsers + // So far no issues with swf ready event being called before it's set on the window. + iWin['player'] = this.player_; + + // Create swf ready function for iFrame window + iWin['ready'] = librevjs.bind(this.player_, function (currSwf) { + var el = iDoc.getElementById(currSwf), + player = this, + tech = player.tech; + + // Update reference to playback technology element + tech.el_ = el; + + // Make sure swf is actually ready. Sometimes the API isn't actually yet. + librevjs.Flash.checkReady(tech); + }); + + // Create event listener for all swf events + iWin['events'] = librevjs.bind(this.player_, function (swfID, eventName) { + var player = this; + if (player && player.techName === 'flash') { + player.trigger(eventName); + } + }); + + // Create error listener for all swf errors + iWin['errors'] = librevjs.bind(this.player_, function (swfID, eventName) { + librevjs.log('Flash Error', eventName); + }); + + })); + + // Replace placeholder with iFrame (it will load now) + placeHolder.parentNode.replaceChild(iFrm, placeHolder); + + // If not using iFrame mode, embed as normal object + } else { + librevjs.Flash.embed(options['swf'], placeHolder, flashVars, params, attributes); + } + } +}); + +librevjs.Flash.prototype.dispose = function () { + librevjs.MediaTechController.prototype.dispose.call(this); +}; + +librevjs.Flash.prototype.play = function () { + this.el_.librevjs_play(); +}; + +librevjs.Flash.prototype.pause = function () { + this.el_.librevjs_pause(); +}; + +librevjs.Flash.prototype.src = function (src) { + if (librevjs.Flash.isStreamingSrc(src)) { + src = librevjs.Flash.streamToParts(src); + this.setRtmpConnection(src.connection); + this.setRtmpStream(src.stream); + } else { + // Make sure source URL is abosolute. + src = librevjs.getAbsoluteURL(src); + this.el_.librevjs_src(src); + } + + // Currently the SWF doesn't autoplay if you load a source later. + // e.g. Load player w/ no source, wait 2s, set src. + if (this.player_.autoplay()) { + var tech = this; + setTimeout(function () { + tech.play(); + }, 0); + } +}; + +librevjs.Flash.prototype.currentSrc = function () { + var src = this.el_.librevjs_getProperty('currentSrc'); + // no src, check and see if RTMP + if (src == null) { + var connection = this.rtmpConnection(), + stream = this.rtmpStream(); + + if (connection && stream) { + src = librevjs.Flash.streamFromParts(connection, stream); + } + } + return src; +}; + +librevjs.Flash.prototype.load = function () { + this.el_.librevjs_load(); +}; + +librevjs.Flash.prototype.poster = function () { + this.el_.librevjs_getProperty('poster'); +}; + +librevjs.Flash.prototype.buffered = function () { + return librevjs.createTimeRange(0, this.el_.librevjs_getProperty('buffered')); +}; + +librevjs.Flash.prototype.supportsFullScreen = function () { + return false; // Flash does not allow fullscreen through javascript +}; + +librevjs.Flash.prototype.enterFullScreen = function () { + return false; +}; + + +// Create setters and getters for attributes +var api = librevjs.Flash.prototype, + readWrite = 'rtmpConnection,rtmpStream,preload,currentTime,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted'.split(','), + readOnly = 'error,currentSrc,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks'.split(','); +// Overridden: buffered + +/** + * @this {*} + */ +var createSetter = function (attr) { + var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1); + api['set' + attrUpper] = function (val) { + return this.el_.librevjs_setProperty(attr, val); + }; +}; + +/** + * @this {*} + */ +var createGetter = function (attr) { + api[attr] = function () { + return this.el_.librevjs_getProperty(attr); + }; +}; + +(function () { + var i; + // Create getter and setters for all read/write attributes + for (i = 0; i < readWrite.length; i++) { + createGetter(readWrite[i]); + createSetter(readWrite[i]); + } + + // Create getters for read-only attributes + for (i = 0; i < readOnly.length; i++) { + createGetter(readOnly[i]); + } +})(); + +/* MediaLoader REQUIRED*/ +/** + * @constructor + */ +librevjs.MediaLoader = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.Component.call(this, player, options, ready); + + // If there are no sources when the player is initialized, + // load the first supported playback technology. + if (!player.options_['sources'] || player.options_['sources'].length === 0) { + for (var i = 0, j = player.options_['techOrder']; i < j.length; i++) { + var techName = librevjs.capitalize(j[i]), + tech = window['cliplibrejs'][techName]; + + // Check if the browser supports this technology + if (tech && tech.isSupported()) { + player.loadTech(techName); + break; + } + } + } else { + // // Loop through playback technologies (HTML5, Flash) and check for support. + // // Then load the best source. + // // A few assumptions here: + // // All playback technologies respect preload false. + player.src(player.options_['sources']); + } + } +}); +/** + * @fileoverview Text Tracks + * Text tracks are tracks of timed text events. + * Captions - text displayed over the video for the hearing impared + * Subtitles - text displayed over the video for those who don't understand langauge in the video + * Chapters - text displayed in a menu allowing the user to jump to particular points (chapters) in the video + * Descriptions (not supported yet) - audio descriptions that are read back to the user by a screen reading device + */ + +// Player Additions - Functions add to the player object for easier access to tracks + +/** + * List of associated text tracks + * @type {Array} + * @private + */ +librevjs.Player.prototype.textTracks_; + +/** + * Get an array of associated text tracks. captions, subtitles, chapters, descriptions + * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks + * @return {Array} Array of track objects + */ +librevjs.Player.prototype.textTracks = function () { + this.textTracks_ = this.textTracks_ || []; + return this.textTracks_; +}; + +/** + * Add a text track + * In addition to the W3C settings we allow adding additional info through options. + * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack + * @param {String} kind Captions, subtitles, chapters, descriptions, or metadata + * @param {String=} label Optional label + * @param {String=} language Optional language + * @param {Object=} options Additional track options, like src + */ +librevjs.Player.prototype.addTextTrack = function (kind, label, language, options) { + var tracks = this.textTracks_ = this.textTracks_ || []; + options = options || {}; + + options['kind'] = kind; + options['label'] = label; + options['language'] = language; + + // HTML5 Spec says default to subtitles. + // Uppercase first letter to match class names + var Kind = librevjs.capitalize(kind || 'subtitles'); + + // Create correct texttrack class. CaptionsTrack, etc. + var track = new window['cliplibrejs'][Kind + 'Track'](this, options); + + tracks.push(track); + + // If track.dflt() is set, start showing immediately + // TODO: Add a process to deterime the best track to show for the specific kind + // Incase there are mulitple defaulted tracks of the same kind + // Or the user has a set preference of a specific language that should override the default + // if (track.dflt()) { + // this.ready(librevjs.bind(track, track.show)); + // } + + return track; +}; + +/** + * Add an array of text tracks. captions, subtitles, chapters, descriptions + * Track objects will be stored in the player.textTracks() array + * @param {Array} trackList Array of track elements or objects (fake track elements) + */ +librevjs.Player.prototype.addTextTracks = function (trackList) { + var trackObj; + + for (var i = 0; i < trackList.length; i++) { + trackObj = trackList[i]; + this.addTextTrack(trackObj['kind'], trackObj['label'], trackObj['language'], trackObj); + } + + return this; +}; + +// Show a text track +// disableSameKind: disable all other tracks of the same kind. Value should be a track kind (captions, etc.) +librevjs.Player.prototype.showTextTrack = function (id, disableSameKind) { + var tracks = this.textTracks_, + i = 0, + j = tracks.length, + track, showTrack, kind; + + // Find Track with same ID + for (; i < j; i++) { + track = tracks[i]; + if (track.id() === id) { + track.show(); + showTrack = track; + + // Disable tracks of the same kind + } else if (disableSameKind && track.kind() == disableSameKind && track.mode() > 0) { + track.disable(); + } + } + + // Get track kind from shown track or disableSameKind + kind = (showTrack) ? showTrack.kind() : ((disableSameKind) ? disableSameKind : false); + + // Trigger trackchange event, captionstrackchange, subtitlestrackchange, etc. + if (kind) { + this.trigger(kind + 'trackchange'); + } + + return this; +}; + +/** + * Track Class + * Contains track methods for loading, showing, parsing cues of tracks + * @param {librevjs.Player|Object} player + * @param {Object=} options + * @constructor + */ +librevjs.TextTrack = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.Component.call(this, player, options); + + // Apply track info to track object + // Options will often be a track element + + // Build ID if one doesn't exist + this.id_ = options['id'] || ('librevjs_' + options['kind'] + '_' + options['language'] + '_' + librevjs.guid++); + this.src_ = options['src']; + // 'default' is a reserved keyword in js so we use an abbreviated version + this.dflt_ = options['default'] || options['dflt']; + this.title_ = options['title']; + this.language_ = options['srclang']; + this.label_ = options['label']; + this.cues_ = []; + this.activeCues_ = []; + this.readyState_ = 0; + this.mode_ = 0; + + this.player_.on('fullscreenchange', librevjs.bind(this, this.adjustFontSize)); + } +}); + +/** + * Track kind value. Captions, subtitles, etc. + * @private + */ +librevjs.TextTrack.prototype.kind_; + +/** + * Get the track kind value + * @return {String} + */ +librevjs.TextTrack.prototype.kind = function () { + return this.kind_; +}; + +/** + * Track src value + * @private + */ +librevjs.TextTrack.prototype.src_; + +/** + * Get the track src value + * @return {String} + */ +librevjs.TextTrack.prototype.src = function () { + return this.src_; +}; + +/** + * Track default value + * If default is used, subtitles/captions to start showing + * @private + */ +librevjs.TextTrack.prototype.dflt_; + +/** + * Get the track default value + * 'default' is a reserved keyword + * @return {Boolean} + */ +librevjs.TextTrack.prototype.dflt = function () { + return this.dflt_; +}; + +/** + * Track title value + * @private + */ +librevjs.TextTrack.prototype.title_; + +/** + * Get the track title value + * @return {String} + */ +librevjs.TextTrack.prototype.title = function () { + return this.title_; +}; + +/** + * Language - two letter string to represent track language, e.g. 'en' for English + * Spec def: readonly attribute DOMString language; + * @private + */ +librevjs.TextTrack.prototype.language_; + +/** + * Get the track language value + * @return {String} + */ +librevjs.TextTrack.prototype.language = function () { + return this.language_; +}; + +/** + * Track label e.g. 'English' + * Spec def: readonly attribute DOMString label; + * @private + */ +librevjs.TextTrack.prototype.label_; + +/** + * Get the track label value + * @return {String} + */ +librevjs.TextTrack.prototype.label = function () { + return this.label_; +}; + +/** + * All cues of the track. Cues have a startTime, endTime, text, and other properties. + * Spec def: readonly attribute TextTrackCueList cues; + * @private + */ +librevjs.TextTrack.prototype.cues_; + +/** + * Get the track cues + * @return {Array} + */ +librevjs.TextTrack.prototype.cues = function () { + return this.cues_; +}; + +/** + * ActiveCues is all cues that are currently showing + * Spec def: readonly attribute TextTrackCueList activeCues; + * @private + */ +librevjs.TextTrack.prototype.activeCues_; + +/** + * Get the track active cues + * @return {Array} + */ +librevjs.TextTrack.prototype.activeCues = function () { + return this.activeCues_; +}; + +/** + * ReadyState describes if the text file has been loaded + * const unsigned short NONE = 0; + * const unsigned short LOADING = 1; + * const unsigned short LOADED = 2; + * const unsigned short ERROR = 3; + * readonly attribute unsigned short readyState; + * @private + */ +librevjs.TextTrack.prototype.readyState_; + +/** + * Get the track readyState + * @return {Number} + */ +librevjs.TextTrack.prototype.readyState = function () { + return this.readyState_; +}; + +/** + * Mode describes if the track is showing, hidden, or disabled + * const unsigned short OFF = 0; + * const unsigned short HIDDEN = 1; (still triggering cuechange events, but not visible) + * const unsigned short SHOWING = 2; + * attribute unsigned short mode; + * @private + */ +librevjs.TextTrack.prototype.mode_; + +/** + * Get the track mode + * @return {Number} + */ +librevjs.TextTrack.prototype.mode = function () { + return this.mode_; +}; + +/** + * Change the font size of the text track to make it larger when playing in fullscreen mode + * and restore it to its normal size when not in fullscreen mode. + */ +librevjs.TextTrack.prototype.adjustFontSize = function () { + if (this.player_.isFullScreen) { + // Scale the font by the same factor as increasing the video width to the full screen window width. + // Additionally, multiply that factor by 1.8, which is the default font size for + // the caption track (from the CSS) + this.el_.style.fontSize = screen.width / this.player_.width() * 2.5 * 100 + '%'; + } else { + // Change the font size of the text track back to its original non-fullscreen size + this.el_.style.fontSize = ''; + } +}; + +/** + * Create basic div to hold cue text + * @return {Element} + */ +librevjs.TextTrack.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-' + this.kind_ + ' librevjs-text-track' + }); +}; + +/** + * Show: Mode Showing (2) + * Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. + * The user agent is maintaining a list of which cues are active, and events are being fired accordingly. + * In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate; + * for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; + * and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue. + * The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute. + * This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences. + */ +librevjs.TextTrack.prototype.show = function () { + this.activate(); + + this.mode_ = 2; + + // Show element. + librevjs.Component.prototype.show.call(this); +}; + +/** + * Hide: Mode Hidden (1) + * Indicates that the text track is active, but that the user agent is not actively displaying the cues. + * If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. + * The user agent is maintaining a list of which cues are active, and events are being fired accordingly. + */ +librevjs.TextTrack.prototype.hide = function () { + // When hidden, cues are still triggered. Disable to stop triggering. + this.activate(); + + this.mode_ = 1; + + // Hide element. + librevjs.Component.prototype.hide.call(this); +}; + +/** + * Disable: Mode Off/Disable (0) + * Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. + * No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues. + */ +librevjs.TextTrack.prototype.disable = function () { + // If showing, hide. + if (this.mode_ == 2) { + this.hide(); + } + + // Stop triggering cues + this.deactivate(); + + // Switch Mode to Off + this.mode_ = 0; +}; + +/** + * Turn on cue tracking. Tracks that are showing OR hidden are active. + */ +librevjs.TextTrack.prototype.activate = function () { + // Load text file if it hasn't been yet. + if (this.readyState_ === 0) { + this.load(); + } + + // Only activate if not already active. + if (this.mode_ === 0) { + // Update current cue on timeupdate + // Using unique ID for bind function so other tracks don't remove listener + this.player_.on('timeupdate', librevjs.bind(this, this.update, this.id_)); + + // Reset cue time on media end + this.player_.on('ended', librevjs.bind(this, this.reset, this.id_)); + + // Add to display + if (this.kind_ === 'captions' || this.kind_ === 'subtitles') { + this.player_.getChild('textTrackDisplay').addChild(this); + } + } +}; + +/** + * Turn off cue tracking. + */ +librevjs.TextTrack.prototype.deactivate = function () { + // Using unique ID for bind function so other tracks don't remove listener + this.player_.off('timeupdate', librevjs.bind(this, this.update, this.id_)); + this.player_.off('ended', librevjs.bind(this, this.reset, this.id_)); + this.reset(); // Reset + + // Remove from display + this.player_.getChild('textTrackDisplay').removeChild(this); +}; + +// A readiness state +// One of the following: +// +// Not loaded +// Indicates that the text track is known to exist (e.g. it has been declared with a track element), but its cues have not been obtained. +// +// Loading +// Indicates that the text track is loading and there have been no fatal errors encountered so far. Further cues might still be added to the track. +// +// Loaded +// Indicates that the text track has been loaded with no fatal errors. No new cues will be added to the track except if the text track corresponds to a MutableTextTrack object. +// +// Failed to load +// Indicates that the text track was enabled, but when the user agent attempted to obtain it, this failed in some way (e.g. URL could not be resolved, network error, unknown text track format). Some or all of the cues are likely missing and will not be obtained. +librevjs.TextTrack.prototype.load = function () { + + // Only load if not loaded yet. + if (this.readyState_ === 0) { + this.readyState_ = 1; + librevjs.get(this.src_, librevjs.bind(this, this.parseCues), librevjs.bind(this, this.onError)); + } + +}; + +librevjs.TextTrack.prototype.onError = function (err) { + this.error = err; + this.readyState_ = 3; + this.trigger('error'); +}; + +// Parse the WebVTT text format for cue times. +// TODO: Separate parser into own class so alternative timed text formats can be used. (TTML, DFXP) +librevjs.TextTrack.prototype.parseCues = function (srcContent) { + var cue, time, text, + lines = srcContent.split('\n'), + line = '', + id; + + for (var i = 1, j = lines.length; i < j; i++) { + // Line 0 should be 'WEBVTT', so skipping i=0 + + line = librevjs.trim(lines[i]); // Trim whitespace and linebreaks + + if (line) { // Loop until a line with content + + // First line could be an optional cue ID + // Check if line has the time separator + if (line.indexOf('-->') == -1) { + id = line; + // Advance to next line for timing. + line = librevjs.trim(lines[++i]); + } else { + id = this.cues_.length; + } + + // First line - Number + cue = { + id: id, // Cue Number + index: this.cues_.length // Position in Array + }; + + // Timing line + time = line.split(' --> '); + cue.startTime = this.parseCueTime(time[0]); + cue.endTime = this.parseCueTime(time[1]); + + // Additional lines - Cue Text + text = []; + + // Loop until a blank line or end of lines + // Assumeing trim('') returns false for blank lines + while (lines[++i] && (line = librevjs.trim(lines[i]))) { + text.push(line); + } + + cue.text = text.join('<br/>'); + + // Add this cue + this.cues_.push(cue); + } + } + + this.readyState_ = 2; + this.trigger('loaded'); +}; + + +librevjs.TextTrack.prototype.parseCueTime = function (timeText) { + var parts = timeText.split(':'), + time = 0, + hours, minutes, other, seconds, ms; + + // Check if optional hours place is included + // 00:00:00.000 vs. 00:00.000 + if (parts.length == 3) { + hours = parts[0]; + minutes = parts[1]; + other = parts[2]; + } else { + hours = 0; + minutes = parts[0]; + other = parts[1]; + } + + // Break other (seconds, milliseconds, and flags) by spaces + // TODO: Make additional cue layout settings work with flags + other = other.split(/\s+/); + // Remove seconds. Seconds is the first part before any spaces. + seconds = other.splice(0, 1)[0]; + // Could use either . or , for decimal + seconds = seconds.split(/\.|,/); + // Get milliseconds + ms = parseFloat(seconds[1]); + seconds = seconds[0]; + + // hours => seconds + time += parseFloat(hours) * 3600; + // minutes => seconds + time += parseFloat(minutes) * 60; + // Add seconds + time += parseFloat(seconds); + // Add milliseconds + if (ms) { + time += ms / 1000; + } + + return time; +}; + +// Update active cues whenever timeupdate events are triggered on the player. +librevjs.TextTrack.prototype.update = function () { + if (this.cues_.length > 0) { + + // Get curent player time + var time = this.player_.currentTime(); + + // Check if the new time is outside the time box created by the the last update. + if (this.prevChange === undefined || time < this.prevChange || this.nextChange <= time) { + var cues = this.cues_, + + // Create a new time box for this state. + newNextChange = this.player_.duration(), // Start at beginning of the timeline + newPrevChange = 0, // Start at end + + reverse = false, // Set the direction of the loop through the cues. Optimized the cue check. + newCues = [], // Store new active cues. + + // Store where in the loop the current active cues are, to provide a smart starting point for the next loop. + firstActiveIndex, lastActiveIndex, + cue, i; // Loop vars + + // Check if time is going forwards or backwards (scrubbing/rewinding) + // If we know the direction we can optimize the starting position and direction of the loop through the cues array. + if (time >= this.nextChange || this.nextChange === undefined) { // NextChange should happen + // Forwards, so start at the index of the first active cue and loop forward + i = (this.firstActiveIndex !== undefined) ? this.firstActiveIndex : 0; + } else { + // Backwards, so start at the index of the last active cue and loop backward + reverse = true; + i = (this.lastActiveIndex !== undefined) ? this.lastActiveIndex : cues.length - 1; + } + + while (true) { // Loop until broken + cue = cues[i]; + + // Cue ended at this point + if (cue.endTime <= time) { + newPrevChange = Math.max(newPrevChange, cue.endTime); + + if (cue.active) { + cue.active = false; + } + + // No earlier cues should have an active start time. + // Nevermind. Assume first cue could have a duration the same as the video. + // In that case we need to loop all the way back to the beginning. + // if (reverse && cue.startTime) { break; } + + // Cue hasn't started + } else if (time < cue.startTime) { + newNextChange = Math.min(newNextChange, cue.startTime); + + if (cue.active) { + cue.active = false; + } + + // No later cues should have an active start time. + if (!reverse) { + break; + } + + // Cue is current + } else { + + if (reverse) { + // Add cue to front of array to keep in time order + newCues.splice(0, 0, cue); + + // If in reverse, the first current cue is our lastActiveCue + if (lastActiveIndex === undefined) { + lastActiveIndex = i; + } + firstActiveIndex = i; + } else { + // Add cue to end of array + newCues.push(cue); + + // If forward, the first current cue is our firstActiveIndex + if (firstActiveIndex === undefined) { + firstActiveIndex = i; + } + lastActiveIndex = i; + } + + newNextChange = Math.min(newNextChange, cue.endTime); + newPrevChange = Math.max(newPrevChange, cue.startTime); + + cue.active = true; + } + + if (reverse) { + // Reverse down the array of cues, break if at first + if (i === 0) { + break; + } else { + i--; + } + } else { + // Walk up the array fo cues, break if at last + if (i === cues.length - 1) { + break; + } else { + i++; + } + } + + } + + this.activeCues_ = newCues; + this.nextChange = newNextChange; + this.prevChange = newPrevChange; + this.firstActiveIndex = firstActiveIndex; + this.lastActiveIndex = lastActiveIndex; + + this.updateDisplay(); + + this.trigger('cuechange'); + } + } +}; + +// Add cue HTML to display +librevjs.TextTrack.prototype.updateDisplay = function () { + var cues = this.activeCues_, + html = '', + i = 0, + j = cues.length; + + for (; i < j; i++) { + html += '<span class="librevjs-tt-cue">' + cues[i].text + '</span>'; + } + + this.el_.innerHTML = html; +}; + +// Set all loop helper values back +librevjs.TextTrack.prototype.reset = function () { + this.nextChange = 0; + this.prevChange = this.player_.duration(); + this.firstActiveIndex = 0; + this.lastActiveIndex = 0; +}; + +// Create specific track types +/** + * @constructor + */ +librevjs.CaptionsTrack = librevjs.TextTrack.extend(); +librevjs.CaptionsTrack.prototype.kind_ = 'captions'; +// Exporting here because Track creation requires the track kind +// to be available on global object. e.g. new window['cliplibrejs'][Kind + 'Track'] + +/** + * @constructor + */ +librevjs.SubtitlesTrack = librevjs.TextTrack.extend(); +librevjs.SubtitlesTrack.prototype.kind_ = 'subtitles'; + +/** + * @constructor + */ +librevjs.ChaptersTrack = librevjs.TextTrack.extend(); +librevjs.ChaptersTrack.prototype.kind_ = 'chapters'; + + +/* Text Track Display +============================================================================= */ +// Global container for both subtitle and captions text. Simple div container. + +/** + * @constructor + */ +librevjs.TextTrackDisplay = librevjs.Component.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.Component.call(this, player, options, ready); + + // This used to be called during player init, but was causing an error + // if a track should show by default and the display hadn't loaded yet. + // Should probably be moved to an external track loader when we support + // tracks that don't need a display. + if (player.options_['tracks'] && player.options_['tracks'].length > 0) { + this.player_.addTextTracks(player.options_['tracks']); + } + } +}); + +librevjs.TextTrackDisplay.prototype.createEl = function () { + return librevjs.Component.prototype.createEl.call(this, 'div', { + className: 'librevjs-text-track-display' + }); +}; + + +/* Text Track Menu Items +============================================================================= */ +/** + * @constructor + */ +librevjs.TextTrackMenuItem = librevjs.MenuItem.extend({ + /** @constructor */ + init: function (player, options) { + var track = this.track = options['track']; + + // Modify options for parent MenuItem class's init. + options['label'] = track.label(); + options['selected'] = track.dflt(); + librevjs.MenuItem.call(this, player, options); + + this.player_.on(track.kind() + 'trackchange', librevjs.bind(this, this.update)); + /** + * @author Jesús Eduardo + * my modification: + */ + if (track.dflt()) { + this.player_.showTextTrack(this.track.id_, this.track.kind()); + } + } +}); + +librevjs.TextTrackMenuItem.prototype.onClick = function () { + librevjs.MenuItem.prototype.onClick.call(this); + this.player_.showTextTrack(this.track.id_, this.track.kind()); +}; + +librevjs.TextTrackMenuItem.prototype.update = function () { + this.selected(this.track.mode() == 2); +}; + +/** + * @constructor + */ +librevjs.OffTextTrackMenuItem = librevjs.TextTrackMenuItem.extend({ + /** @constructor */ + init: function (player, options) { + // Create pseudo track info + // Requires options['kind'] + options['track'] = { + kind: function () { + return options['kind']; + }, + player: player, + label: function () { + return options['kind'] + ' off'; + }, + dflt: function () { + return false; + }, + mode: function () { + return false; + } + }; + librevjs.TextTrackMenuItem.call(this, player, options); + this.selected(true); + } +}); + +librevjs.OffTextTrackMenuItem.prototype.onClick = function () { + librevjs.TextTrackMenuItem.prototype.onClick.call(this); + this.player_.showTextTrack(this.track.id_, this.track.kind()); +}; + +librevjs.OffTextTrackMenuItem.prototype.update = function () { + var tracks = this.player_.textTracks(), + i = 0, + j = tracks.length, + track, + off = true; + + for (; i < j; i++) { + track = tracks[i]; + if (track.kind() == this.track.kind() && track.mode() == 2) { + off = false; + } + } + + this.selected(off); +}; + +/* Captions Button +================================================================================ */ +/** + * @constructor + */ +librevjs.TextTrackButton = librevjs.MenuButton.extend({ + /** @constructor */ + init: function (player, options) { + librevjs.MenuButton.call(this, player, options); + + if (this.items.length <= 1) { + this.hide(); + } + } +}); + +// librevjs.TextTrackButton.prototype.buttonPressed = false; + +// librevjs.TextTrackButton.prototype.createMenu = function(){ +// var menu = new librevjs.Menu(this.player_); + +// // Add a title list item to the top +// // menu.el().appendChild(librevjs.createEl('li', { +// // className: 'librevjs-menu-title', +// // innerHTML: librevjs.capitalize(this.kind_), +// // tabindex: -1 +// // })); + +// this.items = this.createItems(); + +// // Add menu items to the menu +// for (var i = 0; i < this.items.length; i++) { +// menu.addItem(this.items[i]); +// } + +// // Add list to element +// this.addChild(menu); + +// return menu; +// }; + +// Create a menu item for each text track +librevjs.TextTrackButton.prototype.createItems = function () { + var items = [], + track; + + // Add an OFF menu item to turn all tracks off + items.push(new librevjs.OffTextTrackMenuItem(this.player_, { + 'kind': this.kind_ + })); + + for (var i = 0; i < this.player_.textTracks().length; i++) { + track = this.player_.textTracks()[i]; + if (track.kind() === this.kind_) { + items.push(new librevjs.TextTrackMenuItem(this.player_, { + 'track': track + })); + } + } + + return items; +}; + +/** + * @constructor + */ +librevjs.CaptionsButton = librevjs.TextTrackButton.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.TextTrackButton.call(this, player, options, ready); + this.el_.setAttribute('aria-label', 'Captions Menu'); + } +}); +librevjs.CaptionsButton.prototype.kind_ = 'captions'; +librevjs.CaptionsButton.prototype.buttonText = 'Captions'; +librevjs.CaptionsButton.prototype.className = 'librevjs-captions-button'; + +/** + * @constructor + */ +librevjs.SubtitlesButton = librevjs.TextTrackButton.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.TextTrackButton.call(this, player, options, ready); + this.el_.setAttribute('aria-label', 'Subtitles Menu'); + } +}); +librevjs.SubtitlesButton.prototype.kind_ = 'subtitles'; +librevjs.SubtitlesButton.prototype.buttonText = 'Subtitles'; +librevjs.SubtitlesButton.prototype.className = 'librevjs-subtitles-button'; + +// Chapters act much differently than other text tracks +// Cues are navigation vs. other tracks of alternative languages +/** + * @constructor + */ +librevjs.ChaptersButton = librevjs.TextTrackButton.extend({ + /** @constructor */ + init: function (player, options, ready) { + librevjs.TextTrackButton.call(this, player, options, ready); + this.el_.setAttribute('aria-label', 'Chapters Menu'); + } +}); +librevjs.ChaptersButton.prototype.kind_ = 'chapters'; +librevjs.ChaptersButton.prototype.buttonText = 'Chapters'; +librevjs.ChaptersButton.prototype.className = 'librevjs-chapters-button'; + +// Create a menu item for each text track +librevjs.ChaptersButton.prototype.createItems = function () { + var items = [], + track; + + for (var i = 0; i < this.player_.textTracks().length; i++) { + track = this.player_.textTracks()[i]; + if (track.kind() === this.kind_) { + items.push(new librevjs.TextTrackMenuItem(this.player_, { + 'track': track + })); + } + } + + return items; +}; + +librevjs.ChaptersButton.prototype.createMenu = function () { + var tracks = this.player_.textTracks(), + i = 0, + j = tracks.length, + track, chaptersTrack, + items = this.items = []; + + for (; i < j; i++) { + track = tracks[i]; + if (track.kind() == this.kind_ && track.dflt()) { + if (track.readyState() < 2) { + this.chaptersTrack = track; + track.on('loaded', librevjs.bind(this, this.createMenu)); + return; + } else { + chaptersTrack = track; + break; + } + } + } + + var menu = this.menu = new librevjs.Menu(this.player_); + + menu.el_.appendChild(librevjs.createEl('li', { + className: 'librevjs-menu-title', + innerHTML: librevjs.capitalize(this.kind_), + tabindex: -1 + })); + + if (chaptersTrack) { + var cues = chaptersTrack.cues_, + cue, mi; + i = 0; + j = cues.length; + + for (; i < j; i++) { + cue = cues[i]; + + mi = new librevjs.ChaptersTrackMenuItem(this.player_, { + 'track': chaptersTrack, + 'cue': cue + }); + + items.push(mi); + + menu.addChild(mi); + } + } + + if (this.items.length > 0) { + this.show(); + } + + return menu; +}; + + +/** + * @constructor + */ +librevjs.ChaptersTrackMenuItem = librevjs.MenuItem.extend({ + /** @constructor */ + init: function (player, options) { + var track = this.track = options['track'], + cue = this.cue = options['cue'], + currentTime = player.currentTime(); + + // Modify options for parent MenuItem class's init. + options['label'] = cue.text; + options['selected'] = (cue.startTime <= currentTime && currentTime < cue.endTime); + librevjs.MenuItem.call(this, player, options); + + track.on('cuechange', librevjs.bind(this, this.update)); + } +}); + +librevjs.ChaptersTrackMenuItem.prototype.onClick = function () { + librevjs.MenuItem.prototype.onClick.call(this); + this.player_.currentTime(this.cue.startTime); + this.update(this.cue.startTime); +}; + +librevjs.ChaptersTrackMenuItem.prototype.update = function () { + var cue = this.cue, + currentTime = this.player_.currentTime(); + + // librevjs.log(currentTime, cue.startTime); + this.selected(cue.startTime <= currentTime && currentTime < cue.endTime); +}; + +// Add Buttons to controlBar +librevjs.obj.merge(librevjs.ControlBar.prototype.options_['children'], { + 'subtitlesButton': {}, + 'captionsButton': {}, + 'chaptersButton': {} +}); + +// librevjs.Cue = librevjs.Component.extend({ +// /** @constructor */ +// init: function(player, options){ +// librevjs.Component.call(this, player, options); +// } +// }); +/** + * @fileoverview Add JSON support + * @suppress {undefinedVars} + * (Compiler doesn't like JSON not being declared) + */ + +/** + * Javascript JSON implementation + * (Parse Method Only) + * https://github.com/douglascrockford/JSON-js/blob/master/json2.js + * Only using for parse method when parsing data-setup attribute JSON. + * @type {Object} + * @suppress {undefinedVars} + */ +librevjs.JSON; + +/** + * @suppress {undefinedVars} + */ +if (typeof window.JSON !== 'undefined' && window.JSON.parse === 'function') { + librevjs.JSON = window.JSON; + +} else { + librevjs.JSON = {}; + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + + librevjs.JSON.parse = function (text, reviver) { + var j; + + function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + + if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + + j = eval('(' + text + ')'); + + return typeof reviver === 'function' ? walk({ + '': j + }, '') : j; + } + + throw new SyntaxError('JSON.parse(): invalid or malformed JSON data'); + }; +} +/** + * @fileoverview Functions for automatically setting up a player + * based on the data-setup attribute of the video tag + */ + +// Automatically set up any tags that have a data-setup attribute +librevjs.autoSetup = function () { + var options, vid, player, + vids = document.getElementsByTagName('video'); + + // Check if any media elements exist + if (vids && vids.length > 0) { + + for (var i = 0, j = vids.length; i < j; i++) { + vid = vids[i]; + + // Check if element exists, has getAttribute func. + // IE seems to consider typeof el.getAttribute == 'object' instead of 'function' like expected, at least when loading the player immediately. + if (vid && vid.getAttribute) { + + // Make sure this player hasn't already been set up. + if (vid['player'] === undefined) { + options = vid.getAttribute('data-setup'); + + // Check if data-setup attr exists. + // We only auto-setup if they've added the data-setup attr. + if (options !== null) { + + // Parse options JSON + // If empty string, make it a parsable json object. + options = librevjs.JSON.parse(options || '{}'); + + // Create new video.js instance. + player = cliplibrejs(vid, options); + } + } + + // If getAttribute isn't defined, we need to wait for the DOM. + } else { + librevjs.autoSetupTimeout(1); + break; + } + } + + // No videos were found, so keep looping unless page is finisehd loading. + } else if (!librevjs.windowLoaded) { + librevjs.autoSetupTimeout(1); + } +}; + +// Pause to let the DOM keep processing +librevjs.autoSetupTimeout = function (wait) { + setTimeout(librevjs.autoSetup, wait); +}; + +if (document.readyState === 'complete') { + librevjs.windowLoaded = true; +} else { + librevjs.one(window, 'load', function () { + librevjs.windowLoaded = true; + }); +} + +// Run Auto-load players +// You have to wait at least once in case this script is loaded after your video in the DOM (weird behavior only with minified version) +librevjs.autoSetupTimeout(1); +librevjs.plugin = function (name, init) { + librevjs.Player.prototype[name] = init; +}; +/* Selector Quality +@base: https://github.com/dominic-p/videojs-resolution-selector +================================================================================ */ +(function (_V_) { + /*********************************************************************************** + * Define some helper functions + ***********************************************************************************/ + var methods = { + /** + * Utility function for merging 2 objects recursively. It treats + * arrays like plain objects and it relies on a for...in loop which will + * break if the Object prototype is messed with. + * + * @param (object) destination The object to modify and return + * @param (object) source The object to use to overwrite the first + * object + * + * @returns (object) The modified first object is returned + */ + extend: function (destination, source) { + for (var prop in source) { + // Sanity check + if (!source.hasOwnProperty(prop)) { + continue; + } + + // Enable recursive (deep) object extension + if (typeof source[prop] == 'object' && null !== source[prop]) { + destination[prop] = methods.extend(destination[prop] || {}, source[prop]); + } else { + destination[prop] = source[prop]; + } + } + return destination; + }, + + /** + * In a future version, this can be made more intelligent, + * but for now, we'll just add a "p" at the end if we are passed + * numbers. + * + * @param (string) res The resolution to make a label for + * + * @returns (string) The label text string + */ + res_label: function (res) { + return (/^\d+$/.test(res)) ? res + 'p' : res; + }, + matchResolution: function (resStack, res) {}, + + /** + * returns a dummy object that implements the basic get/set + * functionality of the Cookies library. Used in the case where + * the Cookies library is not present + */ + buildCookiesDummy: function () { + return { + get: function (key) { + return ""; + }, + set: function (key, val) { + return false; + } + }; + } + }; + + /*********************************************************************************** + * Setup our resolution menu items + ***********************************************************************************/ + _V_.ResolutionMenuItem = _V_.MenuItem.extend({ + + /** @constructor */ + init: function (player, options) { + + // Modify options for parent MenuItem class's init. + options.label = methods.res_label(options.res); + options.selected = (options.res.toString() === player.getCurrentRes().toString()); + + // Call the parent constructor + _V_.MenuItem.call(this, player, options); + + // Store the resolution as a call property + this.resolution = options.res; + + // Register our click handler + this.on('click', this.onClick); + + // Toggle the selected class whenever the resolution changes + player.on('changeRes', _V_.bind(this, function () { + if (this.resolution == player.getCurrentRes()) { + this.selected(true); + } else { + this.selected(false); + } + })); + } + }); + + // Handle clicks on the menu items + _V_.ResolutionMenuItem.prototype.onClick = function () { + var player = this.player(), + video_el = player.el().firstChild, + current_time = player.currentTime(), + is_paused = player.paused(), + button_nodes = player.controlBar.resolutionSelector.el().firstChild.children, + button_node_count = button_nodes.length; + + // Do nothing if we aren't changing resolutions + if (player.getCurrentRes() == this.resolution) { + return; + } + + // Make sure the loadedmetadata event will fire + if ('none' == video_el.preload) { + video_el.preload = 'metadata'; + } + + // Change the source and make sure we don't start the video over + player.src(player.availableRes[this.resolution]).one('loadedmetadata', function () { + player.currentTime(current_time); + if (!is_paused) { + player.play(); + } + }); + + // Save the newly selected resolution in our player options property + player.currentRes = this.resolution; + + // Update the button text + while (button_node_count > 0) { + button_node_count--; + if ('librevjs-current-res' == button_nodes[button_node_count].className) { + button_nodes[button_node_count].innerHTML = methods.res_label(this.resolution); + break; + } + } + + // Update the classes to reflect the currently selected resolution + player.trigger('changeRes'); + }; + + /*********************************************************************************** + * Setup our resolution menu title item + ***********************************************************************************/ + _V_.ResolutionTitleMenuItem = _V_.MenuItem.extend({ + + init: function (player, options) { + + // Call the parent constructor + _V_.MenuItem.call(this, player, options); + + // No click handler for the menu title + this.off('click'); + } + }); + + /*********************************************************************************** + * Define our resolution selector button + ***********************************************************************************/ + _V_.ResolutionSelector = _V_.MenuButton.extend({ + + /** @constructor */ + init: function (player, options) { + + // Add our list of available resolutions to the player object + player.availableRes = options.available_res; + + // Call the parent constructor + _V_.MenuButton.call(this, player, options); + } + }); + + // Create a menu item for each available resolution + _V_.ResolutionSelector.prototype.createItems = function () { + + var player = this.player(), + items = [], + current_res; + + // Add the menu title item + items.push(new _V_.ResolutionTitleMenuItem(player, { + el: _V_.Component.prototype.createEl('li', { + className: 'librevjs-menu-title librevjs-res-menu-title', + innerHTML: 'Calidad' + }) + })); + + // Add an item for each available resolution + for (current_res in player.availableRes) { + // Don't add an item for the length attribute + if ('length' == current_res) { + continue; + } + items.push(new _V_.ResolutionMenuItem(player, { + res: current_res + })); + } + + // Sort the available resolutions in descending order + items.sort(function (a, b) { + if (typeof a.resolution == 'undefined') { + return -1; + } else { + return parseInt(b.resolution) - parseInt(a.resolution); + } + }); + return items; + }; + + /*********************************************************************************** + * Register the plugin with cliplibrejs, main plugin function + ***********************************************************************************/ + _V_.plugin('resolutionSelector', function (options) { + + // Only enable the plugin on HTML5 videos + if (!this.el().firstChild.canPlayType) { + return; + } + + var player = this, + sources = player.options().sources, + i = sources.length, + j, + found_type, + + // Override default options with those provided + settings = methods.extend({ + + default_res: '', // (string) The resolution that should be selected by default ( '480' or '480,1080,240' ) + force_types: false // (array) List of media types. If passed, we need to have source for each type in each resolution or that resolution will not be an option + + }, options || {}), + + available_res = { + length: 0 + }, + current_res, + resolutionSelector, + + // Split default resolutions if set and valid, otherwise default to an empty array + default_resolutions = (settings.default_res && typeof settings.default_res == 'string') ? settings.default_res.split(',') : [], + cookieNamespace = 'cliplibrejs.resolutionSelector', + resCookieName = cookieNamespace + '.res', + cookieRef = (typeof (Cookies) === "function") ? Cookies : methods.buildCookiesDummy(); + + // Get all of the available resoloutions + while (i > 0) { + + i--; + + // Skip sources that don't have data-res attributes + if (!sources[i]['data-res']) { + continue; + } + current_res = sources[i]['data-res']; + if (typeof available_res[current_res] !== 'object') { + available_res[current_res] = []; + available_res.length++; + } + available_res[current_res].push(sources[i]); + } + + // Check for forced types + if (settings.force_types) { + // Loop through all available resoultions + for (current_res in available_res) { + // Don't count the length property as a resolution + if ('length' == current_res) { + continue; + } + i = settings.force_types.length; + // For each resolution loop through the required types + while (i > 0) { + + i--; + + j = available_res[current_res].length; + found_types = 0; + + // For each required type loop through the available sources to check if its there + while (j > 0) { + + j--; + + if (settings.force_types[i] === available_res[current_res][j].type) { + found_types++; + } + } // End loop through current resolution sources + + if (found_types < settings.force_types.length) { + delete available_res[current_res]; + available_res.length--; + break; + } + } // End loop through required types + } // End loop through resolutions + } + + // Make sure we have at least 2 available resolutions before we add the button + if (available_res.length < 2) { + return; + } + + var resCookie = cookieRef.get(resCookieName) + if (resCookie) { + // rebuild the default_resolutions stack with the cookie's resolution on top + default_resolutions = [resCookie].concat(default_resolutions); + } + + // Loop through the choosen default resolutions if there were any + for (i = 0; i < default_resolutions.length; i++) { + // Set the video to start out with the first available default res + if (available_res[default_resolutions[i]]) { + player.src(available_res[default_resolutions[i]]); + player.currentRes = default_resolutions[i]; + break; + } + } + + // Helper function to get the current resolution + player.getCurrentRes = function () { + if (typeof player.currentRes !== 'undefined') { + return player.currentRes; + } else { + try { + return res = player.options().sources[0]['data-res']; + } catch (e) { + return ''; + } + } + }; + + // Get the started resolution + current_res = player.getCurrentRes(); + + if (current_res) { + current_res = methods.res_label(current_res); + } + + // Add the resolution selector button + resolutionSelector = new _V_.ResolutionSelector(player, { + el: _V_.Component.prototype.createEl(null, { + className: 'librevjs-res-button librevjs-menu-button librevjs-control', + innerHTML: '<div class="librevjs-control-content"><span class="librevjs-current-res">' + (current_res || 'Quality') + '</span></div>', + role: 'button', + 'aria-live': 'polite', // let the screen reader user know that the text of the button may change + tabIndex: 0 + }), + available_res: available_res + }); + + // Attach an event to remember previous res selection via cookie + this.on('changeRes', function () { + cookieRef.set(resCookieName, player.getCurrentRes()); + }); + + // Attach an event to update player.src once on loadedmetadata + // if a resolution was previously set + this.one('loadedmetadata', function () { + var resCookie = cookieRef.get(resCookieName); + + if (resCookie) { + player.src(player.availableRes[resCookie]); + player.currentRes = resCookie; + player.trigger('changeRes'); + } + }); + + // Add the button to the control bar object and the DOM + player.controlBar.resolutionSelector = player.controlBar.addChild(resolutionSelector); + }); +})(cliplibrejs); + +/* Hotkeys for LibreVideoJS +@base: https://github.com/ctd1500/videojs-hotkeys +================================================================================ */ +! function (e, t) { + "use strict"; + e.cliplibrejs_hotkeys = { + version: "0.2.5" //correction FullScreen + }; + var r = function (e) { + var t = this, + r = { + volumeStep: 0.1, + seekStep: 5, + enableMute: true, + enableFullscreen: true, + enableNumbers: true, + }; + e = e || {}; + var l = e.volumeStep || r.volumeStep, + n = e.seekStep || r.seekStep, + u = e.enableMute || r.enableMute, + a = e.enableFullscreen || r.enableFullscreen, + s = e.enableNumbers || r.enableNumbers; + t.el().hasAttribute("tabIndex") || t.el().setAttribute("tabIndex", "-1"), t.on("play", function () { + var e = t.el().querySelector(".iframeblocker"); + e && "" == e.style.display && (e.style.display = "block", e.style.bottom = "39px") + }); + var c = function (e) { + var r = e.which; + if (t.controls()) { + { + document.activeElement + } + switch (r) { + // Spacebar toggles play/pause + case 32: + e.preventDefault(), t.paused() ? t.play() : t.pause(); + break; + // Seeking with the left/right arrow keys + case 37: + // Left Arrow + e.preventDefault(); + var c = t.currentTime() - n; + t.currentTime() <= n && (c = 0), t.currentTime(c); + break; + case 39: + // Right Arrow + e.preventDefault(), t.currentTime(t.currentTime() + n); + break; + // Volume control with the up/down arrow keys + case 40: + // Down Arrow + e.preventDefault(), t.volume(t.volume() - l); + break; + case 38: + // Up Arrow + e.preventDefault(), t.volume(t.volume() + l); + break; + // Toggle Mute with the M key + case 77: + u && t.muted(t.muted() ? !1 : !0); + break; + // Toggle Fullscreen with the F key + case 70: + a && (t.isFullScreen ? t.player_.cancelFullScreen() : t.player_.requestFullScreen()); + break; + default: + // Number keys from 0-9 skip to a percentage of the video. 0 is 0% and 9 is 90% + if ((r > 47 && 59 > r || r > 95 && 106 > r) && s) { + var i = 48; + r > 95 && (i = 96); + var o = r - i; + e.preventDefault(), t.currentTime(t.duration() * o * .1) + } + } + } + }, i = function () { + t.controls() && a && (t.isFullScreen ? t.player_.cancelFullScreen() : t.player_.requestFullScreen()) + }; + return t.on("keydown", c), t.on("dblclick", i), this + }; + t.plugin("hotkeys", r) +}(window, window.cliplibrejs); + +/* cliplibrejs-progressTips for LibreVideoJS +@base: https://github.com/mickey/videojs-progressTips +================================================================================ */ +(function() { + + cliplibrejs.plugin('progressTips', function(options) { + var init; + init = function() { + var player, playerProgress, progressTip; + player = this; + playerProgress = $(player.controlBar.progressControl.el()); + progressTip = $('\ + <div class="librevjs-progress-tip">\ + <div class="librevjs-progress-tip-arrow"></div>\ + <div class="librevjs-progress-tip-inner"></div>\ + </div>\ + ').insertAfter(playerProgress); + playerProgress.on("mousemove", function(event) { + var barHeight, minutes, mousePosition, seconds, seekBar, timeInSeconds, tipCenter; + seekBar = $(player.controlBar.progressControl.seekBar.el()); + mousePosition = (event.pageX - seekBar.offset().left) / seekBar.width(); + timeInSeconds = mousePosition * player.duration(); + if (timeInSeconds === player.duration()) { + timeInSeconds = timeInSeconds - 0.1; + } + minutes = Math.floor(timeInSeconds / 60); + seconds = Math.floor(timeInSeconds - minutes * 60); + if (seconds < 10) { + seconds = "0" + seconds; + } + progressTip.find('.librevjs-progress-tip-inner').html("" + minutes + ":" + seconds); + barHeight = player.controlBar.height(); + tipCenter = progressTip.outerWidth() / 2; + progressTip.css("top", "" + (0 - barHeight - 15) + "px").css("left", "" + (event.pageX - $(this).offset().left - tipCenter) + "px").css("visibility", "visible"); + return; + }); + playerProgress.on("mouseout", function() { + progressTip.css("visibility", "hidden"); + }); + }; + this.on("loadedmetadata", init); + }); + +}).call(this); diff --git a/js/fecha.js b/js/fecha.js new file mode 100644 index 0000000..1eb2158 --- /dev/null +++ b/js/fecha.js @@ -0,0 +1,32 @@ +/*! + * @Source: fecha.js + * + * @licstart The following is the entire license notice for the + * JavaScript code in this page. + * + * Copyleft 2017 Jesus Eduardo + * + * The JavaScript code in this page is free software: you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License (GNU GPL) as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) + * any later version. The code is distributed WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + * + * As additional permission under GNU GPL version 3 section 7, you + * may distribute non-source (e.g., minimized or compacted) forms of + * that code without the copy of the GNU GPL normally required by + * section 4, provided you include this license notice and a URL + * through which recipients can access the Corresponding Source. + * + * @licend The above is the entire license notice + * for the JavaScript code in this page. + * + */ +var hoy = new Date(), + yyyy = hoy.getFullYear(); + +var anio = yyyy, + parrafo = document.getElementById('year'); +parrafo.innerHTML = anio; diff --git a/js/jquery-3.1.1.js b/js/jquery-3.1.1.js new file mode 100644 index 0000000..4378da9 --- /dev/null +++ b/js/jquery-3.1.1.js @@ -0,0 +1,3282 @@ +/*! + * @source: jQuery JavaScript Library v3.1.1 https://jquery.com/ + * + * @licstart The following is the entire license notice for the + * JavaScript code in this page. + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright (c) 2016 jQuery Foundation and other contributors + * + * 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. + * + * @licend The above is the entire license notice + * for the JavaScript code in this page. + * + */ +! function(a, b) { + "use strict"; + "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function(a) { + if (!a.document) throw new Error("jQuery requires a window with a document"); + return b(a) + } : b(a) +}("undefined" != typeof window ? window : this, function(a, b) { + "use strict"; + var c = [], + d = a.document, + e = Object.getPrototypeOf, + f = c.slice, + g = c.concat, + h = c.push, + i = c.indexOf, + j = {}, + k = j.toString, + l = j.hasOwnProperty, + m = l.toString, + n = m.call(Object), + o = {}; + + function p(a, b) { + b = b || d; + var c = b.createElement("script"); + c.text = a, b.head.appendChild(c).parentNode.removeChild(c) + } + var q = "3.1.1", + r = function(a, b) { + return new r.fn.init(a, b) + }, + s = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + t = /^-ms-/, + u = /-([a-z])/g, + v = function(a, b) { + return b.toUpperCase() + }; + r.fn = r.prototype = { + jquery: q, + constructor: r, + length: 0, + toArray: function() { + return f.call(this) + }, + get: function(a) { + return null == a ? f.call(this) : a < 0 ? this[a + this.length] : this[a] + }, + pushStack: function(a) { + var b = r.merge(this.constructor(), a); + return b.prevObject = this, b + }, + each: function(a) { + return r.each(this, a) + }, + map: function(a) { + return this.pushStack(r.map(this, function(b, c) { + return a.call(b, c, b) + })) + }, + slice: function() { + return this.pushStack(f.apply(this, arguments)) + }, + first: function() { + return this.eq(0) + }, + last: function() { + return this.eq(-1) + }, + eq: function(a) { + var b = this.length, + c = +a + (a < 0 ? b : 0); + return this.pushStack(c >= 0 && c < b ? [this[c]] : []) + }, + end: function() { + return this.prevObject || this.constructor() + }, + push: h, + sort: c.sort, + splice: c.splice + }, r.extend = r.fn.extend = function() { + var a, b, c, d, e, f, g = arguments[0] || {}, + h = 1, + i = arguments.length, + j = !1; + for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || r.isFunction(g) || (g = {}), h === i && (g = this, h--); h < i; h++) + if (null != (a = arguments[h])) + for (b in a) c = g[b], d = a[b], g !== d && (j && d && (r.isPlainObject(d) || (e = r.isArray(d))) ? (e ? (e = !1, f = c && r.isArray(c) ? c : []) : f = c && r.isPlainObject(c) ? c : {}, g[b] = r.extend(j, f, d)) : void 0 !== d && (g[b] = d)); + return g + }, r.extend({ + expando: "jQuery" + (q + Math.random()).replace(/\D/g, ""), + isReady: !0, + error: function(a) { + throw new Error(a) + }, + noop: function() {}, + isFunction: function(a) { + return "function" === r.type(a) + }, + isArray: Array.isArray, + isWindow: function(a) { + return null != a && a === a.window + }, + isNumeric: function(a) { + var b = r.type(a); + return ("number" === b || "string" === b) && !isNaN(a - parseFloat(a)) + }, + isPlainObject: function(a) { + var b, c; + return !(!a || "[object Object]" !== k.call(a)) && (!(b = e(a)) || (c = l.call(b, "constructor") && b.constructor, "function" == typeof c && m.call(c) === n)) + }, + isEmptyObject: function(a) { + var b; + for (b in a) return !1; + return !0 + }, + type: function(a) { + return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? j[k.call(a)] || "object" : typeof a + }, + globalEval: function(a) { + p(a) + }, + camelCase: function(a) { + return a.replace(t, "ms-").replace(u, v) + }, + nodeName: function(a, b) { + return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() + }, + each: function(a, b) { + var c, d = 0; + if (w(a)) { + for (c = a.length; d < c; d++) + if (b.call(a[d], d, a[d]) === !1) break + } else + for (d in a) + if (b.call(a[d], d, a[d]) === !1) break; + return a + }, + trim: function(a) { + return null == a ? "" : (a + "").replace(s, "") + }, + makeArray: function(a, b) { + var c = b || []; + return null != a && (w(Object(a)) ? r.merge(c, "string" == typeof a ? [a] : a) : h.call(c, a)), c + }, + inArray: function(a, b, c) { + return null == b ? -1 : i.call(b, a, c) + }, + merge: function(a, b) { + for (var c = +b.length, d = 0, e = a.length; d < c; d++) a[e++] = b[d]; + return a.length = e, a + }, + grep: function(a, b, c) { + for (var d, e = [], f = 0, g = a.length, h = !c; f < g; f++) d = !b(a[f], f), d !== h && e.push(a[f]); + return e + }, + map: function(a, b, c) { + var d, e, f = 0, + h = []; + if (w(a)) + for (d = a.length; f < d; f++) e = b(a[f], f, c), null != e && h.push(e); + else + for (f in a) e = b(a[f], f, c), null != e && h.push(e); + return g.apply([], h) + }, + guid: 1, + proxy: function(a, b) { + var c, d, e; + if ("string" == typeof b && (c = a[b], b = a, a = c), r.isFunction(a)) return d = f.call(arguments, 2), e = function() { + return a.apply(b || this, d.concat(f.call(arguments))) + }, e.guid = a.guid = a.guid || r.guid++, e + }, + now: Date.now, + support: o + }), "function" == typeof Symbol && (r.fn[Symbol.iterator] = c[Symbol.iterator]), r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(a, b) { + j["[object " + b + "]"] = b.toLowerCase() + }); + + function w(a) { + var b = !!a && "length" in a && a.length, + c = r.type(a); + return "function" !== c && !r.isWindow(a) && ("array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a) + } + var x = function(a) { + var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + 1 * new Date, + v = a.document, + w = 0, + x = 0, + y = ha(), + z = ha(), + A = ha(), + B = function(a, b) { + return a === b && (l = !0), 0 + }, + C = {}.hasOwnProperty, + D = [], + E = D.pop, + F = D.push, + G = D.push, + H = D.slice, + I = function(a, b) { + for (var c = 0, d = a.length; c < d; c++) + if (a[c] === b) return c; + return -1 + }, + J = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + K = "[\\x20\\t\\r\\n\\f]", + L = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + M = "\\[" + K + "*(" + L + ")(?:" + K + "*([*^$|!~]?=)" + K + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + L + "))|)" + K + "*\\]", + N = ":(" + L + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + M + ")*)|.*)\\)|)", + O = new RegExp(K + "+", "g"), + P = new RegExp("^" + K + "+|((?:^|[^\\\\])(?:\\\\.)*)" + K + "+$", "g"), + Q = new RegExp("^" + K + "*," + K + "*"), + R = new RegExp("^" + K + "*([>+~]|" + K + ")" + K + "*"), + S = new RegExp("=" + K + "*([^\\]'\"]*?)" + K + "*\\]", "g"), + T = new RegExp(N), + U = new RegExp("^" + L + "$"), + V = { + ID: new RegExp("^#(" + L + ")"), + CLASS: new RegExp("^\\.(" + L + ")"), + TAG: new RegExp("^(" + L + "|[*])"), + ATTR: new RegExp("^" + M), + PSEUDO: new RegExp("^" + N), + CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + K + "*(even|odd|(([+-]|)(\\d*)n|)" + K + "*(?:([+-]|)" + K + "*(\\d+)|))" + K + "*\\)|)", "i"), + bool: new RegExp("^(?:" + J + ")$", "i"), + needsContext: new RegExp("^" + K + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + K + "*((?:-\\d)?\\d*)" + K + "*\\)|)(?=[^-]|$)", "i") + }, + W = /^(?:input|select|textarea|button)$/i, + X = /^h\d$/i, + Y = /^[^{]+\{\s*\[native \w/, + Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + $ = /[+~]/, + _ = new RegExp("\\\\([\\da-f]{1,6}" + K + "?|(" + K + ")|.)", "ig"), + aa = function(a, b, c) { + var d = "0x" + b - 65536; + return d !== d || c ? b : d < 0 ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320) + }, + ba = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + ca = function(a, b) { + return b ? "\0" === a ? "\ufffd" : a.slice(0, -1) + "\\" + a.charCodeAt(a.length - 1).toString(16) + " " : "\\" + a + }, + da = function() { + m() + }, + ea = ta(function(a) { + return a.disabled === !0 && ("form" in a || "label" in a) + }, { + dir: "parentNode", + next: "legend" + }); + try { + G.apply(D = H.call(v.childNodes), v.childNodes), D[v.childNodes.length].nodeType + } catch (fa) { + G = { + apply: D.length ? function(a, b) { + F.apply(a, H.call(b)) + } : function(a, b) { + var c = a.length, + d = 0; + while (a[c++] = b[d++]); + a.length = c - 1 + } + } + } + + function ga(a, b, d, e) { + var f, h, j, k, l, o, r, s = b && b.ownerDocument, + w = b ? b.nodeType : 9; + if (d = d || [], "string" != typeof a || !a || 1 !== w && 9 !== w && 11 !== w) return d; + if (!e && ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, p)) { + if (11 !== w && (l = Z.exec(a))) + if (f = l[1]) { + if (9 === w) { + if (!(j = b.getElementById(f))) return d; + if (j.id === f) return d.push(j), d + } else if (s && (j = s.getElementById(f)) && t(b, j) && j.id === f) return d.push(j), d + } else { + if (l[2]) return G.apply(d, b.getElementsByTagName(a)), d; + if ((f = l[3]) && c.getElementsByClassName && b.getElementsByClassName) return G.apply(d, b.getElementsByClassName(f)), d + } + if (c.qsa && !A[a + " "] && (!q || !q.test(a))) { + if (1 !== w) s = b, r = a; + else if ("object" !== b.nodeName.toLowerCase()) { + (k = b.getAttribute("id")) ? k = k.replace(ba, ca): b.setAttribute("id", k = u), o = g(a), h = o.length; + while (h--) o[h] = "#" + k + " " + sa(o[h]); + r = o.join(","), s = $.test(a) && qa(b.parentNode) || b + } + if (r) try { + return G.apply(d, s.querySelectorAll(r)), d + } catch (x) {} finally { + k === u && b.removeAttribute("id") + } + } + } + return i(a.replace(P, "$1"), b, d, e) + } + + function ha() { + var a = []; + + function b(c, e) { + return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e + } + return b + } + + function ia(a) { + return a[u] = !0, a + } + + function ja(a) { + var b = n.createElement("fieldset"); + try { + return !!a(b) + } catch (c) { + return !1 + } finally { + b.parentNode && b.parentNode.removeChild(b), b = null + } + } + + function ka(a, b) { + var c = a.split("|"), + e = c.length; + while (e--) d.attrHandle[c[e]] = b + } + + function la(a, b) { + var c = b && a, + d = c && 1 === a.nodeType && 1 === b.nodeType && a.sourceIndex - b.sourceIndex; + if (d) return d; + if (c) + while (c = c.nextSibling) + if (c === b) return -1; + return a ? 1 : -1 + } + + function ma(a) { + return function(b) { + var c = b.nodeName.toLowerCase(); + return "input" === c && b.type === a + } + } + + function na(a) { + return function(b) { + var c = b.nodeName.toLowerCase(); + return ("input" === c || "button" === c) && b.type === a + } + } + + function oa(a) { + return function(b) { + return "form" in b ? b.parentNode && b.disabled === !1 ? "label" in b ? "label" in b.parentNode ? b.parentNode.disabled === a : b.disabled === a : b.isDisabled === a || b.isDisabled !== !a && ea(b) === a : b.disabled === a : "label" in b && b.disabled === a + } + } + + function pa(a) { + return ia(function(b) { + return b = +b, ia(function(c, d) { + var e, f = a([], c.length, b), + g = f.length; + while (g--) c[e = f[g]] && (c[e] = !(d[e] = c[e])) + }) + }) + } + + function qa(a) { + return a && "undefined" != typeof a.getElementsByTagName && a + } + c = ga.support = {}, f = ga.isXML = function(a) { + var b = a && (a.ownerDocument || a).documentElement; + return !!b && "HTML" !== b.nodeName + }, m = ga.setDocument = function(a) { + var b, e, g = a ? a.ownerDocument || a : v; + return g !== n && 9 === g.nodeType && g.documentElement ? (n = g, o = n.documentElement, p = !f(n), v !== n && (e = n.defaultView) && e.top !== e && (e.addEventListener ? e.addEventListener("unload", da, !1) : e.attachEvent && e.attachEvent("onunload", da)), c.attributes = ja(function(a) { + return a.className = "i", !a.getAttribute("className") + }), c.getElementsByTagName = ja(function(a) { + return a.appendChild(n.createComment("")), !a.getElementsByTagName("*").length + }), c.getElementsByClassName = Y.test(n.getElementsByClassName), c.getById = ja(function(a) { + return o.appendChild(a).id = u, !n.getElementsByName || !n.getElementsByName(u).length + }), c.getById ? (d.filter.ID = function(a) { + var b = a.replace(_, aa); + return function(a) { + return a.getAttribute("id") === b + } + }, d.find.ID = function(a, b) { + if ("undefined" != typeof b.getElementById && p) { + var c = b.getElementById(a); + return c ? [c] : [] + } + }) : (d.filter.ID = function(a) { + var b = a.replace(_, aa); + return function(a) { + var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id"); + return c && c.value === b + } + }, d.find.ID = function(a, b) { + if ("undefined" != typeof b.getElementById && p) { + var c, d, e, f = b.getElementById(a); + if (f) { + if (c = f.getAttributeNode("id"), c && c.value === a) return [f]; + e = b.getElementsByName(a), d = 0; + while (f = e[d++]) + if (c = f.getAttributeNode("id"), c && c.value === a) return [f] + } + return [] + } + }), d.find.TAG = c.getElementsByTagName ? function(a, b) { + return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0 + } : function(a, b) { + var c, d = [], + e = 0, + f = b.getElementsByTagName(a); + if ("*" === a) { + while (c = f[e++]) 1 === c.nodeType && d.push(c); + return d + } + return f + }, d.find.CLASS = c.getElementsByClassName && function(a, b) { + if ("undefined" != typeof b.getElementsByClassName && p) return b.getElementsByClassName(a) + }, r = [], q = [], (c.qsa = Y.test(n.querySelectorAll)) && (ja(function(a) { + o.appendChild(a).innerHTML = "<a id='" + u + "'></a><select id='" + u + "-\r\\' msallowcapture=''><option selected=''></option></select>", a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + K + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + K + "*(?:value|" + J + ")"), a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="), a.querySelectorAll(":checked").length || q.push(":checked"), a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]") + }), ja(function(a) { + a.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>"; + var b = n.createElement("input"); + b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + K + "*[*^$|!~]?="), 2 !== a.querySelectorAll(":enabled").length && q.push(":enabled", ":disabled"), o.appendChild(a).disabled = !0, 2 !== a.querySelectorAll(":disabled").length && q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:") + })), (c.matchesSelector = Y.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ja(function(a) { + c.disconnectedMatch = s.call(a, "*"), s.call(a, "[s!='']:x"), r.push("!=", N) + }), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = Y.test(o.compareDocumentPosition), t = b || Y.test(o.contains) ? function(a, b) { + var c = 9 === a.nodeType ? a.documentElement : a, + d = b && b.parentNode; + return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d))) + } : function(a, b) { + if (b) + while (b = b.parentNode) + if (b === a) return !0; + return !1 + }, B = b ? function(a, b) { + if (a === b) return l = !0, 0; + var d = !a.compareDocumentPosition - !b.compareDocumentPosition; + return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === n || a.ownerDocument === v && t(v, a) ? -1 : b === n || b.ownerDocument === v && t(v, b) ? 1 : k ? I(k, a) - I(k, b) : 0 : 4 & d ? -1 : 1) + } : function(a, b) { + if (a === b) return l = !0, 0; + var c, d = 0, + e = a.parentNode, + f = b.parentNode, + g = [a], + h = [b]; + if (!e || !f) return a === n ? -1 : b === n ? 1 : e ? -1 : f ? 1 : k ? I(k, a) - I(k, b) : 0; + if (e === f) return la(a, b); + c = a; + while (c = c.parentNode) g.unshift(c); + c = b; + while (c = c.parentNode) h.unshift(c); + while (g[d] === h[d]) d++; + return d ? la(g[d], h[d]) : g[d] === v ? -1 : h[d] === v ? 1 : 0 + }, n) : n + }, ga.matches = function(a, b) { + return ga(a, null, null, b) + }, ga.matchesSelector = function(a, b) { + if ((a.ownerDocument || a) !== n && m(a), b = b.replace(S, "='$1']"), c.matchesSelector && p && !A[b + " "] && (!r || !r.test(b)) && (!q || !q.test(b))) try { + var d = s.call(a, b); + if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType) return d + } catch (e) {} + return ga(b, n, null, [a]).length > 0 + }, ga.contains = function(a, b) { + return (a.ownerDocument || a) !== n && m(a), t(a, b) + }, ga.attr = function(a, b) { + (a.ownerDocument || a) !== n && m(a); + var e = d.attrHandle[b.toLowerCase()], + f = e && C.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0; + return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null + }, ga.escape = function(a) { + return (a + "").replace(ba, ca) + }, ga.error = function(a) { + throw new Error("Syntax error, unrecognized expression: " + a) + }, ga.uniqueSort = function(a) { + var b, d = [], + e = 0, + f = 0; + if (l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) { + while (b = a[f++]) b === a[f] && (e = d.push(f)); + while (e--) a.splice(d[e], 1) + } + return k = null, a + }, e = ga.getText = function(a) { + var b, c = "", + d = 0, + f = a.nodeType; + if (f) { + if (1 === f || 9 === f || 11 === f) { + if ("string" == typeof a.textContent) return a.textContent; + for (a = a.firstChild; a; a = a.nextSibling) c += e(a) + } else if (3 === f || 4 === f) return a.nodeValue + } else + while (b = a[d++]) c += e(b); + return c + }, d = ga.selectors = { + cacheLength: 50, + createPseudo: ia, + match: V, + attrHandle: {}, + find: {}, + relative: { + ">": { + dir: "parentNode", + first: !0 + }, + " ": { + dir: "parentNode" + }, + "+": { + dir: "previousSibling", + first: !0 + }, + "~": { + dir: "previousSibling" + } + }, + preFilter: { + ATTR: function(a) { + return a[1] = a[1].replace(_, aa), a[3] = (a[3] || a[4] || a[5] || "").replace(_, aa), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4) + }, + CHILD: function(a) { + return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || ga.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && ga.error(a[0]), a + }, + PSEUDO: function(a) { + var b, c = !a[6] && a[2]; + return V.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && T.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3)) + } + }, + filter: { + TAG: function(a) { + var b = a.replace(_, aa).toLowerCase(); + return "*" === a ? function() { + return !0 + } : function(a) { + return a.nodeName && a.nodeName.toLowerCase() === b + } + }, + CLASS: function(a) { + var b = y[a + " "]; + return b || (b = new RegExp("(^|" + K + ")" + a + "(" + K + "|$)")) && y(a, function(a) { + return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "") + }) + }, + ATTR: function(a, b, c) { + return function(d) { + var e = ga.attr(d, a); + return null == e ? "!=" === b : !b || (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e.replace(O, " ") + " ").indexOf(c) > -1 : "|=" === b && (e === c || e.slice(0, c.length + 1) === c + "-")) + } + }, + CHILD: function(a, b, c, d, e) { + var f = "nth" !== a.slice(0, 3), + g = "last" !== a.slice(-4), + h = "of-type" === b; + return 1 === d && 0 === e ? function(a) { + return !!a.parentNode + } : function(b, c, i) { + var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling", + q = b.parentNode, + r = h && b.nodeName.toLowerCase(), + s = !i && !h, + t = !1; + if (q) { + if (f) { + while (p) { + m = b; + while (m = m[p]) + if (h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) return !1; + o = p = "only" === a && !o && "nextSibling" + } + return !0 + } + if (o = [g ? q.firstChild : q.lastChild], g && s) { + m = q, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n && j[2], m = n && q.childNodes[n]; + while (m = ++n && m && m[p] || (t = n = 0) || o.pop()) + if (1 === m.nodeType && ++t && m === b) { + k[a] = [w, n, t]; + break + } + } else if (s && (m = b, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n), t === !1) + while (m = ++n && m && m[p] || (t = n = 0) || o.pop()) + if ((h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) && ++t && (s && (l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), k[a] = [w, t]), m === b)) break; + return t -= e, t === d || t % d === 0 && t / d >= 0 + } + } + }, + PSEUDO: function(a, b) { + var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || ga.error("unsupported pseudo: " + a); + return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? ia(function(a, c) { + var d, f = e(a, b), + g = f.length; + while (g--) d = I(a, f[g]), a[d] = !(c[d] = f[g]) + }) : function(a) { + return e(a, 0, c) + }) : e + } + }, + pseudos: { + not: ia(function(a) { + var b = [], + c = [], + d = h(a.replace(P, "$1")); + return d[u] ? ia(function(a, b, c, e) { + var f, g = d(a, null, e, []), + h = a.length; + while (h--)(f = g[h]) && (a[h] = !(b[h] = f)) + }) : function(a, e, f) { + return b[0] = a, d(b, null, f, c), b[0] = null, !c.pop() + } + }), + has: ia(function(a) { + return function(b) { + return ga(a, b).length > 0 + } + }), + contains: ia(function(a) { + return a = a.replace(_, aa), + + function(b) { + return (b.textContent || b.innerText || e(b)).indexOf(a) > -1 + } + }), + lang: ia(function(a) { + return U.test(a || "") || ga.error("unsupported lang: " + a), a = a.replace(_, aa).toLowerCase(), + + function(b) { + var c; + do + if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); + while ((b = b.parentNode) && 1 === b.nodeType); + return !1 + } + }), + target: function(b) { + var c = a.location && a.location.hash; + return c && c.slice(1) === b.id + }, + root: function(a) { + return a === o + }, + focus: function(a) { + return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex) + }, + enabled: oa(!1), + disabled: oa(!0), + checked: function(a) { + var b = a.nodeName.toLowerCase(); + return "input" === b && !!a.checked || "option" === b && !!a.selected + }, + selected: function(a) { + return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 + }, + empty: function(a) { + for (a = a.firstChild; a; a = a.nextSibling) + if (a.nodeType < 6) return !1; + return !0 + }, + parent: function(a) { + return !d.pseudos.empty(a) + }, + header: function(a) { + return X.test(a.nodeName) + }, + input: function(a) { + return W.test(a.nodeName) + }, + button: function(a) { + var b = a.nodeName.toLowerCase(); + return "input" === b && "button" === a.type || "button" === b + }, + text: function(a) { + var b; + return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase()) + }, + first: pa(function() { + return [0] + }), + last: pa(function(a, b) { + return [b - 1] + }), + eq: pa(function(a, b, c) { + return [c < 0 ? c + b : c] + }), + even: pa(function(a, b) { + for (var c = 0; c < b; c += 2) a.push(c); + return a + }), + odd: pa(function(a, b) { + for (var c = 1; c < b; c += 2) a.push(c); + return a + }), + lt: pa(function(a, b, c) { + for (var d = c < 0 ? c + b : c; --d >= 0;) a.push(d); + return a + }), + gt: pa(function(a, b, c) { + for (var d = c < 0 ? c + b : c; ++d < b;) a.push(d); + return a + }) + } + }, d.pseudos.nth = d.pseudos.eq; + for (b in { + radio: !0, + checkbox: !0, + file: !0, + password: !0, + image: !0 + }) d.pseudos[b] = ma(b); + for (b in { + submit: !0, + reset: !0 + }) d.pseudos[b] = na(b); + + function ra() {} + ra.prototype = d.filters = d.pseudos, d.setFilters = new ra, g = ga.tokenize = function(a, b) { + var c, e, f, g, h, i, j, k = z[a + " "]; + if (k) return b ? 0 : k.slice(0); + h = a, i = [], j = d.preFilter; + while (h) { + c && !(e = Q.exec(h)) || (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = R.exec(h)) && (c = e.shift(), f.push({ + value: c, + type: e[0].replace(P, " ") + }), h = h.slice(c.length)); + for (g in d.filter) !(e = V[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({ + value: c, + type: g, + matches: e + }), h = h.slice(c.length)); + if (!c) break + } + return b ? h.length : h ? ga.error(a) : z(a, i).slice(0) + }; + + function sa(a) { + for (var b = 0, c = a.length, d = ""; b < c; b++) d += a[b].value; + return d + } + + function ta(a, b, c) { + var d = b.dir, + e = b.next, + f = e || d, + g = c && "parentNode" === f, + h = x++; + return b.first ? function(b, c, e) { + while (b = b[d]) + if (1 === b.nodeType || g) return a(b, c, e); + return !1 + } : function(b, c, i) { + var j, k, l, m = [w, h]; + if (i) { + while (b = b[d]) + if ((1 === b.nodeType || g) && a(b, c, i)) return !0 + } else + while (b = b[d]) + if (1 === b.nodeType || g) + if (l = b[u] || (b[u] = {}), k = l[b.uniqueID] || (l[b.uniqueID] = {}), e && e === b.nodeName.toLowerCase()) b = b[d] || b; + else { + if ((j = k[f]) && j[0] === w && j[1] === h) return m[2] = j[2]; + if (k[f] = m, m[2] = a(b, c, i)) return !0 + } + return !1 + } + } + + function ua(a) { + return a.length > 1 ? function(b, c, d) { + var e = a.length; + while (e--) + if (!a[e](b, c, d)) return !1; + return !0 + } : a[0] + } + + function va(a, b, c) { + for (var d = 0, e = b.length; d < e; d++) ga(a, b[d], c); + return c + } + + function wa(a, b, c, d, e) { + for (var f, g = [], h = 0, i = a.length, j = null != b; h < i; h++)(f = a[h]) && (c && !c(f, d, e) || (g.push(f), j && b.push(h))); + return g + } + + function xa(a, b, c, d, e, f) { + return d && !d[u] && (d = xa(d)), e && !e[u] && (e = xa(e, f)), ia(function(f, g, h, i) { + var j, k, l, m = [], + n = [], + o = g.length, + p = f || va(b || "*", h.nodeType ? [h] : h, []), + q = !a || !f && b ? p : wa(p, m, a, h, i), + r = c ? e || (f ? a : o || d) ? [] : g : q; + if (c && c(q, r, h, i), d) { + j = wa(r, n), d(j, [], h, i), k = j.length; + while (k--)(l = j[k]) && (r[n[k]] = !(q[n[k]] = l)) + } + if (f) { + if (e || a) { + if (e) { + j = [], k = r.length; + while (k--)(l = r[k]) && j.push(q[k] = l); + e(null, r = [], j, i) + } + k = r.length; + while (k--)(l = r[k]) && (j = e ? I(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l)) + } + } else r = wa(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : G.apply(g, r) + }) + } + + function ya(a) { + for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = ta(function(a) { + return a === b + }, h, !0), l = ta(function(a) { + return I(b, a) > -1 + }, h, !0), m = [function(a, c, d) { + var e = !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)); + return b = null, e + }]; i < f; i++) + if (c = d.relative[a[i].type]) m = [ta(ua(m), c)]; + else { + if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) { + for (e = ++i; e < f; e++) + if (d.relative[a[e].type]) break; + return xa(i > 1 && ua(m), i > 1 && sa(a.slice(0, i - 1).concat({ + value: " " === a[i - 2].type ? "*" : "" + })).replace(P, "$1"), c, i < e && ya(a.slice(i, e)), e < f && ya(a = a.slice(e)), e < f && sa(a)) + } + m.push(c) + } + return ua(m) + } + + function za(a, b) { + var c = b.length > 0, + e = a.length > 0, + f = function(f, g, h, i, k) { + var l, o, q, r = 0, + s = "0", + t = f && [], + u = [], + v = j, + x = f || e && d.find.TAG("*", k), + y = w += null == v ? 1 : Math.random() || .1, + z = x.length; + for (k && (j = g === n || g || k); s !== z && null != (l = x[s]); s++) { + if (e && l) { + o = 0, g || l.ownerDocument === n || (m(l), h = !p); + while (q = a[o++]) + if (q(l, g || n, h)) { + i.push(l); + break + } + k && (w = y) + } + c && ((l = !q && l) && r--, f && t.push(l)) + } + if (r += s, c && s !== r) { + o = 0; + while (q = b[o++]) q(t, u, g, h); + if (f) { + if (r > 0) + while (s--) t[s] || u[s] || (u[s] = E.call(i)); + u = wa(u) + } + G.apply(i, u), k && !f && u.length > 0 && r + b.length > 1 && ga.uniqueSort(i) + } + return k && (w = y, j = v), t + }; + return c ? ia(f) : f + } + return h = ga.compile = function(a, b) { + var c, d = [], + e = [], + f = A[a + " "]; + if (!f) { + b || (b = g(a)), c = b.length; + while (c--) f = ya(b[c]), f[u] ? d.push(f) : e.push(f); + f = A(a, za(e, d)), f.selector = a + } + return f + }, i = ga.select = function(a, b, c, e) { + var f, i, j, k, l, m = "function" == typeof a && a, + n = !e && g(a = m.selector || a); + if (c = c || [], 1 === n.length) { + if (i = n[0] = n[0].slice(0), i.length > 2 && "ID" === (j = i[0]).type && 9 === b.nodeType && p && d.relative[i[1].type]) { + if (b = (d.find.ID(j.matches[0].replace(_, aa), b) || [])[0], !b) return c; + m && (b = b.parentNode), a = a.slice(i.shift().value.length) + } + f = V.needsContext.test(a) ? 0 : i.length; + while (f--) { + if (j = i[f], d.relative[k = j.type]) break; + if ((l = d.find[k]) && (e = l(j.matches[0].replace(_, aa), $.test(i[0].type) && qa(b.parentNode) || b))) { + if (i.splice(f, 1), a = e.length && sa(i), !a) return G.apply(c, e), c; + break + } + } + } + return (m || h(a, n))(e, b, !p, c, !b || $.test(a) && qa(b.parentNode) || b), c + }, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates = !!l, m(), c.sortDetached = ja(function(a) { + return 1 & a.compareDocumentPosition(n.createElement("fieldset")) + }), ja(function(a) { + return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href") + }) || ka("type|href|height|width", function(a, b, c) { + if (!c) return a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2) + }), c.attributes && ja(function(a) { + return a.innerHTML = "<input/>", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value") + }) || ka("value", function(a, b, c) { + if (!c && "input" === a.nodeName.toLowerCase()) return a.defaultValue + }), ja(function(a) { + return null == a.getAttribute("disabled") + }) || ka(J, function(a, b, c) { + var d; + if (!c) return a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null + }), ga + }(a); + r.find = x, r.expr = x.selectors, r.expr[":"] = r.expr.pseudos, r.uniqueSort = r.unique = x.uniqueSort, r.text = x.getText, r.isXMLDoc = x.isXML, r.contains = x.contains, r.escapeSelector = x.escape; + var y = function(a, b, c) { + var d = [], + e = void 0 !== c; + while ((a = a[b]) && 9 !== a.nodeType) + if (1 === a.nodeType) { + if (e && r(a).is(c)) break; + d.push(a) + } + return d + }, + z = function(a, b) { + for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a); + return c + }, + A = r.expr.match.needsContext, + B = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i, + C = /^.[^:#\[\.,]*$/; + + function D(a, b, c) { + return r.isFunction(b) ? r.grep(a, function(a, d) { + return !!b.call(a, d, a) !== c + }) : b.nodeType ? r.grep(a, function(a) { + return a === b !== c + }) : "string" != typeof b ? r.grep(a, function(a) { + return i.call(b, a) > -1 !== c + }) : C.test(b) ? r.filter(b, a, c) : (b = r.filter(b, a), r.grep(a, function(a) { + return i.call(b, a) > -1 !== c && 1 === a.nodeType + })) + } + r.filter = function(a, b, c) { + var d = b[0]; + return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? r.find.matchesSelector(d, a) ? [d] : [] : r.find.matches(a, r.grep(b, function(a) { + return 1 === a.nodeType + })) + }, r.fn.extend({ + find: function(a) { + var b, c, d = this.length, + e = this; + if ("string" != typeof a) return this.pushStack(r(a).filter(function() { + for (b = 0; b < d; b++) + if (r.contains(e[b], this)) return !0 + })); + for (c = this.pushStack([]), b = 0; b < d; b++) r.find(a, e[b], c); + return d > 1 ? r.uniqueSort(c) : c + }, + filter: function(a) { + return this.pushStack(D(this, a || [], !1)) + }, + not: function(a) { + return this.pushStack(D(this, a || [], !0)) + }, + is: function(a) { + return !!D(this, "string" == typeof a && A.test(a) ? r(a) : a || [], !1).length + } + }); + var E, F = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + G = r.fn.init = function(a, b, c) { + var e, f; + if (!a) return this; + if (c = c || E, "string" == typeof a) { + if (e = "<" === a[0] && ">" === a[a.length - 1] && a.length >= 3 ? [null, a, null] : F.exec(a), !e || !e[1] && b) return !b || b.jquery ? (b || c).find(a) : this.constructor(b).find(a); + if (e[1]) { + if (b = b instanceof r ? b[0] : b, r.merge(this, r.parseHTML(e[1], b && b.nodeType ? b.ownerDocument || b : d, !0)), B.test(e[1]) && r.isPlainObject(b)) + for (e in b) r.isFunction(this[e]) ? this[e](b[e]) : this.attr(e, b[e]); + return this + } + return f = d.getElementById(e[2]), f && (this[0] = f, this.length = 1), this + } + return a.nodeType ? (this[0] = a, this.length = 1, this) : r.isFunction(a) ? void 0 !== c.ready ? c.ready(a) : a(r) : r.makeArray(a, this) + }; + G.prototype = r.fn, E = r(d); + var H = /^(?:parents|prev(?:Until|All))/, + I = { + children: !0, + contents: !0, + next: !0, + prev: !0 + }; + r.fn.extend({ + has: function(a) { + var b = r(a, this), + c = b.length; + return this.filter(function() { + for (var a = 0; a < c; a++) + if (r.contains(this, b[a])) return !0 + }) + }, + closest: function(a, b) { + var c, d = 0, + e = this.length, + f = [], + g = "string" != typeof a && r(a); + if (!A.test(a)) + for (; d < e; d++) + for (c = this[d]; c && c !== b; c = c.parentNode) + if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && r.find.matchesSelector(c, a))) { + f.push(c); + break + } + return this.pushStack(f.length > 1 ? r.uniqueSort(f) : f) + }, + index: function(a) { + return a ? "string" == typeof a ? i.call(r(a), this[0]) : i.call(this, a.jquery ? a[0] : a) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 + }, + add: function(a, b) { + return this.pushStack(r.uniqueSort(r.merge(this.get(), r(a, b)))) + }, + addBack: function(a) { + return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) + } + }); + + function J(a, b) { + while ((a = a[b]) && 1 !== a.nodeType); + return a + } + r.each({ + parent: function(a) { + var b = a.parentNode; + return b && 11 !== b.nodeType ? b : null + }, + parents: function(a) { + return y(a, "parentNode") + }, + parentsUntil: function(a, b, c) { + return y(a, "parentNode", c) + }, + next: function(a) { + return J(a, "nextSibling") + }, + prev: function(a) { + return J(a, "previousSibling") + }, + nextAll: function(a) { + return y(a, "nextSibling") + }, + prevAll: function(a) { + return y(a, "previousSibling") + }, + nextUntil: function(a, b, c) { + return y(a, "nextSibling", c) + }, + prevUntil: function(a, b, c) { + return y(a, "previousSibling", c) + }, + siblings: function(a) { + return z((a.parentNode || {}).firstChild, a) + }, + children: function(a) { + return z(a.firstChild) + }, + contents: function(a) { + return a.contentDocument || r.merge([], a.childNodes) + } + }, function(a, b) { + r.fn[a] = function(c, d) { + var e = r.map(this, b, c); + return "Until" !== a.slice(-5) && (d = c), d && "string" == typeof d && (e = r.filter(d, e)), this.length > 1 && (I[a] || r.uniqueSort(e), H.test(a) && e.reverse()), this.pushStack(e) + } + }); + var K = /[^\x20\t\r\n\f]+/g; + + function L(a) { + var b = {}; + return r.each(a.match(K) || [], function(a, c) { + b[c] = !0 + }), b + } + r.Callbacks = function(a) { + a = "string" == typeof a ? L(a) : r.extend({}, a); + var b, c, d, e, f = [], + g = [], + h = -1, + i = function() { + for (e = a.once, d = b = !0; g.length; h = -1) { + c = g.shift(); + while (++h < f.length) f[h].apply(c[0], c[1]) === !1 && a.stopOnFalse && (h = f.length, c = !1) + } + a.memory || (c = !1), b = !1, e && (f = c ? [] : "") + }, + j = { + add: function() { + return f && (c && !b && (h = f.length - 1, g.push(c)), function d(b) { + r.each(b, function(b, c) { + r.isFunction(c) ? a.unique && j.has(c) || f.push(c) : c && c.length && "string" !== r.type(c) && d(c) + }) + }(arguments), c && !b && i()), this + }, + remove: function() { + return r.each(arguments, function(a, b) { + var c; + while ((c = r.inArray(b, f, c)) > -1) f.splice(c, 1), c <= h && h-- + }), this + }, + has: function(a) { + return a ? r.inArray(a, f) > -1 : f.length > 0 + }, + empty: function() { + return f && (f = []), this + }, + disable: function() { + return e = g = [], f = c = "", this + }, + disabled: function() { + return !f + }, + lock: function() { + return e = g = [], c || b || (f = c = ""), this + }, + locked: function() { + return !!e + }, + fireWith: function(a, c) { + return e || (c = c || [], c = [a, c.slice ? c.slice() : c], g.push(c), b || i()), this + }, + fire: function() { + return j.fireWith(this, arguments), this + }, + fired: function() { + return !!d + } + }; + return j + }; + + function M(a) { + return a + } + + function N(a) { + throw a + } + + function O(a, b, c) { + var d; + try { + a && r.isFunction(d = a.promise) ? d.call(a).done(b).fail(c) : a && r.isFunction(d = a.then) ? d.call(a, b, c) : b.call(void 0, a) + } catch (a) { + c.call(void 0, a) + } + } + r.extend({ + Deferred: function(b) { + var c = [ + ["notify", "progress", r.Callbacks("memory"), r.Callbacks("memory"), 2], + ["resolve", "done", r.Callbacks("once memory"), r.Callbacks("once memory"), 0, "resolved"], + ["reject", "fail", r.Callbacks("once memory"), r.Callbacks("once memory"), 1, "rejected"] + ], + d = "pending", + e = { + state: function() { + return d + }, + always: function() { + return f.done(arguments).fail(arguments), this + }, + "catch": function(a) { + return e.then(null, a) + }, + pipe: function() { + var a = arguments; + return r.Deferred(function(b) { + r.each(c, function(c, d) { + var e = r.isFunction(a[d[4]]) && a[d[4]]; + f[d[1]](function() { + var a = e && e.apply(this, arguments); + a && r.isFunction(a.promise) ? a.promise().progress(b.notify).done(b.resolve).fail(b.reject) : b[d[0] + "With"](this, e ? [a] : arguments) + }) + }), a = null + }).promise() + }, + then: function(b, d, e) { + var f = 0; + + function g(b, c, d, e) { + return function() { + var h = this, + i = arguments, + j = function() { + var a, j; + if (!(b < f)) { + if (a = d.apply(h, i), a === c.promise()) throw new TypeError("Thenable self-resolution"); + j = a && ("object" == typeof a || "function" == typeof a) && a.then, r.isFunction(j) ? e ? j.call(a, g(f, c, M, e), g(f, c, N, e)) : (f++, j.call(a, g(f, c, M, e), g(f, c, N, e), g(f, c, M, c.notifyWith))) : (d !== M && (h = void 0, i = [a]), (e || c.resolveWith)(h, i)) + } + }, + k = e ? j : function() { + try { + j() + } catch (a) { + r.Deferred.exceptionHook && r.Deferred.exceptionHook(a, k.stackTrace), b + 1 >= f && (d !== N && (h = void 0, i = [a]), c.rejectWith(h, i)) + } + }; + b ? k() : (r.Deferred.getStackHook && (k.stackTrace = r.Deferred.getStackHook()), a.setTimeout(k)) + } + } + return r.Deferred(function(a) { + c[0][3].add(g(0, a, r.isFunction(e) ? e : M, a.notifyWith)), c[1][3].add(g(0, a, r.isFunction(b) ? b : M)), c[2][3].add(g(0, a, r.isFunction(d) ? d : N)) + }).promise() + }, + promise: function(a) { + return null != a ? r.extend(a, e) : e + } + }, + f = {}; + return r.each(c, function(a, b) { + var g = b[2], + h = b[5]; + e[b[1]] = g.add, h && g.add(function() { + d = h + }, c[3 - a][2].disable, c[0][2].lock), g.add(b[3].fire), f[b[0]] = function() { + return f[b[0] + "With"](this === f ? void 0 : this, arguments), this + }, f[b[0] + "With"] = g.fireWith + }), e.promise(f), b && b.call(f, f), f + }, + when: function(a) { + var b = arguments.length, + c = b, + d = Array(c), + e = f.call(arguments), + g = r.Deferred(), + h = function(a) { + return function(c) { + d[a] = this, e[a] = arguments.length > 1 ? f.call(arguments) : c, --b || g.resolveWith(d, e) + } + }; + if (b <= 1 && (O(a, g.done(h(c)).resolve, g.reject), "pending" === g.state() || r.isFunction(e[c] && e[c].then))) return g.then(); + while (c--) O(e[c], h(c), g.reject); + return g.promise() + } + }); + var P = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + r.Deferred.exceptionHook = function(b, c) { + a.console && a.console.warn && b && P.test(b.name) && a.console.warn("jQuery.Deferred exception: " + b.message, b.stack, c) + }, r.readyException = function(b) { + a.setTimeout(function() { + throw b + }) + }; + var Q = r.Deferred(); + r.fn.ready = function(a) { + return Q.then(a)["catch"](function(a) { + r.readyException(a) + }), this + }, r.extend({ + isReady: !1, + readyWait: 1, + holdReady: function(a) { + a ? r.readyWait++ : r.ready(!0) + }, + ready: function(a) { + (a === !0 ? --r.readyWait : r.isReady) || (r.isReady = !0, a !== !0 && --r.readyWait > 0 || Q.resolveWith(d, [r])) + } + }), r.ready.then = Q.then; + + function R() { + d.removeEventListener("DOMContentLoaded", R), + a.removeEventListener("load", R), r.ready() + } + "complete" === d.readyState || "loading" !== d.readyState && !d.documentElement.doScroll ? a.setTimeout(r.ready) : (d.addEventListener("DOMContentLoaded", R), a.addEventListener("load", R)); + var S = function(a, b, c, d, e, f, g) { + var h = 0, + i = a.length, + j = null == c; + if ("object" === r.type(c)) { + e = !0; + for (h in c) S(a, b, h, c[h], !0, f, g) + } else if (void 0 !== d && (e = !0, r.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function(a, b, c) { + return j.call(r(a), c) + })), b)) + for (; h < i; h++) b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c))); + return e ? a : j ? b.call(a) : i ? b(a[0], c) : f + }, + T = function(a) { + return 1 === a.nodeType || 9 === a.nodeType || !+a.nodeType + }; + + function U() { + this.expando = r.expando + U.uid++ + } + U.uid = 1, U.prototype = { + cache: function(a) { + var b = a[this.expando]; + return b || (b = {}, T(a) && (a.nodeType ? a[this.expando] = b : Object.defineProperty(a, this.expando, { + value: b, + configurable: !0 + }))), b + }, + set: function(a, b, c) { + var d, e = this.cache(a); + if ("string" == typeof b) e[r.camelCase(b)] = c; + else + for (d in b) e[r.camelCase(d)] = b[d]; + return e + }, + get: function(a, b) { + return void 0 === b ? this.cache(a) : a[this.expando] && a[this.expando][r.camelCase(b)] + }, + access: function(a, b, c) { + return void 0 === b || b && "string" == typeof b && void 0 === c ? this.get(a, b) : (this.set(a, b, c), void 0 !== c ? c : b) + }, + remove: function(a, b) { + var c, d = a[this.expando]; + if (void 0 !== d) { + if (void 0 !== b) { + r.isArray(b) ? b = b.map(r.camelCase) : (b = r.camelCase(b), b = b in d ? [b] : b.match(K) || []), c = b.length; + while (c--) delete d[b[c]] + }(void 0 === b || r.isEmptyObject(d)) && (a.nodeType ? a[this.expando] = void 0 : delete a[this.expando]) + } + }, + hasData: function(a) { + var b = a[this.expando]; + return void 0 !== b && !r.isEmptyObject(b) + } + }; + var V = new U, + W = new U, + X = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + Y = /[A-Z]/g; + + function Z(a) { + return "true" === a || "false" !== a && ("null" === a ? null : a === +a + "" ? +a : X.test(a) ? JSON.parse(a) : a) + } + + function $(a, b, c) { + var d; + if (void 0 === c && 1 === a.nodeType) + if (d = "data-" + b.replace(Y, "-$&").toLowerCase(), c = a.getAttribute(d), "string" == typeof c) { + try { + c = Z(c) + } catch (e) {} + W.set(a, b, c) + } else c = void 0; + return c + } + r.extend({ + hasData: function(a) { + return W.hasData(a) || V.hasData(a) + }, + data: function(a, b, c) { + return W.access(a, b, c) + }, + removeData: function(a, b) { + W.remove(a, b) + }, + _data: function(a, b, c) { + return V.access(a, b, c) + }, + _removeData: function(a, b) { + V.remove(a, b) + } + }), r.fn.extend({ + data: function(a, b) { + var c, d, e, f = this[0], + g = f && f.attributes; + if (void 0 === a) { + if (this.length && (e = W.get(f), 1 === f.nodeType && !V.get(f, "hasDataAttrs"))) { + c = g.length; + while (c--) g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = r.camelCase(d.slice(5)), $(f, d, e[d]))); + V.set(f, "hasDataAttrs", !0) + } + return e + } + return "object" == typeof a ? this.each(function() { + W.set(this, a) + }) : S(this, function(b) { + var c; + if (f && void 0 === b) { + if (c = W.get(f, a), void 0 !== c) return c; + if (c = $(f, a), void 0 !== c) return c + } else this.each(function() { + W.set(this, a, b) + }) + }, null, b, arguments.length > 1, null, !0) + }, + removeData: function(a) { + return this.each(function() { + W.remove(this, a) + }) + } + }), r.extend({ + queue: function(a, b, c) { + var d; + if (a) return b = (b || "fx") + "queue", d = V.get(a, b), c && (!d || r.isArray(c) ? d = V.access(a, b, r.makeArray(c)) : d.push(c)), d || [] + }, + dequeue: function(a, b) { + b = b || "fx"; + var c = r.queue(a, b), + d = c.length, + e = c.shift(), + f = r._queueHooks(a, b), + g = function() { + r.dequeue(a, b) + }; + "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire() + }, + _queueHooks: function(a, b) { + var c = b + "queueHooks"; + return V.get(a, c) || V.access(a, c, { + empty: r.Callbacks("once memory").add(function() { + V.remove(a, [b + "queue", c]) + }) + }) + } + }), r.fn.extend({ + queue: function(a, b) { + var c = 2; + return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? r.queue(this[0], a) : void 0 === b ? this : this.each(function() { + var c = r.queue(this, a, b); + r._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && r.dequeue(this, a) + }) + }, + dequeue: function(a) { + return this.each(function() { + r.dequeue(this, a) + }) + }, + clearQueue: function(a) { + return this.queue(a || "fx", []) + }, + promise: function(a, b) { + var c, d = 1, + e = r.Deferred(), + f = this, + g = this.length, + h = function() { + --d || e.resolveWith(f, [f]) + }; + "string" != typeof a && (b = a, a = void 0), a = a || "fx"; + while (g--) c = V.get(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h)); + return h(), e.promise(b) + } + }); + var _ = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, + aa = new RegExp("^(?:([+-])=|)(" + _ + ")([a-z%]*)$", "i"), + ba = ["Top", "Right", "Bottom", "Left"], + ca = function(a, b) { + return a = b || a, "none" === a.style.display || "" === a.style.display && r.contains(a.ownerDocument, a) && "none" === r.css(a, "display") + }, + da = function(a, b, c, d) { + var e, f, g = {}; + for (f in b) g[f] = a.style[f], a.style[f] = b[f]; + e = c.apply(a, d || []); + for (f in b) a.style[f] = g[f]; + return e + }; + + function ea(a, b, c, d) { + var e, f = 1, + g = 20, + h = d ? function() { + return d.cur() + } : function() { + return r.css(a, b, "") + }, + i = h(), + j = c && c[3] || (r.cssNumber[b] ? "" : "px"), + k = (r.cssNumber[b] || "px" !== j && +i) && aa.exec(r.css(a, b)); + if (k && k[3] !== j) { + j = j || k[3], c = c || [], k = +i || 1; + do f = f || ".5", k /= f, r.style(a, b, k + j); + while (f !== (f = h() / i) && 1 !== f && --g) + } + return c && (k = +k || +i || 0, e = c[1] ? k + (c[1] + 1) * c[2] : +c[2], d && (d.unit = j, d.start = k, d.end = e)), e + } + var fa = {}; + + function ga(a) { + var b, c = a.ownerDocument, + d = a.nodeName, + e = fa[d]; + return e ? e : (b = c.body.appendChild(c.createElement(d)), e = r.css(b, "display"), b.parentNode.removeChild(b), "none" === e && (e = "block"), fa[d] = e, e) + } + + function ha(a, b) { + for (var c, d, e = [], f = 0, g = a.length; f < g; f++) d = a[f], d.style && (c = d.style.display, b ? ("none" === c && (e[f] = V.get(d, "display") || null, e[f] || (d.style.display = "")), "" === d.style.display && ca(d) && (e[f] = ga(d))) : "none" !== c && (e[f] = "none", V.set(d, "display", c))); + for (f = 0; f < g; f++) null != e[f] && (a[f].style.display = e[f]); + return a + } + r.fn.extend({ + show: function() { + return ha(this, !0) + }, + hide: function() { + return ha(this) + }, + toggle: function(a) { + return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function() { + ca(this) ? r(this).show() : r(this).hide() + }) + } + }); + var ia = /^(?:checkbox|radio)$/i, + ja = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i, + ka = /^$|\/(?:java|ecma)script/i, + la = { + option: [1, "<select multiple='multiple'>", "</select>"], + thead: [1, "<table>", "</table>"], + col: [2, "<table><colgroup>", "</colgroup></table>"], + tr: [2, "<table><tbody>", "</tbody></table>"], + td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], + _default: [0, "", ""] + }; + la.optgroup = la.option, la.tbody = la.tfoot = la.colgroup = la.caption = la.thead, la.th = la.td; + + function ma(a, b) { + var c; + return c = "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName(b || "*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll(b || "*") : [], void 0 === b || b && r.nodeName(a, b) ? r.merge([a], c) : c + } + + function na(a, b) { + for (var c = 0, d = a.length; c < d; c++) V.set(a[c], "globalEval", !b || V.get(b[c], "globalEval")) + } + var oa = /<|&#?\w+;/; + + function pa(a, b, c, d, e) { + for (var f, g, h, i, j, k, l = b.createDocumentFragment(), m = [], n = 0, o = a.length; n < o; n++) + if (f = a[n], f || 0 === f) + if ("object" === r.type(f)) r.merge(m, f.nodeType ? [f] : f); + else if (oa.test(f)) { + g = g || l.appendChild(b.createElement("div")), h = (ja.exec(f) || ["", ""])[1].toLowerCase(), i = la[h] || la._default, g.innerHTML = i[1] + r.htmlPrefilter(f) + i[2], k = i[0]; + while (k--) g = g.lastChild; + r.merge(m, g.childNodes), g = l.firstChild, g.textContent = "" + } else m.push(b.createTextNode(f)); + l.textContent = "", n = 0; + while (f = m[n++]) + if (d && r.inArray(f, d) > -1) e && e.push(f); + else if (j = r.contains(f.ownerDocument, f), g = ma(l.appendChild(f), "script"), j && na(g), c) { + k = 0; + while (f = g[k++]) ka.test(f.type || "") && c.push(f) + } + return l + }! function() { + var a = d.createDocumentFragment(), + b = a.appendChild(d.createElement("div")), + c = d.createElement("input"); + c.setAttribute("type", "radio"), c.setAttribute("checked", "checked"), c.setAttribute("name", "t"), b.appendChild(c), o.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, b.innerHTML = "<textarea>x</textarea>", o.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue + }(); + var qa = d.documentElement, + ra = /^key/, + sa = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + ta = /^([^.]*)(?:\.(.+)|)/; + + function ua() { + return !0 + } + + function va() { + return !1 + } + + function wa() { + try { + return d.activeElement + } catch (a) {} + } + + function xa(a, b, c, d, e, f) { + var g, h; + if ("object" == typeof b) { + "string" != typeof c && (d = d || c, c = void 0); + for (h in b) xa(a, h, c, d, b[h], f); + return a + } + if (null == d && null == e ? (e = c, d = c = void 0) : null == e && ("string" == typeof c ? (e = d, d = void 0) : (e = d, d = c, c = void 0)), e === !1) e = va; + else if (!e) return a; + return 1 === f && (g = e, e = function(a) { + return r().off(a), g.apply(this, arguments) + }, e.guid = g.guid || (g.guid = r.guid++)), a.each(function() { + r.event.add(this, b, e, d, c) + }) + } + r.event = { + global: {}, + add: function(a, b, c, d, e) { + var f, g, h, i, j, k, l, m, n, o, p, q = V.get(a); + if (q) { + c.handler && (f = c, c = f.handler, e = f.selector), e && r.find.matchesSelector(qa, e), c.guid || (c.guid = r.guid++), (i = q.events) || (i = q.events = {}), (g = q.handle) || (g = q.handle = function(b) { + return "undefined" != typeof r && r.event.triggered !== b.type ? r.event.dispatch.apply(a, arguments) : void 0 + }), b = (b || "").match(K) || [""], j = b.length; + while (j--) h = ta.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n && (l = r.event.special[n] || {}, n = (e ? l.delegateType : l.bindType) || n, l = r.event.special[n] || {}, k = r.extend({ + type: n, + origType: p, + data: d, + handler: c, + guid: c.guid, + selector: e, + needsContext: e && r.expr.match.needsContext.test(e), + namespace: o.join(".") + }, f), (m = i[n]) || (m = i[n] = [], m.delegateCount = 0, l.setup && l.setup.call(a, d, o, g) !== !1 || a.addEventListener && a.addEventListener(n, g)), l.add && (l.add.call(a, k), k.handler.guid || (k.handler.guid = c.guid)), e ? m.splice(m.delegateCount++, 0, k) : m.push(k), r.event.global[n] = !0) + } + }, + remove: function(a, b, c, d, e) { + var f, g, h, i, j, k, l, m, n, o, p, q = V.hasData(a) && V.get(a); + if (q && (i = q.events)) { + b = (b || "").match(K) || [""], j = b.length; + while (j--) + if (h = ta.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n) { + l = r.event.special[n] || {}, n = (d ? l.delegateType : l.bindType) || n, m = i[n] || [], h = h[2] && new RegExp("(^|\\.)" + o.join("\\.(?:.*\\.|)") + "(\\.|$)"), g = f = m.length; + while (f--) k = m[f], !e && p !== k.origType || c && c.guid !== k.guid || h && !h.test(k.namespace) || d && d !== k.selector && ("**" !== d || !k.selector) || (m.splice(f, 1), k.selector && m.delegateCount--, l.remove && l.remove.call(a, k)); + g && !m.length && (l.teardown && l.teardown.call(a, o, q.handle) !== !1 || r.removeEvent(a, n, q.handle), delete i[n]) + } else + for (n in i) r.event.remove(a, n + b[j], c, d, !0); + r.isEmptyObject(i) && V.remove(a, "handle events") + } + }, + dispatch: function(a) { + var b = r.event.fix(a), + c, d, e, f, g, h, i = new Array(arguments.length), + j = (V.get(this, "events") || {})[b.type] || [], + k = r.event.special[b.type] || {}; + for (i[0] = b, c = 1; c < arguments.length; c++) i[c] = arguments[c]; + if (b.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, b) !== !1) { + h = r.event.handlers.call(this, b, j), c = 0; + while ((f = h[c++]) && !b.isPropagationStopped()) { + b.currentTarget = f.elem, d = 0; + while ((g = f.handlers[d++]) && !b.isImmediatePropagationStopped()) b.rnamespace && !b.rnamespace.test(g.namespace) || (b.handleObj = g, b.data = g.data, e = ((r.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i), void 0 !== e && (b.result = e) === !1 && (b.preventDefault(), b.stopPropagation())) + } + return k.postDispatch && k.postDispatch.call(this, b), b.result + } + }, + handlers: function(a, b) { + var c, d, e, f, g, h = [], + i = b.delegateCount, + j = a.target; + if (i && j.nodeType && !("click" === a.type && a.button >= 1)) + for (; j !== this; j = j.parentNode || this) + if (1 === j.nodeType && ("click" !== a.type || j.disabled !== !0)) { + for (f = [], g = {}, c = 0; c < i; c++) d = b[c], e = d.selector + " ", void 0 === g[e] && (g[e] = d.needsContext ? r(e, this).index(j) > -1 : r.find(e, this, null, [j]).length), g[e] && f.push(d); + f.length && h.push({ + elem: j, + handlers: f + }) + } + return j = this, i < b.length && h.push({ + elem: j, + handlers: b.slice(i) + }), h + }, + addProp: function(a, b) { + Object.defineProperty(r.Event.prototype, a, { + enumerable: !0, + configurable: !0, + get: r.isFunction(b) ? function() { + if (this.originalEvent) return b(this.originalEvent) + } : function() { + if (this.originalEvent) return this.originalEvent[a] + }, + set: function(b) { + Object.defineProperty(this, a, { + enumerable: !0, + configurable: !0, + writable: !0, + value: b + }) + } + }) + }, + fix: function(a) { + return a[r.expando] ? a : new r.Event(a) + }, + special: { + load: { + noBubble: !0 + }, + focus: { + trigger: function() { + if (this !== wa() && this.focus) return this.focus(), !1 + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if (this === wa() && this.blur) return this.blur(), !1 + }, + delegateType: "focusout" + }, + click: { + trigger: function() { + if ("checkbox" === this.type && this.click && r.nodeName(this, "input")) return this.click(), !1 + }, + _default: function(a) { + return r.nodeName(a.target, "a") + } + }, + beforeunload: { + postDispatch: function(a) { + void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result) + } + } + } + }, r.removeEvent = function(a, b, c) { + a.removeEventListener && a.removeEventListener(b, c) + }, r.Event = function(a, b) { + return this instanceof r.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? ua : va, this.target = a.target && 3 === a.target.nodeType ? a.target.parentNode : a.target, this.currentTarget = a.currentTarget, this.relatedTarget = a.relatedTarget) : this.type = a, b && r.extend(this, b), this.timeStamp = a && a.timeStamp || r.now(), void(this[r.expando] = !0)) : new r.Event(a, b) + }, r.Event.prototype = { + constructor: r.Event, + isDefaultPrevented: va, + isPropagationStopped: va, + isImmediatePropagationStopped: va, + isSimulated: !1, + preventDefault: function() { + var a = this.originalEvent; + this.isDefaultPrevented = ua, a && !this.isSimulated && a.preventDefault() + }, + stopPropagation: function() { + var a = this.originalEvent; + this.isPropagationStopped = ua, a && !this.isSimulated && a.stopPropagation() + }, + stopImmediatePropagation: function() { + var a = this.originalEvent; + this.isImmediatePropagationStopped = ua, a && !this.isSimulated && a.stopImmediatePropagation(), this.stopPropagation() + } + }, r.each({ + altKey: !0, + bubbles: !0, + cancelable: !0, + changedTouches: !0, + ctrlKey: !0, + detail: !0, + eventPhase: !0, + metaKey: !0, + pageX: !0, + pageY: !0, + shiftKey: !0, + view: !0, + "char": !0, + charCode: !0, + key: !0, + keyCode: !0, + button: !0, + buttons: !0, + clientX: !0, + clientY: !0, + offsetX: !0, + offsetY: !0, + pointerId: !0, + pointerType: !0, + screenX: !0, + screenY: !0, + targetTouches: !0, + toElement: !0, + touches: !0, + which: function(a) { + var b = a.button; + return null == a.which && ra.test(a.type) ? null != a.charCode ? a.charCode : a.keyCode : !a.which && void 0 !== b && sa.test(a.type) ? 1 & b ? 1 : 2 & b ? 3 : 4 & b ? 2 : 0 : a.which + } + }, r.event.addProp), r.each({ + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" + }, function(a, b) { + r.event.special[a] = { + delegateType: b, + bindType: b, + handle: function(a) { + var c, d = this, + e = a.relatedTarget, + f = a.handleObj; + return e && (e === d || r.contains(d, e)) || (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c + } + } + }), r.fn.extend({ + on: function(a, b, c, d) { + return xa(this, a, b, c, d) + }, + one: function(a, b, c, d) { + return xa(this, a, b, c, d, 1) + }, + off: function(a, b, c) { + var d, e; + if (a && a.preventDefault && a.handleObj) return d = a.handleObj, r(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this; + if ("object" == typeof a) { + for (e in a) this.off(e, b, a[e]); + return this + } + return b !== !1 && "function" != typeof b || (c = b, b = void 0), c === !1 && (c = va), this.each(function() { + r.event.remove(this, a, c, b) + }) + } + }); + var ya = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + za = /<script|<style|<link/i, + Aa = /checked\s*(?:[^=]|=\s*.checked.)/i, + Ba = /^true\/(.*)/, + Ca = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; + + function Da(a, b) { + return r.nodeName(a, "table") && r.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a : a + } + + function Ea(a) { + return a.type = (null !== a.getAttribute("type")) + "/" + a.type, a + } + + function Fa(a) { + var b = Ba.exec(a.type); + return b ? a.type = b[1] : a.removeAttribute("type"), a + } + + function Ga(a, b) { + var c, d, e, f, g, h, i, j; + if (1 === b.nodeType) { + if (V.hasData(a) && (f = V.access(a), g = V.set(b, f), j = f.events)) { + delete g.handle, g.events = {}; + for (e in j) + for (c = 0, d = j[e].length; c < d; c++) r.event.add(b, e, j[e][c]) + } + W.hasData(a) && (h = W.access(a), i = r.extend({}, h), W.set(b, i)) + } + } + + function Ha(a, b) { + var c = b.nodeName.toLowerCase(); + "input" === c && ia.test(a.type) ? b.checked = a.checked : "input" !== c && "textarea" !== c || (b.defaultValue = a.defaultValue) + } + + function Ia(a, b, c, d) { + b = g.apply([], b); + var e, f, h, i, j, k, l = 0, + m = a.length, + n = m - 1, + q = b[0], + s = r.isFunction(q); + if (s || m > 1 && "string" == typeof q && !o.checkClone && Aa.test(q)) return a.each(function(e) { + var f = a.eq(e); + s && (b[0] = q.call(this, e, f.html())), Ia(f, b, c, d) + }); + if (m && (e = pa(b, a[0].ownerDocument, !1, a, d), f = e.firstChild, 1 === e.childNodes.length && (e = f), f || d)) { + for (h = r.map(ma(e, "script"), Ea), i = h.length; l < m; l++) j = e, l !== n && (j = r.clone(j, !0, !0), i && r.merge(h, ma(j, "script"))), c.call(a[l], j, l); + if (i) + for (k = h[h.length - 1].ownerDocument, r.map(h, Fa), l = 0; l < i; l++) j = h[l], ka.test(j.type || "") && !V.access(j, "globalEval") && r.contains(k, j) && (j.src ? r._evalUrl && r._evalUrl(j.src) : p(j.textContent.replace(Ca, ""), k)) + } + return a + } + + function Ja(a, b, c) { + for (var d, e = b ? r.filter(b, a) : a, f = 0; null != (d = e[f]); f++) c || 1 !== d.nodeType || r.cleanData(ma(d)), d.parentNode && (c && r.contains(d.ownerDocument, d) && na(ma(d, "script")), d.parentNode.removeChild(d)); + return a + } + r.extend({ + htmlPrefilter: function(a) { + return a.replace(ya, "<$1></$2>") + }, + clone: function(a, b, c) { + var d, e, f, g, h = a.cloneNode(!0), + i = r.contains(a.ownerDocument, a); + if (!(o.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || r.isXMLDoc(a))) + for (g = ma(h), f = ma(a), d = 0, e = f.length; d < e; d++) Ha(f[d], g[d]); + if (b) + if (c) + for (f = f || ma(a), g = g || ma(h), d = 0, e = f.length; d < e; d++) Ga(f[d], g[d]); + else Ga(a, h); + return g = ma(h, "script"), g.length > 0 && na(g, !i && ma(a, "script")), h + }, + cleanData: function(a) { + for (var b, c, d, e = r.event.special, f = 0; void 0 !== (c = a[f]); f++) + if (T(c)) { + if (b = c[V.expando]) { + if (b.events) + for (d in b.events) e[d] ? r.event.remove(c, d) : r.removeEvent(c, d, b.handle); + c[V.expando] = void 0 + } + c[W.expando] && (c[W.expando] = void 0) + } + } + }), r.fn.extend({ + detach: function(a) { + return Ja(this, a, !0) + }, + remove: function(a) { + return Ja(this, a) + }, + text: function(a) { + return S(this, function(a) { + return void 0 === a ? r.text(this) : this.empty().each(function() { + 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = a) + }) + }, null, a, arguments.length) + }, + append: function() { + return Ia(this, arguments, function(a) { + if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { + var b = Da(this, a); + b.appendChild(a) + } + }) + }, + prepend: function() { + return Ia(this, arguments, function(a) { + if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { + var b = Da(this, a); + b.insertBefore(a, b.firstChild) + } + }) + }, + before: function() { + return Ia(this, arguments, function(a) { + this.parentNode && this.parentNode.insertBefore(a, this) + }) + }, + after: function() { + return Ia(this, arguments, function(a) { + this.parentNode && this.parentNode.insertBefore(a, this.nextSibling) + }) + }, + empty: function() { + for (var a, b = 0; null != (a = this[b]); b++) 1 === a.nodeType && (r.cleanData(ma(a, !1)), a.textContent = ""); + return this + }, + clone: function(a, b) { + return a = null != a && a, b = null == b ? a : b, this.map(function() { + return r.clone(this, a, b) + }) + }, + html: function(a) { + return S(this, function(a) { + var b = this[0] || {}, + c = 0, + d = this.length; + if (void 0 === a && 1 === b.nodeType) return b.innerHTML; + if ("string" == typeof a && !za.test(a) && !la[(ja.exec(a) || ["", ""])[1].toLowerCase()]) { + a = r.htmlPrefilter(a); + try { + for (; c < d; c++) b = this[c] || {}, 1 === b.nodeType && (r.cleanData(ma(b, !1)), b.innerHTML = a); + b = 0 + } catch (e) {} + } + b && this.empty().append(a) + }, null, a, arguments.length) + }, + replaceWith: function() { + var a = []; + return Ia(this, arguments, function(b) { + var c = this.parentNode; + r.inArray(this, a) < 0 && (r.cleanData(ma(this)), c && c.replaceChild(b, this)) + }, a) + } + }), r.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" + }, function(a, b) { + r.fn[a] = function(a) { + for (var c, d = [], e = r(a), f = e.length - 1, g = 0; g <= f; g++) c = g === f ? this : this.clone(!0), r(e[g])[b](c), h.apply(d, c.get()); + return this.pushStack(d) + } + }); + var Ka = /^margin/, + La = new RegExp("^(" + _ + ")(?!px)[a-z%]+$", "i"), + Ma = function(b) { + var c = b.ownerDocument.defaultView; + return c && c.opener || (c = a), c.getComputedStyle(b) + }; + ! function() { + function b() { + if (i) { + i.style.cssText = "box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%", i.innerHTML = "", qa.appendChild(h); + var b = a.getComputedStyle(i); + c = "1%" !== b.top, g = "2px" === b.marginLeft, e = "4px" === b.width, i.style.marginRight = "50%", f = "4px" === b.marginRight, qa.removeChild(h), i = null + } + } + var c, e, f, g, h = d.createElement("div"), + i = d.createElement("div"); + i.style && (i.style.backgroundClip = "content-box", i.cloneNode(!0).style.backgroundClip = "", o.clearCloneStyle = "content-box" === i.style.backgroundClip, h.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute", h.appendChild(i), r.extend(o, { + pixelPosition: function() { + return b(), c + }, + boxSizingReliable: function() { + return b(), e + }, + pixelMarginRight: function() { + return b(), f + }, + reliableMarginLeft: function() { + return b(), g + } + })) + }(); + + function Na(a, b, c) { + var d, e, f, g, h = a.style; + return c = c || Ma(a), c && (g = c.getPropertyValue(b) || c[b], "" !== g || r.contains(a.ownerDocument, a) || (g = r.style(a, b)), !o.pixelMarginRight() && La.test(g) && Ka.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 !== g ? g + "" : g + } + + function Oa(a, b) { + return { + get: function() { + return a() ? void delete this.get : (this.get = b).apply(this, arguments) + } + } + } + var Pa = /^(none|table(?!-c[ea]).+)/, + Qa = { + position: "absolute", + visibility: "hidden", + display: "block" + }, + Ra = { + letterSpacing: "0", + fontWeight: "400" + }, + Sa = ["Webkit", "Moz", "ms"], + Ta = d.createElement("div").style; + + function Ua(a) { + if (a in Ta) return a; + var b = a[0].toUpperCase() + a.slice(1), + c = Sa.length; + while (c--) + if (a = Sa[c] + b, a in Ta) return a + } + + function Va(a, b, c) { + var d = aa.exec(b); + return d ? Math.max(0, d[2] - (c || 0)) + (d[3] || "px") : b + } + + function Wa(a, b, c, d, e) { + var f, g = 0; + for (f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0; f < 4; f += 2) "margin" === c && (g += r.css(a, c + ba[f], !0, e)), d ? ("content" === c && (g -= r.css(a, "padding" + ba[f], !0, e)), "margin" !== c && (g -= r.css(a, "border" + ba[f] + "Width", !0, e))) : (g += r.css(a, "padding" + ba[f], !0, e), "padding" !== c && (g += r.css(a, "border" + ba[f] + "Width", !0, e))); + return g + } + + function Xa(a, b, c) { + var d, e = !0, + f = Ma(a), + g = "border-box" === r.css(a, "boxSizing", !1, f); + if (a.getClientRects().length && (d = a.getBoundingClientRect()[b]), d <= 0 || null == d) { + if (d = Na(a, b, f), (d < 0 || null == d) && (d = a.style[b]), La.test(d)) return d; + e = g && (o.boxSizingReliable() || d === a.style[b]), d = parseFloat(d) || 0 + } + return d + Wa(a, b, c || (g ? "border" : "content"), e, f) + "px" + } + r.extend({ + cssHooks: { + opacity: { + get: function(a, b) { + if (b) { + var c = Na(a, "opacity"); + return "" === c ? "1" : c + } + } + } + }, + cssNumber: { + animationIterationCount: !0, + columnCount: !0, + fillOpacity: !0, + flexGrow: !0, + flexShrink: !0, + fontWeight: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + widows: !0, + zIndex: !0, + zoom: !0 + }, + cssProps: { + "float": "cssFloat" + }, + style: function(a, b, c, d) { + if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { + var e, f, g, h = r.camelCase(b), + i = a.style; + return b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h), g = r.cssHooks[b] || r.cssHooks[h], void 0 === c ? g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b] : (f = typeof c, "string" === f && (e = aa.exec(c)) && e[1] && (c = ea(a, b, e), f = "number"), null != c && c === c && ("number" === f && (c += e && e[3] || (r.cssNumber[h] ? "" : "px")), o.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), g && "set" in g && void 0 === (c = g.set(a, c, d)) || (i[b] = c)), void 0) + } + }, + css: function(a, b, c, d) { + var e, f, g, h = r.camelCase(b); + return b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h), g = r.cssHooks[b] || r.cssHooks[h], g && "get" in g && (e = g.get(a, !0, c)), void 0 === e && (e = Na(a, b, d)), "normal" === e && b in Ra && (e = Ra[b]), "" === c || c ? (f = parseFloat(e), c === !0 || isFinite(f) ? f || 0 : e) : e + } + }), r.each(["height", "width"], function(a, b) { + r.cssHooks[b] = { + get: function(a, c, d) { + if (c) return !Pa.test(r.css(a, "display")) || a.getClientRects().length && a.getBoundingClientRect().width ? Xa(a, b, d) : da(a, Qa, function() { + return Xa(a, b, d) + }) + }, + set: function(a, c, d) { + var e, f = d && Ma(a), + g = d && Wa(a, b, d, "border-box" === r.css(a, "boxSizing", !1, f), f); + return g && (e = aa.exec(c)) && "px" !== (e[3] || "px") && (a.style[b] = c, c = r.css(a, b)), Va(a, c, g) + } + } + }), r.cssHooks.marginLeft = Oa(o.reliableMarginLeft, function(a, b) { + if (b) return (parseFloat(Na(a, "marginLeft")) || a.getBoundingClientRect().left - da(a, { + marginLeft: 0 + }, function() { + return a.getBoundingClientRect().left + })) + "px" + }), r.each({ + margin: "", + padding: "", + border: "Width" + }, function(a, b) { + r.cssHooks[a + b] = { + expand: function(c) { + for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; d < 4; d++) e[a + ba[d] + b] = f[d] || f[d - 2] || f[0]; + return e + } + }, Ka.test(a) || (r.cssHooks[a + b].set = Va) + }), r.fn.extend({ + css: function(a, b) { + return S(this, function(a, b, c) { + var d, e, f = {}, + g = 0; + if (r.isArray(b)) { + for (d = Ma(a), e = b.length; g < e; g++) f[b[g]] = r.css(a, b[g], !1, d); + return f + } + return void 0 !== c ? r.style(a, b, c) : r.css(a, b) + }, a, b, arguments.length > 1) + } + }); + + function Ya(a, b, c, d, e) { + return new Ya.prototype.init(a, b, c, d, e) + } + r.Tween = Ya, Ya.prototype = { + constructor: Ya, + init: function(a, b, c, d, e, f) { + this.elem = a, this.prop = c, this.easing = e || r.easing._default, this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (r.cssNumber[c] ? "" : "px") + }, + cur: function() { + var a = Ya.propHooks[this.prop]; + return a && a.get ? a.get(this) : Ya.propHooks._default.get(this) + }, + run: function(a) { + var b, c = Ya.propHooks[this.prop]; + return this.options.duration ? this.pos = b = r.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Ya.propHooks._default.set(this), this + } + }, Ya.prototype.init.prototype = Ya.prototype, Ya.propHooks = { + _default: { + get: function(a) { + var b; + return 1 !== a.elem.nodeType || null != a.elem[a.prop] && null == a.elem.style[a.prop] ? a.elem[a.prop] : (b = r.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0) + }, + set: function(a) { + r.fx.step[a.prop] ? r.fx.step[a.prop](a) : 1 !== a.elem.nodeType || null == a.elem.style[r.cssProps[a.prop]] && !r.cssHooks[a.prop] ? a.elem[a.prop] = a.now : r.style(a.elem, a.prop, a.now + a.unit) + } + } + }, Ya.propHooks.scrollTop = Ya.propHooks.scrollLeft = { + set: function(a) { + a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) + } + }, r.easing = { + linear: function(a) { + return a + }, + swing: function(a) { + return .5 - Math.cos(a * Math.PI) / 2 + }, + _default: "swing" + }, r.fx = Ya.prototype.init, r.fx.step = {}; + var Za, $a, _a = /^(?:toggle|show|hide)$/, + ab = /queueHooks$/; + + function bb() { + $a && (a.requestAnimationFrame(bb), r.fx.tick()) + } + + function cb() { + return a.setTimeout(function() { + Za = void 0 + }), Za = r.now() + } + + function db(a, b) { + var c, d = 0, + e = { + height: a + }; + for (b = b ? 1 : 0; d < 4; d += 2 - b) c = ba[d], e["margin" + c] = e["padding" + c] = a; + return b && (e.opacity = e.width = a), e + } + + function eb(a, b, c) { + for (var d, e = (hb.tweeners[b] || []).concat(hb.tweeners["*"]), f = 0, g = e.length; f < g; f++) + if (d = e[f].call(c, b, a)) return d + } + + function fb(a, b, c) { + var d, e, f, g, h, i, j, k, l = "width" in b || "height" in b, + m = this, + n = {}, + o = a.style, + p = a.nodeType && ca(a), + q = V.get(a, "fxshow"); + c.queue || (g = r._queueHooks(a, "fx"), null == g.unqueued && (g.unqueued = 0, h = g.empty.fire, g.empty.fire = function() { + g.unqueued || h() + }), g.unqueued++, m.always(function() { + m.always(function() { + g.unqueued--, r.queue(a, "fx").length || g.empty.fire() + }) + })); + for (d in b) + if (e = b[d], _a.test(e)) { + if (delete b[d], f = f || "toggle" === e, e === (p ? "hide" : "show")) { + if ("show" !== e || !q || void 0 === q[d]) continue; + p = !0 + } + n[d] = q && q[d] || r.style(a, d) + } + if (i = !r.isEmptyObject(b), i || !r.isEmptyObject(n)) { + l && 1 === a.nodeType && (c.overflow = [o.overflow, o.overflowX, o.overflowY], j = q && q.display, null == j && (j = V.get(a, "display")), k = r.css(a, "display"), "none" === k && (j ? k = j : (ha([a], !0), j = a.style.display || j, k = r.css(a, "display"), ha([a]))), ("inline" === k || "inline-block" === k && null != j) && "none" === r.css(a, "float") && (i || (m.done(function() { + o.display = j + }), null == j && (k = o.display, j = "none" === k ? "" : k)), o.display = "inline-block")), c.overflow && (o.overflow = "hidden", m.always(function() { + o.overflow = c.overflow[0], o.overflowX = c.overflow[1], o.overflowY = c.overflow[2] + })), i = !1; + for (d in n) i || (q ? "hidden" in q && (p = q.hidden) : q = V.access(a, "fxshow", { + display: j + }), f && (q.hidden = !p), p && ha([a], !0), m.done(function() { + p || ha([a]), V.remove(a, "fxshow"); + for (d in n) r.style(a, d, n[d]) + })), i = eb(p ? q[d] : 0, d, m), d in q || (q[d] = i.start, p && (i.end = i.start, i.start = 0)) + } + } + + function gb(a, b) { + var c, d, e, f, g; + for (c in a) + if (d = r.camelCase(c), e = b[d], f = a[c], r.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = r.cssHooks[d], g && "expand" in g) { + f = g.expand(f), delete a[d]; + for (c in f) c in a || (a[c] = f[c], b[c] = e) + } else b[d] = e + } + + function hb(a, b, c) { + var d, e, f = 0, + g = hb.prefilters.length, + h = r.Deferred().always(function() { + delete i.elem + }), + i = function() { + if (e) return !1; + for (var b = Za || cb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; g < i; g++) j.tweens[g].run(f); + return h.notifyWith(a, [j, f, c]), f < 1 && i ? c : (h.resolveWith(a, [j]), !1) + }, + j = h.promise({ + elem: a, + props: r.extend({}, b), + opts: r.extend(!0, { + specialEasing: {}, + easing: r.easing._default + }, c), + originalProperties: b, + originalOptions: c, + startTime: Za || cb(), + duration: c.duration, + tweens: [], + createTween: function(b, c) { + var d = r.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); + return j.tweens.push(d), d + }, + stop: function(b) { + var c = 0, + d = b ? j.tweens.length : 0; + if (e) return this; + for (e = !0; c < d; c++) j.tweens[c].run(1); + return b ? (h.notifyWith(a, [j, 1, 0]), h.resolveWith(a, [j, b])) : h.rejectWith(a, [j, b]), this + } + }), + k = j.props; + for (gb(k, j.opts.specialEasing); f < g; f++) + if (d = hb.prefilters[f].call(j, a, k, j.opts)) return r.isFunction(d.stop) && (r._queueHooks(j.elem, j.opts.queue).stop = r.proxy(d.stop, d)), d; + return r.map(k, eb, j), r.isFunction(j.opts.start) && j.opts.start.call(a, j), r.fx.timer(r.extend(i, { + elem: a, + anim: j, + queue: j.opts.queue + })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) + } + r.Animation = r.extend(hb, { + tweeners: { + "*": [function(a, b) { + var c = this.createTween(a, b); + return ea(c.elem, a, aa.exec(b), c), c + }] + }, + tweener: function(a, b) { + r.isFunction(a) ? (b = a, a = ["*"]) : a = a.match(K); + for (var c, d = 0, e = a.length; d < e; d++) c = a[d], hb.tweeners[c] = hb.tweeners[c] || [], hb.tweeners[c].unshift(b) + }, + prefilters: [fb], + prefilter: function(a, b) { + b ? hb.prefilters.unshift(a) : hb.prefilters.push(a) + } + }), r.speed = function(a, b, c) { + var e = a && "object" == typeof a ? r.extend({}, a) : { + complete: c || !c && b || r.isFunction(a) && a, + duration: a, + easing: c && b || b && !r.isFunction(b) && b + }; + return r.fx.off || d.hidden ? e.duration = 0 : "number" != typeof e.duration && (e.duration in r.fx.speeds ? e.duration = r.fx.speeds[e.duration] : e.duration = r.fx.speeds._default), null != e.queue && e.queue !== !0 || (e.queue = "fx"), e.old = e.complete, e.complete = function() { + r.isFunction(e.old) && e.old.call(this), e.queue && r.dequeue(this, e.queue) + }, e + }, r.fn.extend({ + fadeTo: function(a, b, c, d) { + return this.filter(ca).css("opacity", 0).show().end().animate({ + opacity: b + }, a, c, d) + }, + animate: function(a, b, c, d) { + var e = r.isEmptyObject(a), + f = r.speed(b, c, d), + g = function() { + var b = hb(this, r.extend({}, a), f); + (e || V.get(this, "finish")) && b.stop(!0) + }; + return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) + }, + stop: function(a, b, c) { + var d = function(a) { + var b = a.stop; + delete a.stop, b(c) + }; + return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function() { + var b = !0, + e = null != a && a + "queueHooks", + f = r.timers, + g = V.get(this); + if (e) g[e] && g[e].stop && d(g[e]); + else + for (e in g) g[e] && g[e].stop && ab.test(e) && d(g[e]); + for (e = f.length; e--;) f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1)); + !b && c || r.dequeue(this, a) + }) + }, + finish: function(a) { + return a !== !1 && (a = a || "fx"), this.each(function() { + var b, c = V.get(this), + d = c[a + "queue"], + e = c[a + "queueHooks"], + f = r.timers, + g = d ? d.length : 0; + for (c.finish = !0, r.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1)); + for (b = 0; b < g; b++) d[b] && d[b].finish && d[b].finish.call(this); + delete c.finish + }) + } + }), r.each(["toggle", "show", "hide"], function(a, b) { + var c = r.fn[b]; + r.fn[b] = function(a, d, e) { + return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(db(b, !0), a, d, e) + } + }), r.each({ + slideDown: db("show"), + slideUp: db("hide"), + slideToggle: db("toggle"), + fadeIn: { + opacity: "show" + }, + fadeOut: { + opacity: "hide" + }, + fadeToggle: { + opacity: "toggle" + } + }, function(a, b) { + r.fn[a] = function(a, c, d) { + return this.animate(b, a, c, d) + } + }), r.timers = [], r.fx.tick = function() { + var a, b = 0, + c = r.timers; + for (Za = r.now(); b < c.length; b++) a = c[b], a() || c[b] !== a || c.splice(b--, 1); + c.length || r.fx.stop(), Za = void 0 + }, r.fx.timer = function(a) { + r.timers.push(a), a() ? r.fx.start() : r.timers.pop() + }, r.fx.interval = 13, r.fx.start = function() { + $a || ($a = a.requestAnimationFrame ? a.requestAnimationFrame(bb) : a.setInterval(r.fx.tick, r.fx.interval)) + }, r.fx.stop = function() { + a.cancelAnimationFrame ? a.cancelAnimationFrame($a) : a.clearInterval($a), $a = null + }, r.fx.speeds = { + slow: 600, + fast: 200, + _default: 400 + }, r.fn.delay = function(b, c) { + return b = r.fx ? r.fx.speeds[b] || b : b, c = c || "fx", this.queue(c, function(c, d) { + var e = a.setTimeout(c, b); + d.stop = function() { + a.clearTimeout(e) + } + }) + }, + + function() { + var a = d.createElement("input"), + b = d.createElement("select"), + c = b.appendChild(d.createElement("option")); + a.type = "checkbox", o.checkOn = "" !== a.value, o.optSelected = c.selected, a = d.createElement("input"), a.value = "t", a.type = "radio", o.radioValue = "t" === a.value + }(); + var ib, jb = r.expr.attrHandle; + r.fn.extend({ + attr: function(a, b) { + return S(this, r.attr, a, b, arguments.length > 1) + }, + removeAttr: function(a) { + return this.each(function() { + r.removeAttr(this, a) + }) + } + }), r.extend({ + attr: function(a, b, c) { + var d, e, f = a.nodeType; + if (3 !== f && 8 !== f && 2 !== f) return "undefined" == typeof a.getAttribute ? r.prop(a, b, c) : (1 === f && r.isXMLDoc(a) || (e = r.attrHooks[b.toLowerCase()] || (r.expr.match.bool.test(b) ? ib : void 0)), + void 0 !== c ? null === c ? void r.removeAttr(a, b) : e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : (a.setAttribute(b, c + ""), c) : e && "get" in e && null !== (d = e.get(a, b)) ? d : (d = r.find.attr(a, b), null == d ? void 0 : d)) + }, + attrHooks: { + type: { + set: function(a, b) { + if (!o.radioValue && "radio" === b && r.nodeName(a, "input")) { + var c = a.value; + return a.setAttribute("type", b), c && (a.value = c), b + } + } + } + }, + removeAttr: function(a, b) { + var c, d = 0, + e = b && b.match(K); + if (e && 1 === a.nodeType) + while (c = e[d++]) a.removeAttribute(c) + } + }), ib = { + set: function(a, b, c) { + return b === !1 ? r.removeAttr(a, c) : a.setAttribute(c, c), c + } + }, r.each(r.expr.match.bool.source.match(/\w+/g), function(a, b) { + var c = jb[b] || r.find.attr; + jb[b] = function(a, b, d) { + var e, f, g = b.toLowerCase(); + return d || (f = jb[g], jb[g] = e, e = null != c(a, b, d) ? g : null, jb[g] = f), e + } + }); + var kb = /^(?:input|select|textarea|button)$/i, + lb = /^(?:a|area)$/i; + r.fn.extend({ + prop: function(a, b) { + return S(this, r.prop, a, b, arguments.length > 1) + }, + removeProp: function(a) { + return this.each(function() { + delete this[r.propFix[a] || a] + }) + } + }), r.extend({ + prop: function(a, b, c) { + var d, e, f = a.nodeType; + if (3 !== f && 8 !== f && 2 !== f) return 1 === f && r.isXMLDoc(a) || (b = r.propFix[b] || b, e = r.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b] + }, + propHooks: { + tabIndex: { + get: function(a) { + var b = r.find.attr(a, "tabindex"); + return b ? parseInt(b, 10) : kb.test(a.nodeName) || lb.test(a.nodeName) && a.href ? 0 : -1 + } + } + }, + propFix: { + "for": "htmlFor", + "class": "className" + } + }), o.optSelected || (r.propHooks.selected = { + get: function(a) { + var b = a.parentNode; + return b && b.parentNode && b.parentNode.selectedIndex, null + }, + set: function(a) { + var b = a.parentNode; + b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex) + } + }), r.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() { + r.propFix[this.toLowerCase()] = this + }); + + function mb(a) { + var b = a.match(K) || []; + return b.join(" ") + } + + function nb(a) { + return a.getAttribute && a.getAttribute("class") || "" + } + r.fn.extend({ + addClass: function(a) { + var b, c, d, e, f, g, h, i = 0; + if (r.isFunction(a)) return this.each(function(b) { + r(this).addClass(a.call(this, b, nb(this))) + }); + if ("string" == typeof a && a) { + b = a.match(K) || []; + while (c = this[i++]) + if (e = nb(c), d = 1 === c.nodeType && " " + mb(e) + " ") { + g = 0; + while (f = b[g++]) d.indexOf(" " + f + " ") < 0 && (d += f + " "); + h = mb(d), e !== h && c.setAttribute("class", h) + } + } + return this + }, + removeClass: function(a) { + var b, c, d, e, f, g, h, i = 0; + if (r.isFunction(a)) return this.each(function(b) { + r(this).removeClass(a.call(this, b, nb(this))) + }); + if (!arguments.length) return this.attr("class", ""); + if ("string" == typeof a && a) { + b = a.match(K) || []; + while (c = this[i++]) + if (e = nb(c), d = 1 === c.nodeType && " " + mb(e) + " ") { + g = 0; + while (f = b[g++]) + while (d.indexOf(" " + f + " ") > -1) d = d.replace(" " + f + " ", " "); + h = mb(d), e !== h && c.setAttribute("class", h) + } + } + return this + }, + toggleClass: function(a, b) { + var c = typeof a; + return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : r.isFunction(a) ? this.each(function(c) { + r(this).toggleClass(a.call(this, c, nb(this), b), b) + }) : this.each(function() { + var b, d, e, f; + if ("string" === c) { + d = 0, e = r(this), f = a.match(K) || []; + while (b = f[d++]) e.hasClass(b) ? e.removeClass(b) : e.addClass(b) + } else void 0 !== a && "boolean" !== c || (b = nb(this), b && V.set(this, "__className__", b), this.setAttribute && this.setAttribute("class", b || a === !1 ? "" : V.get(this, "__className__") || "")) + }) + }, + hasClass: function(a) { + var b, c, d = 0; + b = " " + a + " "; + while (c = this[d++]) + if (1 === c.nodeType && (" " + mb(nb(c)) + " ").indexOf(b) > -1) return !0; + return !1 + } + }); + var ob = /\r/g; + r.fn.extend({ + val: function(a) { + var b, c, d, e = this[0]; { + if (arguments.length) return d = r.isFunction(a), this.each(function(c) { + var e; + 1 === this.nodeType && (e = d ? a.call(this, c, r(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : r.isArray(e) && (e = r.map(e, function(a) { + return null == a ? "" : a + "" + })), b = r.valHooks[this.type] || r.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e)) + }); + if (e) return b = r.valHooks[e.type] || r.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(ob, "") : null == c ? "" : c) + } + } + }), r.extend({ + valHooks: { + option: { + get: function(a) { + var b = r.find.attr(a, "value"); + return null != b ? b : mb(r.text(a)) + } + }, + select: { + get: function(a) { + var b, c, d, e = a.options, + f = a.selectedIndex, + g = "select-one" === a.type, + h = g ? null : [], + i = g ? f + 1 : e.length; + for (d = f < 0 ? i : g ? f : 0; d < i; d++) + if (c = e[d], (c.selected || d === f) && !c.disabled && (!c.parentNode.disabled || !r.nodeName(c.parentNode, "optgroup"))) { + if (b = r(c).val(), g) return b; + h.push(b) + } + return h + }, + set: function(a, b) { + var c, d, e = a.options, + f = r.makeArray(b), + g = e.length; + while (g--) d = e[g], (d.selected = r.inArray(r.valHooks.option.get(d), f) > -1) && (c = !0); + return c || (a.selectedIndex = -1), f + } + } + } + }), r.each(["radio", "checkbox"], function() { + r.valHooks[this] = { + set: function(a, b) { + if (r.isArray(b)) return a.checked = r.inArray(r(a).val(), b) > -1 + } + }, o.checkOn || (r.valHooks[this].get = function(a) { + return null === a.getAttribute("value") ? "on" : a.value + }) + }); + var pb = /^(?:focusinfocus|focusoutblur)$/; + r.extend(r.event, { + trigger: function(b, c, e, f) { + var g, h, i, j, k, m, n, o = [e || d], + p = l.call(b, "type") ? b.type : b, + q = l.call(b, "namespace") ? b.namespace.split(".") : []; + if (h = i = e = e || d, 3 !== e.nodeType && 8 !== e.nodeType && !pb.test(p + r.event.triggered) && (p.indexOf(".") > -1 && (q = p.split("."), p = q.shift(), q.sort()), k = p.indexOf(":") < 0 && "on" + p, b = b[r.expando] ? b : new r.Event(p, "object" == typeof b && b), b.isTrigger = f ? 2 : 3, b.namespace = q.join("."), b.rnamespace = b.namespace ? new RegExp("(^|\\.)" + q.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = e), c = null == c ? [b] : r.makeArray(c, [b]), n = r.event.special[p] || {}, f || !n.trigger || n.trigger.apply(e, c) !== !1)) { + if (!f && !n.noBubble && !r.isWindow(e)) { + for (j = n.delegateType || p, pb.test(j + p) || (h = h.parentNode); h; h = h.parentNode) o.push(h), i = h; + i === (e.ownerDocument || d) && o.push(i.defaultView || i.parentWindow || a) + } + g = 0; + while ((h = o[g++]) && !b.isPropagationStopped()) b.type = g > 1 ? j : n.bindType || p, m = (V.get(h, "events") || {})[b.type] && V.get(h, "handle"), m && m.apply(h, c), m = k && h[k], m && m.apply && T(h) && (b.result = m.apply(h, c), b.result === !1 && b.preventDefault()); + return b.type = p, f || b.isDefaultPrevented() || n._default && n._default.apply(o.pop(), c) !== !1 || !T(e) || k && r.isFunction(e[p]) && !r.isWindow(e) && (i = e[k], i && (e[k] = null), r.event.triggered = p, e[p](), r.event.triggered = void 0, i && (e[k] = i)), b.result + } + }, + simulate: function(a, b, c) { + var d = r.extend(new r.Event, c, { + type: a, + isSimulated: !0 + }); + r.event.trigger(d, null, b) + } + }), r.fn.extend({ + trigger: function(a, b) { + return this.each(function() { + r.event.trigger(a, b, this) + }) + }, + triggerHandler: function(a, b) { + var c = this[0]; + if (c) return r.event.trigger(a, b, c, !0) + } + }), r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function(a, b) { + r.fn[b] = function(a, c) { + return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) + } + }), r.fn.extend({ + hover: function(a, b) { + return this.mouseenter(a).mouseleave(b || a) + } + }), o.focusin = "onfocusin" in a, o.focusin || r.each({ + focus: "focusin", + blur: "focusout" + }, function(a, b) { + var c = function(a) { + r.event.simulate(b, a.target, r.event.fix(a)) + }; + r.event.special[b] = { + setup: function() { + var d = this.ownerDocument || this, + e = V.access(d, b); + e || d.addEventListener(a, c, !0), V.access(d, b, (e || 0) + 1) + }, + teardown: function() { + var d = this.ownerDocument || this, + e = V.access(d, b) - 1; + e ? V.access(d, b, e) : (d.removeEventListener(a, c, !0), V.remove(d, b)) + } + } + }); + var qb = a.location, + rb = r.now(), + sb = /\?/; + r.parseXML = function(b) { + var c; + if (!b || "string" != typeof b) return null; + try { + c = (new a.DOMParser).parseFromString(b, "text/xml") + } catch (d) { + c = void 0 + } + return c && !c.getElementsByTagName("parsererror").length || r.error("Invalid XML: " + b), c + }; + var tb = /\[\]$/, + ub = /\r?\n/g, + vb = /^(?:submit|button|image|reset|file)$/i, + wb = /^(?:input|select|textarea|keygen)/i; + + function xb(a, b, c, d) { + var e; + if (r.isArray(b)) r.each(b, function(b, e) { + c || tb.test(a) ? d(a, e) : xb(a + "[" + ("object" == typeof e && null != e ? b : "") + "]", e, c, d) + }); + else if (c || "object" !== r.type(b)) d(a, b); + else + for (e in b) xb(a + "[" + e + "]", b[e], c, d) + } + r.param = function(a, b) { + var c, d = [], + e = function(a, b) { + var c = r.isFunction(b) ? b() : b; + d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(null == c ? "" : c) + }; + if (r.isArray(a) || a.jquery && !r.isPlainObject(a)) r.each(a, function() { + e(this.name, this.value) + }); + else + for (c in a) xb(c, a[c], b, e); + return d.join("&") + }, r.fn.extend({ + serialize: function() { + return r.param(this.serializeArray()) + }, + serializeArray: function() { + return this.map(function() { + var a = r.prop(this, "elements"); + return a ? r.makeArray(a) : this + }).filter(function() { + var a = this.type; + return this.name && !r(this).is(":disabled") && wb.test(this.nodeName) && !vb.test(a) && (this.checked || !ia.test(a)) + }).map(function(a, b) { + var c = r(this).val(); + return null == c ? null : r.isArray(c) ? r.map(c, function(a) { + return { + name: b.name, + value: a.replace(ub, "\r\n") + } + }) : { + name: b.name, + value: c.replace(ub, "\r\n") + } + }).get() + } + }); + var yb = /%20/g, + zb = /#.*$/, + Ab = /([?&])_=[^&]*/, + Bb = /^(.*?):[ \t]*([^\r\n]*)$/gm, + Cb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + Db = /^(?:GET|HEAD)$/, + Eb = /^\/\//, + Fb = {}, + Gb = {}, + Hb = "*/".concat("*"), + Ib = d.createElement("a"); + Ib.href = qb.href; + + function Jb(a) { + return function(b, c) { + "string" != typeof b && (c = b, b = "*"); + var d, e = 0, + f = b.toLowerCase().match(K) || []; + if (r.isFunction(c)) + while (d = f[e++]) "+" === d[0] ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c) + } + } + + function Kb(a, b, c, d) { + var e = {}, + f = a === Gb; + + function g(h) { + var i; + return e[h] = !0, r.each(a[h] || [], function(a, h) { + var j = h(b, c, d); + return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1) + }), i + } + return g(b.dataTypes[0]) || !e["*"] && g("*") + } + + function Lb(a, b) { + var c, d, e = r.ajaxSettings.flatOptions || {}; + for (c in b) void 0 !== b[c] && ((e[c] ? a : d || (d = {}))[c] = b[c]); + return d && r.extend(!0, a, d), a + } + + function Mb(a, b, c) { + var d, e, f, g, h = a.contents, + i = a.dataTypes; + while ("*" === i[0]) i.shift(), void 0 === d && (d = a.mimeType || b.getResponseHeader("Content-Type")); + if (d) + for (e in h) + if (h[e] && h[e].test(d)) { + i.unshift(e); + break + } + if (i[0] in c) f = i[0]; + else { + for (e in c) { + if (!i[0] || a.converters[e + " " + i[0]]) { + f = e; + break + } + g || (g = e) + } + f = f || g + } + if (f) return f !== i[0] && i.unshift(f), c[f] + } + + function Nb(a, b, c, d) { + var e, f, g, h, i, j = {}, + k = a.dataTypes.slice(); + if (k[1]) + for (g in a.converters) j[g.toLowerCase()] = a.converters[g]; + f = k.shift(); + while (f) + if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift()) + if ("*" === f) f = i; + else if ("*" !== i && i !== f) { + if (g = j[i + " " + f] || j["* " + f], !g) + for (e in j) + if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) { + g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1])); + break + } + if (g !== !0) + if (g && a["throws"]) b = g(b); + else try { + b = g(b) + } catch (l) { + return { + state: "parsererror", + error: g ? l : "No conversion from " + i + " to " + f + } + } + } + return { + state: "success", + data: b + } + } + r.extend({ + active: 0, + lastModified: {}, + etag: {}, + ajaxSettings: { + url: qb.href, + type: "GET", + isLocal: Cb.test(qb.protocol), + global: !0, + processData: !0, + async: !0, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + accepts: { + "*": Hb, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + converters: { + "* text": String, + "text html": !0, + "text json": JSON.parse, + "text xml": r.parseXML + }, + flatOptions: { + url: !0, + context: !0 + } + }, + ajaxSetup: function(a, b) { + return b ? Lb(Lb(a, r.ajaxSettings), b) : Lb(r.ajaxSettings, a) + }, + ajaxPrefilter: Jb(Fb), + ajaxTransport: Jb(Gb), + ajax: function(b, c) { + "object" == typeof b && (c = b, b = void 0), c = c || {}; + var e, f, g, h, i, j, k, l, m, n, o = r.ajaxSetup({}, c), + p = o.context || o, + q = o.context && (p.nodeType || p.jquery) ? r(p) : r.event, + s = r.Deferred(), + t = r.Callbacks("once memory"), + u = o.statusCode || {}, + v = {}, + w = {}, + x = "canceled", + y = { + readyState: 0, + getResponseHeader: function(a) { + var b; + if (k) { + if (!h) { + h = {}; + while (b = Bb.exec(g)) h[b[1].toLowerCase()] = b[2] + } + b = h[a.toLowerCase()] + } + return null == b ? null : b + }, + getAllResponseHeaders: function() { + return k ? g : null + }, + setRequestHeader: function(a, b) { + return null == k && (a = w[a.toLowerCase()] = w[a.toLowerCase()] || a, v[a] = b), this + }, + overrideMimeType: function(a) { + return null == k && (o.mimeType = a), this + }, + statusCode: function(a) { + var b; + if (a) + if (k) y.always(a[y.status]); + else + for (b in a) u[b] = [u[b], a[b]]; + return this + }, + abort: function(a) { + var b = a || x; + return e && e.abort(b), A(0, b), this + } + }; + if (s.promise(y), o.url = ((b || o.url || qb.href) + "").replace(Eb, qb.protocol + "//"), o.type = c.method || c.type || o.method || o.type, o.dataTypes = (o.dataType || "*").toLowerCase().match(K) || [""], null == o.crossDomain) { + j = d.createElement("a"); + try { + j.href = o.url, j.href = j.href, o.crossDomain = Ib.protocol + "//" + Ib.host != j.protocol + "//" + j.host + } catch (z) { + o.crossDomain = !0 + } + } + if (o.data && o.processData && "string" != typeof o.data && (o.data = r.param(o.data, o.traditional)), Kb(Fb, o, c, y), k) return y; + l = r.event && o.global, l && 0 === r.active++ && r.event.trigger("ajaxStart"), o.type = o.type.toUpperCase(), o.hasContent = !Db.test(o.type), f = o.url.replace(zb, ""), o.hasContent ? o.data && o.processData && 0 === (o.contentType || "").indexOf("application/x-www-form-urlencoded") && (o.data = o.data.replace(yb, "+")) : (n = o.url.slice(f.length), o.data && (f += (sb.test(f) ? "&" : "?") + o.data, delete o.data), o.cache === !1 && (f = f.replace(Ab, "$1"), n = (sb.test(f) ? "&" : "?") + "_=" + rb++ + n), o.url = f + n), o.ifModified && (r.lastModified[f] && y.setRequestHeader("If-Modified-Since", r.lastModified[f]), r.etag[f] && y.setRequestHeader("If-None-Match", r.etag[f])), (o.data && o.hasContent && o.contentType !== !1 || c.contentType) && y.setRequestHeader("Content-Type", o.contentType), y.setRequestHeader("Accept", o.dataTypes[0] && o.accepts[o.dataTypes[0]] ? o.accepts[o.dataTypes[0]] + ("*" !== o.dataTypes[0] ? ", " + Hb + "; q=0.01" : "") : o.accepts["*"]); + for (m in o.headers) y.setRequestHeader(m, o.headers[m]); + if (o.beforeSend && (o.beforeSend.call(p, y, o) === !1 || k)) return y.abort(); + if (x = "abort", t.add(o.complete), y.done(o.success), y.fail(o.error), e = Kb(Gb, o, c, y)) { + if (y.readyState = 1, l && q.trigger("ajaxSend", [y, o]), k) return y; + o.async && o.timeout > 0 && (i = a.setTimeout(function() { + y.abort("timeout") + }, o.timeout)); + try { + k = !1, e.send(v, A) + } catch (z) { + if (k) throw z; + A(-1, z) + } + } else A(-1, "No Transport"); + + function A(b, c, d, h) { + var j, m, n, v, w, x = c; + k || (k = !0, i && a.clearTimeout(i), e = void 0, g = h || "", y.readyState = b > 0 ? 4 : 0, j = b >= 200 && b < 300 || 304 === b, d && (v = Mb(o, y, d)), v = Nb(o, v, y, j), j ? (o.ifModified && (w = y.getResponseHeader("Last-Modified"), w && (r.lastModified[f] = w), w = y.getResponseHeader("etag"), w && (r.etag[f] = w)), 204 === b || "HEAD" === o.type ? x = "nocontent" : 304 === b ? x = "notmodified" : (x = v.state, m = v.data, n = v.error, j = !n)) : (n = x, !b && x || (x = "error", b < 0 && (b = 0))), y.status = b, y.statusText = (c || x) + "", j ? s.resolveWith(p, [m, x, y]) : s.rejectWith(p, [y, x, n]), y.statusCode(u), u = void 0, l && q.trigger(j ? "ajaxSuccess" : "ajaxError", [y, o, j ? m : n]), t.fireWith(p, [y, x]), l && (q.trigger("ajaxComplete", [y, o]), --r.active || r.event.trigger("ajaxStop"))) + } + return y + }, + getJSON: function(a, b, c) { + return r.get(a, b, c, "json") + }, + getScript: function(a, b) { + return r.get(a, void 0, b, "script") + } + }), r.each(["get", "post"], function(a, b) { + r[b] = function(a, c, d, e) { + return r.isFunction(c) && (e = e || d, d = c, c = void 0), r.ajax(r.extend({ + url: a, + type: b, + dataType: e, + data: c, + success: d + }, r.isPlainObject(a) && a)) + } + }), r._evalUrl = function(a) { + return r.ajax({ + url: a, + type: "GET", + dataType: "script", + cache: !0, + async: !1, + global: !1, + "throws": !0 + }) + }, r.fn.extend({ + wrapAll: function(a) { + var b; + return this[0] && (r.isFunction(a) && (a = a.call(this[0])), b = r(a, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && b.insertBefore(this[0]), b.map(function() { + var a = this; + while (a.firstElementChild) a = a.firstElementChild; + return a + }).append(this)), this + }, + wrapInner: function(a) { + return r.isFunction(a) ? this.each(function(b) { + r(this).wrapInner(a.call(this, b)) + }) : this.each(function() { + var b = r(this), + c = b.contents(); + c.length ? c.wrapAll(a) : b.append(a) + }) + }, + wrap: function(a) { + var b = r.isFunction(a); + return this.each(function(c) { + r(this).wrapAll(b ? a.call(this, c) : a) + }) + }, + unwrap: function(a) { + return this.parent(a).not("body").each(function() { + r(this).replaceWith(this.childNodes) + }), this + } + }), r.expr.pseudos.hidden = function(a) { + return !r.expr.pseudos.visible(a) + }, r.expr.pseudos.visible = function(a) { + return !!(a.offsetWidth || a.offsetHeight || a.getClientRects().length) + }, r.ajaxSettings.xhr = function() { + try { + return new a.XMLHttpRequest + } catch (b) {} + }; + var Ob = { + 0: 200, + 1223: 204 + }, + Pb = r.ajaxSettings.xhr(); + o.cors = !!Pb && "withCredentials" in Pb, o.ajax = Pb = !!Pb, r.ajaxTransport(function(b) { + var c, d; + if (o.cors || Pb && !b.crossDomain) return { + send: function(e, f) { + var g, h = b.xhr(); + if (h.open(b.type, b.url, b.async, b.username, b.password), b.xhrFields) + for (g in b.xhrFields) h[g] = b.xhrFields[g]; + b.mimeType && h.overrideMimeType && h.overrideMimeType(b.mimeType), b.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"); + for (g in e) h.setRequestHeader(g, e[g]); + c = function(a) { + return function() { + c && (c = d = h.onload = h.onerror = h.onabort = h.onreadystatechange = null, "abort" === a ? h.abort() : "error" === a ? "number" != typeof h.status ? f(0, "error") : f(h.status, h.statusText) : f(Ob[h.status] || h.status, h.statusText, "text" !== (h.responseType || "text") || "string" != typeof h.responseText ? { + binary: h.response + } : { + text: h.responseText + }, h.getAllResponseHeaders())) + } + }, h.onload = c(), d = h.onerror = c("error"), void 0 !== h.onabort ? h.onabort = d : h.onreadystatechange = function() { + 4 === h.readyState && a.setTimeout(function() { + c && d() + }) + }, c = c("abort"); + try { + h.send(b.hasContent && b.data || null) + } catch (i) { + if (c) throw i + } + }, + abort: function() { + c && c() + } + } + }), r.ajaxPrefilter(function(a) { + a.crossDomain && (a.contents.script = !1) + }), r.ajaxSetup({ + accepts: { + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function(a) { + return r.globalEval(a), a + } + } + }), r.ajaxPrefilter("script", function(a) { + void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET") + }), r.ajaxTransport("script", function(a) { + if (a.crossDomain) { + var b, c; + return { + send: function(e, f) { + b = r("<script>").prop({ + charset: a.scriptCharset, + src: a.url + }).on("load error", c = function(a) { + b.remove(), c = null, a && f("error" === a.type ? 404 : 200, a.type) + }), d.head.appendChild(b[0]) + }, + abort: function() { + c && c() + } + } + } + }); + var Qb = [], + Rb = /(=)\?(?=&|$)|\?\?/; + r.ajaxSetup({ + jsonp: "callback", + jsonpCallback: function() { + var a = Qb.pop() || r.expando + "_" + rb++; + return this[a] = !0, a + } + }), r.ajaxPrefilter("json jsonp", function(b, c, d) { + var e, f, g, h = b.jsonp !== !1 && (Rb.test(b.url) ? "url" : "string" == typeof b.data && 0 === (b.contentType || "").indexOf("application/x-www-form-urlencoded") && Rb.test(b.data) && "data"); + if (h || "jsonp" === b.dataTypes[0]) return e = b.jsonpCallback = r.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(Rb, "$1" + e) : b.jsonp !== !1 && (b.url += (sb.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function() { + return g || r.error(e + " was not called"), g[0] + }, b.dataTypes[0] = "json", f = a[e], a[e] = function() { + g = arguments + }, d.always(function() { + void 0 === f ? r(a).removeProp(e) : a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, Qb.push(e)), g && r.isFunction(f) && f(g[0]), g = f = void 0 + }), "script" + }), o.createHTMLDocument = function() { + var a = d.implementation.createHTMLDocument("").body; + return a.innerHTML = "<form></form><form></form>", 2 === a.childNodes.length + }(), r.parseHTML = function(a, b, c) { + if ("string" != typeof a) return []; + "boolean" == typeof b && (c = b, b = !1); + var e, f, g; + return b || (o.createHTMLDocument ? (b = d.implementation.createHTMLDocument(""), e = b.createElement("base"), e.href = d.location.href, b.head.appendChild(e)) : b = d), f = B.exec(a), g = !c && [], f ? [b.createElement(f[1])] : (f = pa([a], b, g), g && g.length && r(g).remove(), r.merge([], f.childNodes)) + }, r.fn.load = function(a, b, c) { + var d, e, f, g = this, + h = a.indexOf(" "); + return h > -1 && (d = mb(a.slice(h)), a = a.slice(0, h)), r.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (e = "POST"), g.length > 0 && r.ajax({ + url: a, + type: e || "GET", + dataType: "html", + data: b + }).done(function(a) { + f = arguments, g.html(d ? r("<div>").append(r.parseHTML(a)).find(d) : a) + }).always(c && function(a, b) { + g.each(function() { + c.apply(this, f || [a.responseText, b, a]) + }) + }), this + }, r.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(a, b) { + r.fn[b] = function(a) { + return this.on(b, a) + } + }), r.expr.pseudos.animated = function(a) { + return r.grep(r.timers, function(b) { + return a === b.elem + }).length + }; + + function Sb(a) { + return r.isWindow(a) ? a : 9 === a.nodeType && a.defaultView + } + r.offset = { + setOffset: function(a, b, c) { + var d, e, f, g, h, i, j, k = r.css(a, "position"), + l = r(a), + m = {}; + "static" === k && (a.style.position = "relative"), h = l.offset(), f = r.css(a, "top"), i = r.css(a, "left"), j = ("absolute" === k || "fixed" === k) && (f + i).indexOf("auto") > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), r.isFunction(b) && (b = b.call(a, c, r.extend({}, h))), null != b.top && (m.top = b.top - h.top + g), null != b.left && (m.left = b.left - h.left + e), "using" in b ? b.using.call(a, m) : l.css(m) + } + }, r.fn.extend({ + offset: function(a) { + if (arguments.length) return void 0 === a ? this : this.each(function(b) { + r.offset.setOffset(this, a, b) + }); + var b, c, d, e, f = this[0]; + if (f) return f.getClientRects().length ? (d = f.getBoundingClientRect(), d.width || d.height ? (e = f.ownerDocument, c = Sb(e), b = e.documentElement, { + top: d.top + c.pageYOffset - b.clientTop, + left: d.left + c.pageXOffset - b.clientLeft + }) : d) : { + top: 0, + left: 0 + } + }, + position: function() { + if (this[0]) { + var a, b, c = this[0], + d = { + top: 0, + left: 0 + }; + return "fixed" === r.css(c, "position") ? b = c.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), r.nodeName(a[0], "html") || (d = a.offset()), d = { + top: d.top + r.css(a[0], "borderTopWidth", !0), + left: d.left + r.css(a[0], "borderLeftWidth", !0) + }), { + top: b.top - d.top - r.css(c, "marginTop", !0), + left: b.left - d.left - r.css(c, "marginLeft", !0) + } + } + }, + offsetParent: function() { + return this.map(function() { + var a = this.offsetParent; + while (a && "static" === r.css(a, "position")) a = a.offsetParent; + return a || qa + }) + } + }), r.each({ + scrollLeft: "pageXOffset", + scrollTop: "pageYOffset" + }, function(a, b) { + var c = "pageYOffset" === b; + r.fn[a] = function(d) { + return S(this, function(a, d, e) { + var f = Sb(a); + return void 0 === e ? f ? f[b] : a[d] : void(f ? f.scrollTo(c ? f.pageXOffset : e, c ? e : f.pageYOffset) : a[d] = e) + }, a, d, arguments.length) + } + }), r.each(["top", "left"], function(a, b) { + r.cssHooks[b] = Oa(o.pixelPosition, function(a, c) { + if (c) return c = Na(a, b), La.test(c) ? r(a).position()[b] + "px" : c + }) + }), r.each({ + Height: "height", + Width: "width" + }, function(a, b) { + r.each({ + padding: "inner" + a, + content: b, + "": "outer" + a + }, function(c, d) { + r.fn[d] = function(e, f) { + var g = arguments.length && (c || "boolean" != typeof e), + h = c || (e === !0 || f === !0 ? "margin" : "border"); + return S(this, function(b, c, e) { + var f; + return r.isWindow(b) ? 0 === d.indexOf("outer") ? b["inner" + a] : b.document.documentElement["client" + a] : 9 === b.nodeType ? (f = b.documentElement, Math.max(b.body["scroll" + a], f["scroll" + a], b.body["offset" + a], f["offset" + a], f["client" + a])) : void 0 === e ? r.css(b, c, h) : r.style(b, c, e, h) + }, b, g ? e : void 0, g) + } + }) + }), r.fn.extend({ + bind: function(a, b, c) { + return this.on(a, null, b, c) + }, + unbind: function(a, b) { + return this.off(a, null, b) + }, + delegate: function(a, b, c, d) { + return this.on(b, a, c, d) + }, + undelegate: function(a, b, c) { + return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c) + } + }), r.parseJSON = JSON.parse, "function" == typeof define && define.amd && define("jquery", [], function() { + return r + }); + var Tb = a.jQuery, + Ub = a.$; + return r.noConflict = function(b) { + return a.$ === r && (a.$ = Ub), b && a.jQuery === r && (a.jQuery = Tb), r + }, b || (a.jQuery = a.$ = r), r +}); diff --git a/src/LICENSE b/src/LICENSE new file mode 100644 index 0000000..6a03062 --- /dev/null +++ b/src/LICENSE @@ -0,0 +1,202 @@ + The Artistic License 2.0 + + Copyright (c) 2000-2006, The Perl Foundation. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble + +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or redistributed. +The intent is that the Copyright Holder maintains some artistic +control over the development of that Package while still keeping the +Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. + +Definitions + + "Copyright Holder" means the individual(s) or organization(s) + named in the copyright notice for the entire Package. + + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. + + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. + + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. + + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. + + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested + by the Copyright Holder. + + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright + Holder. + + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. + + "Source" form means the source code, documentation source, and + configuration files for the Package. + + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. + + +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. + + +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. + + +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: + + (a) make the Modified Version available to the Copyright Holder + of the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, + modify and redistribute the Modified Version using the same + licensing terms that apply to the copy that the licensee + received, and requires that the Source form of the Modified + Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor + Fees are allowed. + + +Distribution of Compiled Forms of the Standard Version +or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further distribution. +If you provide valid instructions or cease distribution within thirty +days after you become aware that the instructions are invalid, then +you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without +the Source, provided that you comply with Section 4 with respect to +the Source of the Modified Version. + + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified +Version made by someone other than you, you are nevertheless required +to ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: +THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS +IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL +LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/src/buffer.svg b/src/buffer.svg new file mode 100644 index 0000000..ebc4aab --- /dev/null +++ b/src/buffer.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="buffer.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M16 0c-1.104 0-2 0.896-2 2v4c0 1.104 0.896 2 2 2s2-0.896 2-2v-4c0-1.104-0.896-2-2-2zM16 24c-1.104 0-2 0.894-2 2v4c0 1.106 0.896 2 2 2s2-0.894 2-2v-4c0-1.106-0.896-2-2-2zM24.484 10.344l2.828-2.83c0.782-0.78 0.782-2.048 0-2.828-0.78-0.782-2.046-0.782-2.828 0l-2.828 2.828c-0.782 0.782-0.782 2.048 0 2.83 0.782 0.78 2.048 0.78 2.828 0zM7.514 21.656l-2.828 2.828c-0.782 0.782-0.782 2.048 0 2.828 0.78 0.782 2.046 0.782 2.828 0l2.828-2.828c0.782-0.782 0.782-2.046 0-2.828-0.78-0.78-2.046-0.78-2.828 0zM7.514 4.686c-0.782-0.782-2.048-0.782-2.828 0-0.782 0.78-0.782 2.048 0 2.828l2.828 2.83c0.782 0.78 2.048 0.78 2.828 0 0.782-0.782 0.782-2.048 0-2.83l-2.828-2.828zM24.484 21.656c-0.782-0.782-2.046-0.782-2.828 0s-0.782 2.046 0 2.828l2.828 2.828c0.782 0.782 2.048 0.782 2.828 0 0.782-0.78 0.782-2.046 0-2.828l-2.828-2.828zM30 14h-4c-1.106 0-2 0.896-2 2s0.894 2 2 2h4c1.106 0 2-0.896 2-2s-0.894-2-2-2zM8 16c0-1.104-0.896-2-2-2h-4c-1.104 0-2 0.896-2 2s0.896 2 2 2h4c1.104 0 2-0.896 2-2z" + id="path4"/> +</svg> diff --git a/src/caption.svg b/src/caption.svg new file mode 100644 index 0000000..f2ca228 --- /dev/null +++ b/src/caption.svg @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="48" + height="32" + viewBox="0 0 48 32" + id="svg3364" + inkscape:version="0.91 r13725" + sodipodi:docname="caption.svg"> + <metadata id="metadata3372"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs3370"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview3368" + showgrid="false" + showguides="true" + inkscape:guide-bbox="true" + inkscape:zoom="5.6568543" + inkscape:cx="25.343922" + inkscape:cy="16.742589" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg3364"> + <sodipodi:guide position="48.007813,-0.00390625" orientation="-0.70710678,0.70710678" id="guide3374"/> + <sodipodi:guide position="0,31.996094" orientation="-0.70710678,0.70710678" id="guide3376"/> + <sodipodi:guide position="48.003906,31.992188" orientation="0.70710678,0.70710678" id="guide3378"/> + <sodipodi:guide position="0.00390625,-0.0078125" orientation="0.70710678,0.70710678" id="guide3380"/> + <sodipodi:guide position="64.003907,15.992187" orientation="0,1" id="guide3382"/> + <sodipodi:guide position="24.003907,-24.007813" orientation="1,0" id="guide3384"/> + </sodipodi:namedview> + <path + fill="#444444" + d="M41.368 30h-34.736c-2.559 0-4.632-2.089-4.632-4.667v-18.667c0-2.578 2.073-4.666 4.632-4.666h34.736c2.559 0 4.632 2.088 4.632 4.666v18.667c0 2.578-2.073 4.667-4.632 4.667zM14.176 14.374c0.132-0.548 0.34-1.040 0.625-1.47 0.285-0.435 0.658-0.777 1.116-1.034 0.463-0.257 1.019-0.385 1.677-0.385 0.361 0 0.704 0.058 1.033 0.177 0.329 0.121 0.625 0.287 0.884 0.499 0.263 0.215 0.48 0.462 0.653 0.742 0.174 0.28 0.285 0.59 0.335 0.929h2.826c-0.086-0.774-0.296-1.464-0.633-2.063-0.333-0.602-0.759-1.104-1.273-1.513-0.517-0.406-1.1-0.716-1.75-0.928-0.647-0.21-1.343-0.32-2.075-0.32-1.019 0-1.935 0.183-2.747 0.546-0.81 0.361-1.499 0.863-2.061 1.5-0.556 0.638-0.984 1.386-1.28 2.24-0.302 0.858-0.448 1.786-0.448 2.788 0 0.975 0.148 1.885 0.448 2.729 0.296 0.846 0.726 1.58 1.282 2.205s1.244 1.12 2.057 1.471c0.811 0.358 1.728 0.536 2.746 0.536 0.82 0 1.571-0.123 2.253-0.372 0.685-0.25 1.278-0.614 1.788-1.091 0.51-0.475 0.918-1.051 1.229-1.727 0.31-0.677 0.503-1.43 0.579-2.271h-2.83c-0.111 0.901-0.417 1.626-0.922 2.178-0.505 0.551-1.204 0.826-2.099 0.826-0.657 0-1.215-0.13-1.677-0.386-0.458-0.257-0.833-0.598-1.115-1.021-0.285-0.424-0.494-0.903-0.625-1.436-0.129-0.537-0.193-1.083-0.193-1.645 0-0.587 0.064-1.158 0.193-1.708h0.004v0.004zM27.979 14.374c0.131-0.548 0.337-1.040 0.625-1.47 0.282-0.435 0.656-0.777 1.112-1.034 0.463-0.257 1.020-0.385 1.679-0.385 0.359 0 0.704 0.058 1.033 0.177 0.323 0.121 0.625 0.287 0.88 0.499 0.265 0.215 0.479 0.462 0.655 0.742 0.173 0.28 0.284 0.59 0.333 0.929h2.833c-0.088-0.774-0.303-1.464-0.636-2.063-0.333-0.602-0.759-1.104-1.272-1.513-0.517-0.406-1.102-0.716-1.751-0.928-0.652-0.21-1.343-0.32-2.077-0.32-1.020 0-1.934 0.183-2.746 0.546-0.812 0.361-1.5 0.863-2.062 1.5-0.557 0.638-0.983 1.386-1.283 2.24-0.296 0.858-0.445 1.786-0.445 2.788 0 0.975 0.149 1.885 0.445 2.729 0.302 0.846 0.728 1.58 1.284 2.205 0.558 0.625 1.246 1.12 2.062 1.471 0.812 0.358 1.726 0.536 2.744 0.536 0.819 0 1.569-0.123 2.253-0.372 0.684-0.25 1.278-0.614 1.788-1.091 0.51-0.475 0.92-1.051 1.228-1.727 0.313-0.678 0.506-1.43 0.579-2.271h-2.829c-0.116 0.901-0.418 1.626-0.923 2.178-0.505 0.551-1.203 0.826-2.096 0.826-0.657 0-1.217-0.13-1.677-0.386-0.464-0.257-0.835-0.598-1.118-1.021-0.287-0.424-0.493-0.903-0.625-1.436-0.131-0.537-0.194-1.083-0.194-1.645 0-0.587 0.063-1.158 0.194-1.708h0.006v0.004z" + id="path3366"/> +</svg> diff --git a/src/close.svg b/src/close.svg new file mode 100644 index 0000000..abf744b --- /dev/null +++ b/src/close.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="close.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M21.1 16l7.7 7.7c1.5 1.5 1.5 3.9 0 5.1-1.5 1.5-3.9 1.5-5.1 0l-7.7-7.7-7.7 7.7c-1.5 1.5-3.9 1.5-5.1 0-1.5-1.5-1.5-3.9 0-5.1l7.7-7.7-7.7-7.7c-1.5-1.5-1.5-3.9 0-5.1 1.5-1.5 3.9-1.5 5.1 0l7.7 7.7 7.7-7.7c1.5-1.5 3.9-1.5 5.1 0 1.5 1.5 1.5 3.9 0 5.1l-7.7 7.7z" + id="path4"/> +</svg> diff --git a/src/cue.svg b/src/cue.svg new file mode 100644 index 0000000..b1c64b0 --- /dev/null +++ b/src/cue.svg @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="cue.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path fill="#444444" d="M25 16c0 4.969-4.029 9-9 9s-9-4.031-9-9 4.029-9 9-9 9 4.031 9 9z" id="path4"/> +</svg> diff --git a/src/error.svg b/src/error.svg new file mode 100644 index 0000000..86db2a9 --- /dev/null +++ b/src/error.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="36" + height="32" + viewBox="0 0 36 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="error.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="18" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M32.555 25.219l-12.519-21.436c-1.044-1.044-2.738-1.044-3.782 0l-12.52 21.436c-1.044 1.043-1.044 2.736 0 3.781h28.82c1.046-1.045 1.046-2.738 0.001-3.781zM16.992 11.478c0-0.829 0.672-1.5 1.5-1.5s1.5 0.671 1.5 1.5v7c0 0.828-0.672 1.5-1.5 1.5s-1.5-0.672-1.5-1.5v-7zM18.501 24.986c-0.828 0-1.5-0.67-1.5-1.5 0-0.828 0.672-1.5 1.5-1.5s1.5 0.672 1.5 1.5c0 0.83-0.672 1.5-1.5 1.5z" + id="path4"/> +</svg> diff --git a/src/fullscreen.off.svg b/src/fullscreen.off.svg new file mode 100644 index 0000000..61c12f1 --- /dev/null +++ b/src/fullscreen.off.svg @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="fullscreen.off.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2"/> + <path fill="#444444" d="M26.533 9.623l3.986 3.986h-12.185v-12.185l3.986 3.986 5.352-5.352 4.327 4.327-5.466 5.238zM9.68 26.59l-5.352 5.352-4.327-4.327 5.352-5.352-3.986-3.986h12.185v12.185l-3.872-3.872z" id="path4"/> +</svg> diff --git a/src/fullscreen.svg b/src/fullscreen.svg new file mode 100644 index 0000000..6a99fb5 --- /dev/null +++ b/src/fullscreen.svg @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="fullscreen.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path fill="#444444" d="M0.104 31.896v-14.079l4.542 4.542 6.245-6.245 4.996 4.996-6.245 6.245 4.542 4.542h-14.079zM17.817 0.104h14.079v14.079l-4.542-4.542-6.245 6.245-4.996-4.996 6.245-6.245-4.542-4.542z" id="path4"/> +</svg> diff --git a/src/next.svg b/src/next.svg new file mode 100644 index 0000000..9855b9f --- /dev/null +++ b/src/next.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="36" + height="32" + viewBox="0 0 36 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="next.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="18" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M23.481 14.802l-17.975-12.35c-1.427-0.956-2.598-0.254-2.598 1.56v23.979c0 1.809 1.17 2.51 2.598 1.56l17.975-12.355c0 0 0.696-0.497 0.696-1.193 0-0.699-0.696-1.2-0.696-1.2zM27.863 1.027h2.496c1.38 0 2.496 0.12 2.496 1.497v26.951c0 1.377-1.115 1.497-2.496 1.497h-2.496c-1.38 0-2.496-0.12-2.496-1.497v-26.951c0-1.377 1.115-1.497 2.496-1.497z" + id="path4"/> +</svg> diff --git a/src/pause.svg b/src/pause.svg new file mode 100644 index 0000000..c41104c --- /dev/null +++ b/src/pause.svg @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="pause.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path fill="#444444" d="M9 0h-6c-1.105 0-2 0.894-2 2v28c0 1.106 0.896 2 2 2h6c1.105 0 2-0.894 2-2v-28c0-1.106-0.896-2-2-2zM29 0h-6c-1.106 0-2 0.894-2 2v28c0 1.106 0.894 2 2 2h6c1.106 0 2-0.894 2-2v-28c0-1.106-0.894-2-2-2z" id="path4"/> +</svg> diff --git a/src/play.svg b/src/play.svg new file mode 100644 index 0000000..4c96ee2 --- /dev/null +++ b/src/play.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="play.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M28.409 14.079l-23.155-13.782c-0.283-0.166-0.574-0.266-0.907-0.266-0.907 0-1.647 0.749-1.647 1.663h-0.008v28.611h0.008c0 0.915 0.74 1.663 1.647 1.663 0.341 0 0.624-0.116 0.932-0.283l23.13-13.765c0.549-0.457 0.898-1.148 0.898-1.921s-0.349-1.455-0.898-1.921z" + id="path4"/> +</svg> diff --git a/src/playicon.svg b/src/playicon.svg new file mode 100644 index 0000000..952ad4c --- /dev/null +++ b/src/playicon.svg @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="playicon.svg"> + <metadata id="metadata12"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs10"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview8" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M16.008 4.013c6.629 0 11.999 5.369 11.999 11.999s-5.369 11.999-11.999 11.999-11.999-5.369-11.999-11.999 5.369-11.999 11.999-11.999zM16.008 1.013c-8.279 0-14.998 6.719-14.998 14.998s6.719 14.998 14.998 14.998 14.998-6.719 14.998-14.998-6.719-14.998-14.998-14.998v0z" + id="path4"/> + <path fill="#444444" d="M12.618 9.172l10.469 6.779-10.469 6.779z" id="path6"/> +</svg> diff --git a/src/prev.svg b/src/prev.svg new file mode 100644 index 0000000..0f598a6 --- /dev/null +++ b/src/prev.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="36" + height="32" + viewBox="0 0 36 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="prev.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="18" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M30.256 2.452l-17.975 12.35c0 0-0.696 0.502-0.696 1.2s0.696 1.195 0.696 1.195l17.975 12.355c1.427 0.948 2.598 0.247 2.598-1.562v-23.979c0-1.814-1.17-2.515-2.598-1.56zM7.899 1.027h-2.496c-1.38 0-2.496 0.12-2.496 1.497v26.951c0 1.377 1.115 1.497 2.496 1.497h2.496c1.38 0 2.496-0.12 2.496-1.497v-26.951c0-1.377-1.115-1.497-2.496-1.497z" + id="path4"/> +</svg> diff --git a/src/replay.svg b/src/replay.svg new file mode 100644 index 0000000..09f0f55 --- /dev/null +++ b/src/replay.svg @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="28" + height="32" + viewBox="0 0 28 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="replay.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="14" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path fill="#444444" d="M24.4 10.9c1.1 1.8 1.7 3.9 1.7 6.1 0 6.6-5.4 12-12 12s-12-5.4-12-12 5.4-12 12-12v-4l10 5.4-10 5.6v-4c-5 0-9 4-9 9s4 9 9 9 9-4 9-9c0-1.7-0.5-3.3-1.3-4.6l2.6-1.5z" id="path4"/> +</svg> diff --git a/src/subtitle.svg b/src/subtitle.svg new file mode 100644 index 0000000..d44c8ed --- /dev/null +++ b/src/subtitle.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="subtitle.svg"> + <metadata id="metadata10"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs8"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview6" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M8.5 15.125h15v3.75h-15zM8.5 9.5h15v3.75h-15zM29.125 2h-26.25c-1.036 0-1.875 0.839-1.875 1.875v20.625c0 1.036 0.839 1.875 1.875 1.875h3.75v5.625l8.438-5.625h14.063c1.036 0 1.875-0.839 1.875-1.875v-20.625c0-1.036-0.839-1.875-1.875-1.875zM27.25 22.625h-12.188l-4.688 2.813v-2.813h-5.625v-16.875h22.5v16.875z" + id="path4"/> +</svg> diff --git a/src/volume-high.svg b/src/volume-high.svg new file mode 100644 index 0000000..c4f9dc0 --- /dev/null +++ b/src/volume-high.svg @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="34" + height="32" + viewBox="0 0 34 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="volume-high.svg"> + <metadata id="metadata12"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs10"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="703" + id="namedview8" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="17" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M27.814 28.814c-0.384 0-0.768-0.146-1.061-0.439-0.586-0.586-0.586-1.535 0-2.121 2.739-2.739 4.247-6.38 4.247-10.253s-1.508-7.514-4.247-10.253c-0.586-0.586-0.586-1.536 0-2.121s1.536-0.586 2.121 0c3.305 3.305 5.126 7.7 5.126 12.374s-1.82 9.069-5.126 12.374c-0.293 0.293-0.677 0.439-1.061 0.439zM22.485 25.985c-0.384 0-0.768-0.146-1.061-0.439-0.586-0.586-0.586-1.535 0-2.121 4.094-4.094 4.094-10.755 0-14.849-0.586-0.586-0.586-1.536 0-2.121s1.536-0.586 2.121 0c2.55 2.55 3.954 5.94 3.954 9.546s-1.404 6.996-3.954 9.546c-0.293 0.293-0.677 0.439-1.061 0.439v0zM17.157 23.157c-0.384 0-0.768-0.146-1.061-0.439-0.586-0.586-0.586-1.535 0-2.121 2.534-2.534 2.534-6.658 0-9.192-0.586-0.586-0.586-1.536 0-2.121s1.535-0.586 2.121 0c3.704 3.704 3.704 9.731 0 13.435-0.293 0.293-0.677 0.439-1.061 0.439z" + id="path4"/> + <path + fill="#444444" + d="M13 30c-0.26 0-0.516-0.102-0.707-0.293l-7.707-7.707h-3.586c-0.552 0-1-0.448-1-1v-10c0-0.552 0.448-1 1-1h3.586l7.707-7.707c0.286-0.286 0.716-0.372 1.090-0.217s0.617 0.519 0.617 0.924v26c0 0.404-0.244 0.769-0.617 0.924-0.124 0.051-0.254 0.076-0.383 0.076z" + id="path6"/> +</svg> diff --git a/src/volume-low.svg b/src/volume-low.svg new file mode 100644 index 0000000..4a514a5 --- /dev/null +++ b/src/volume-low.svg @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="volume-low.svg"> + <metadata id="metadata12"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs10"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview8" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M17.157 23.157c-0.384 0-0.768-0.146-1.061-0.439-0.586-0.586-0.586-1.535 0-2.121 2.534-2.534 2.534-6.658 0-9.192-0.586-0.586-0.586-1.536 0-2.121s1.535-0.586 2.121 0c3.704 3.704 3.704 9.731 0 13.435-0.293 0.293-0.677 0.439-1.061 0.439z" + id="path4"/> + <path + fill="#444444" + d="M13 30c-0.26 0-0.516-0.102-0.707-0.293l-7.707-7.707h-3.586c-0.552 0-1-0.448-1-1v-10c0-0.552 0.448-1 1-1h3.586l7.707-7.707c0.286-0.286 0.716-0.372 1.090-0.217s0.617 0.519 0.617 0.924v26c0 0.404-0.244 0.769-0.617 0.924-0.124 0.051-0.254 0.076-0.383 0.076z" + id="path6"/> +</svg> diff --git a/src/volume-medium.svg b/src/volume-medium.svg new file mode 100644 index 0000000..8ba5322 --- /dev/null +++ b/src/volume-medium.svg @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="volume-medium.svg"> + <metadata id="metadata12"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs10"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview8" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2"/> + <path + fill="#444444" + d="M22.485 25.985c-0.384 0-0.768-0.146-1.061-0.439-0.586-0.586-0.586-1.535 0-2.121 4.094-4.094 4.094-10.755 0-14.849-0.586-0.586-0.586-1.536 0-2.121s1.536-0.586 2.121 0c2.55 2.55 3.954 5.94 3.954 9.546s-1.404 6.996-3.954 9.546c-0.293 0.293-0.677 0.439-1.061 0.439v0zM17.157 23.157c-0.384 0-0.768-0.146-1.061-0.439-0.586-0.586-0.586-1.535 0-2.121 2.534-2.534 2.534-6.658 0-9.192-0.586-0.586-0.586-1.536 0-2.121s1.535-0.586 2.121 0c3.704 3.704 3.704 9.731 0 13.435-0.293 0.293-0.677 0.439-1.061 0.439z" + id="path4"/> + <path + fill="#444444" + d="M13 30c-0.26 0-0.516-0.102-0.707-0.293l-7.707-7.707h-3.586c-0.552 0-1-0.448-1-1v-10c0-0.552 0.448-1 1-1h3.586l7.707-7.707c0.286-0.286 0.716-0.372 1.090-0.217s0.617 0.519 0.617 0.924v26c0 0.404-0.244 0.769-0.617 0.924-0.124 0.051-0.254 0.076-0.383 0.076z" + id="path6"/> +</svg> diff --git a/src/volume-mute.svg b/src/volume-mute.svg new file mode 100644 index 0000000..5a1bf38 --- /dev/null +++ b/src/volume-mute.svg @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Escrito por Jesús Eduardo --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="32" + height="32" + viewBox="0 0 32 32" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="volume-mute.svg"> + <metadata id="metadata12"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title></dc:title> + <cc:license rdf:resource="https://directory.fsf.org/wiki/License:ArtisticLicense2.0" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs id="defs10"/> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview8" + showgrid="false" + inkscape:zoom="7.375" + inkscape:cx="16" + inkscape:cy="16" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2"/> + <path fill="#444444" d="M30 19.348v2.652h-2.652l-3.348-3.348-3.348 3.348h-2.652v-2.652l3.348-3.348-3.348-3.348v-2.652h2.652l3.348 3.348 3.348-3.348h2.652v2.652l-3.348 3.348 3.348 3.348z" id="path4"/> + <path + fill="#444444" + d="M13 30c-0.26 0-0.516-0.102-0.707-0.293l-7.707-7.707h-3.586c-0.552 0-1-0.448-1-1v-10c0-0.552 0.448-1 1-1h3.586l7.707-7.707c0.286-0.286 0.716-0.372 1.090-0.217s0.617 0.519 0.617 0.924v26c0 0.404-0.244 0.769-0.617 0.924-0.124 0.051-0.254 0.076-0.383 0.076z" + id="path6"/> +</svg> diff --git a/subtitles/libre_en.vtt b/subtitles/libre_en.vtt new file mode 100644 index 0000000..eec0c97 --- /dev/null +++ b/subtitles/libre_en.vtt @@ -0,0 +1,129 @@ +WEBVTT
+
+1
+00:00:09.280 --> 00:00:12.640
+It is legitimate to sell copies of free software
+
+2
+00:00:12.640 --> 00:00:15.240
+It is also legitimate to give away copies
+
+3
+00:00:15.800 --> 00:00:17.120
+I do not care which one?
+
+4
+00:00:17.120 --> 00:00:23.560
+The important thing is: when you have a copy, respects your freedom or not?
+
+5
+00:00:24.480 --> 00:00:26.791
+Also avoid
+
+6
+00:00:27.041 --> 00:00:32.641
+the practice of trust, your computer activity to another server
+
+7
+00:00:32.891 --> 00:00:34.256
+For thus
+
+8
+00:00:34.506 --> 00:00:36.800
+You lose control of your computer
+
+9
+00:00:36.800 --> 00:00:38.550
+It is the equivalent
+
+10
+00:00:38.550 --> 00:00:41.376
+running a proprietary program
+
+11
+00:00:41.626 --> 00:00:45.541
+but it is a social duty
+
+12
+00:00:45.791 --> 00:00:51.184
+Not teach the use of proprietary software guys
+
+13
+00:00:51.200 --> 00:00:54.356
+Because it would sow dependence.
+
+14
+00:00:54.606 --> 00:00:55.978
+Do not be!
+
+15
+00:00:56.228 --> 00:00:59.427
+It's like smoking teach the snuff
+
+16
+00:00:59.677 --> 00:01:03.702
+The school should never participate
+
+17
+00:01:03.952 --> 00:01:08.366
+depencia to sow nor to snuff or proprietary software
+
+18
+00:01:08.616 --> 00:01:10.839
+Mobile phones
+
+19
+00:01:11.089 --> 00:01:13.443
+always follow the user
+
+20
+00:01:13.693 --> 00:01:16.911
+and that back door universal
+
+21
+00:01:17.161 --> 00:01:22.052
+They can convertilos in listening devices
+
+22
+00:01:22.302 --> 00:01:24.019
+they hear all the time
+
+23
+00:01:24.269 --> 00:01:29.038
+and transmit the entire conversation they hear.
+
+24
+00:01:29.288 --> 00:01:32.306
+and needless to speak into the microphone
+
+25
+00:01:32.556 --> 00:01:36.698
+because it is able to hear from the other side of the room.
+
+26
+00:01:36.948 --> 00:01:39.896
+and if you think
+
+27
+00:01:40.146 --> 00:01:41.646
+retrieve your privacy
+
+28
+00:01:41.896 --> 00:01:44.279
+turning off the phone
+
+29
+00:01:44.529 --> 00:01:45.248
+what a surprise!
+
+30
+00:01:45.498 --> 00:01:50.772
+finje off, while still working, listening and transmitting
+
+31
+00:01:51.022 --> 00:01:52.362
+not to do
+
+32
+00:01:52.612 --> 00:01:55.564
+you have to get all batteries
diff --git a/subtitles/libre_es.vtt b/subtitles/libre_es.vtt new file mode 100644 index 0000000..d927416 --- /dev/null +++ b/subtitles/libre_es.vtt @@ -0,0 +1,129 @@ +WEBVTT
+
+1
+00:00:09.280 --> 00:00:12.640
+Es legítimo vender copias de <b>software libre</b>
+
+2
+00:00:12.640 --> 00:00:15.240
+También es legítimo regalar copias
+
+3
+00:00:15.800 --> 00:00:17.120
+No me importa ¿cual?
+
+4
+00:00:17.120 --> 00:00:23.560
+Lo importante es: cuando tengas una copia, ¿respeta tu <b>libertad</b> o no?
+
+5
+00:00:24.480 --> 00:00:26.791
+También hay que evitar
+
+6
+00:00:27.041 --> 00:00:32.641
+la práctica de confiar, tu actividad informática al servidor de otro
+
+7
+00:00:32.891 --> 00:00:34.256
+Porque así
+
+8
+00:00:34.506 --> 00:00:36.800
+<b>Pierdes el control</b> de tu informática
+
+9
+00:00:36.800 --> 00:00:38.550
+es el equivalente
+
+10
+00:00:38.550 --> 00:00:41.376
+de ejecutar un <b>programa privativo</b>
+
+11
+00:00:41.626 --> 00:00:45.541
+pero es un <b>deber social</b>
+
+12
+00:00:45.791 --> 00:00:51.184
+<b>No enseñar</b> el uso del software privativo a los chicos
+
+13
+00:00:51.200 --> 00:00:54.356
+Porque sería sembrar <b>dependencia</b>.
+
+14
+00:00:54.606 --> 00:00:55.978
+¡No se debe!
+
+15
+00:00:56.228 --> 00:00:59.427
+Es como enseñarles a fumar el tabaco
+
+16
+00:00:59.677 --> 00:01:03.702
+La escuela no debe participar nunca
+
+17
+00:01:03.952 --> 00:01:08.366
+en sembrar la depencia ni al tabaco ni al software privativo
+
+18
+00:01:08.616 --> 00:01:10.839
+Los teléfonos móviles
+
+19
+00:01:11.089 --> 00:01:13.443
+Siguen siempre al usuario
+
+20
+00:01:13.693 --> 00:01:16.911
+y por esa <b>puerta trasera universal</b>
+
+21
+00:01:17.161 --> 00:01:22.052
+pueden convertilos en dispositivos de escucha
+
+22
+00:01:22.302 --> 00:01:24.019
+que escuchan todo el tiempo
+
+23
+00:01:24.269 --> 00:01:29.038
+y transmiten toda la conversación que oyen.
+
+24
+00:01:29.288 --> 00:01:32.306
+y no hace falta hablar al micrófono
+
+25
+00:01:32.556 --> 00:01:36.698
+porque es capaz de escuchar desde el otro lado del cuarto.
+
+26
+00:01:36.948 --> 00:01:39.896
+y si piensas
+
+27
+00:01:40.146 --> 00:01:41.646
+recuperar tu privacidad
+
+28
+00:01:41.896 --> 00:01:44.279
+apagando el teléfono
+
+29
+00:01:44.529 --> 00:01:45.248
+¡que sorpresa!
+
+30
+00:01:45.498 --> 00:01:50.772
+finje apagarse, mientras sigue funcionando, escuchando y transmitiendo
+
+31
+00:01:51.022 --> 00:01:52.362
+para que no lo haga
+
+32
+00:01:52.612 --> 00:01:55.564
+hay que sacarle todas las pilas
|