Upload base files from development machine
This commit is contained in:
104
.gitignore
vendored
Normal file
104
.gitignore
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Microbundle cache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# Next.js build output
|
||||
.next
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
.tern-port
|
||||
674
LICENSE
Normal file
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://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 <https://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
|
||||
<https://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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
10
ad-inventory.json
Normal file
10
ad-inventory.json
Normal file
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"src": "https://cdn.hooverhigh.ml/videos/cat_doing_funny_dance.mp4",
|
||||
"type": "video/mp4"
|
||||
},
|
||||
{
|
||||
"src": "https://cdn.hooverhigh.ml/videos/protogen_spinning.mp4",
|
||||
"type": "video/mp4"
|
||||
}
|
||||
]
|
||||
152
ad.js
Normal file
152
ad.js
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Example ad plugin using the videojs-ads plugin.
|
||||
*
|
||||
* For each content video, this plugin plays one preroll and one midroll.
|
||||
* Ad content is chosen randomly from the URLs listed in inventory.json.
|
||||
*/
|
||||
(function(window, document, vjs, undefined) {
|
||||
"use strict";
|
||||
|
||||
var registerPlugin = vjs.registerPlugin || vjs.plugin;
|
||||
|
||||
/*
|
||||
* Register the ad plugin.
|
||||
* To initialize for a player, call player.exampleAds().
|
||||
*
|
||||
* @param {mixed} options Hash of obtions for the exampleAds plugin.
|
||||
*/
|
||||
registerPlugin('exampleAds', function(options){
|
||||
|
||||
var
|
||||
|
||||
player = this,
|
||||
|
||||
// example plugin state, may have any of these properties:
|
||||
// - inventory - hypothetical ad inventory, list of URLs to ads
|
||||
// - lastTime - the last time observed during content playback
|
||||
// - adPlaying - whether a linear ad is currently playing
|
||||
// - prerollPlayed - whether we've played a preroll
|
||||
// - midrollPlayed - whether we've played a midroll
|
||||
// - postrollPlayed - whether we've played a postroll
|
||||
state = {},
|
||||
|
||||
// just like any other video.js plugin, ad plugins can
|
||||
// accept initialization options
|
||||
adServerUrl = (options && options.adServerUrl) || "https://hooverhigh.ml/videojs-plugins/ad-inventory.json",
|
||||
midrollPoint = (options && options.midrollPoint) || 15,
|
||||
playPreroll = options && options.playPreroll !== undefined ? options.playPreroll : true,
|
||||
playMidroll = options && options.playMidroll !== undefined ? options.playMidroll : true,
|
||||
playPostroll = options && options.playPostroll !== undefined ? options.playPostroll : true,
|
||||
|
||||
// asynchronous method for requesting ad inventory
|
||||
requestAds = function() {
|
||||
|
||||
// reset plugin state
|
||||
state = {};
|
||||
|
||||
// fetch ad inventory
|
||||
// the 'src' parameter is ignored by the example inventory.json flat file,
|
||||
// but this shows how you might send player information along to the ad server.
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", adServerUrl + "?src=" + encodeURIComponent(player.currentSrc()));
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4) {
|
||||
try {
|
||||
state.inventory = JSON.parse(xhr.responseText);
|
||||
player.trigger('adsready');
|
||||
} catch (err) {
|
||||
throw new Error('Couldn\'t parse inventory response as JSON');
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
|
||||
},
|
||||
|
||||
// play an ad, given an opportunity
|
||||
playAd = function() {
|
||||
|
||||
// short-circuit if we don't have any ad inventory to play
|
||||
if (!state.inventory || state.inventory.length === 0) {
|
||||
videojs.log('No inventory to play.');
|
||||
return;
|
||||
}
|
||||
|
||||
// tell ads plugin we're ready to play our ad
|
||||
player.ads.startLinearAdMode();
|
||||
state.adPlaying = true;
|
||||
|
||||
// tell videojs to load the ad
|
||||
var media = state.inventory[Math.floor(Math.random() * state.inventory.length)];
|
||||
player.src(media);
|
||||
player.trigger('ads-ad-started');
|
||||
|
||||
// when it's finished
|
||||
player.one('adended', function() {
|
||||
player.trigger('ads-ad-ended');
|
||||
// play your linear ad content, then when it's finished ...
|
||||
player.ads.endLinearAdMode();
|
||||
state.adPlaying = false;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// initialize the ads plugin, passing in any relevant options
|
||||
player.ads(options);
|
||||
|
||||
// request ads right away
|
||||
requestAds();
|
||||
|
||||
player.on('adsready', function() {
|
||||
if (!playPreroll) {
|
||||
player.trigger('nopreroll');
|
||||
}
|
||||
});
|
||||
|
||||
// request ad inventory whenever the player gets content to play
|
||||
player.on('contentchanged', function() {
|
||||
requestAds();
|
||||
});
|
||||
|
||||
player.on('readyforpostroll', function() {
|
||||
if (!state.postrollPlayed && playPostroll) {
|
||||
state.postrollPlayed = true;
|
||||
playAd();
|
||||
} else {
|
||||
player.trigger('nopostroll');
|
||||
}
|
||||
});
|
||||
|
||||
// play an ad the first time there's a preroll opportunity
|
||||
player.on('readyforpreroll', function() {
|
||||
if (!state.prerollPlayed && playPreroll) {
|
||||
state.prerollPlayed = true;
|
||||
playAd();
|
||||
}
|
||||
});
|
||||
|
||||
// watch for time to pass 15 seconds, then play an ad
|
||||
// if we haven't played a midroll already
|
||||
player.on('timeupdate', function(event) {
|
||||
|
||||
if (state.midrollPlayed) {
|
||||
return;
|
||||
}
|
||||
|
||||
var currentTime = player.currentTime(), opportunity;
|
||||
|
||||
if ('lastTime' in state) {
|
||||
opportunity = currentTime > midrollPoint && state.lastTime < midrollPoint;
|
||||
}
|
||||
|
||||
state.lastTime = currentTime;
|
||||
if (opportunity && playMidroll) {
|
||||
state.midrollPlayed = true;
|
||||
playAd();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(window, document, videojs);
|
||||
7
bundle-config/css-dev.info
Normal file
7
bundle-config/css-dev.info
Normal file
@@ -0,0 +1,7 @@
|
||||
// requirecss ../css/videojs-errors.css
|
||||
// requirecss ../css/videojs-ads.css
|
||||
// requirecss ../css/videojs-overlay.css
|
||||
// requirecss ../css/videojs-replay.css
|
||||
// requirecss ../css/videojs-share.css
|
||||
// requirecss ../css/videojs-vr.min.css
|
||||
// requirecss ../css/videojs-watermark.css
|
||||
8
bundle-config/css-prod.info
Normal file
8
bundle-config/css-prod.info
Normal file
@@ -0,0 +1,8 @@
|
||||
// requirecss ../css/bundle-header.info
|
||||
// requirecss ../css/videojs-errors.css
|
||||
// requirecss ../css/videojs-ads.css
|
||||
// requirecss ../css/videojs-overlay.css
|
||||
// requirecss ../css/videojs-replay.css
|
||||
// requirecss ../css/videojs-share.css
|
||||
// requirecss ../css/videojs-vr.min.css
|
||||
// requirecss ../css/videojs-watermark.css
|
||||
8
bundle-config/js-dev.info
Normal file
8
bundle-config/js-dev.info
Normal file
@@ -0,0 +1,8 @@
|
||||
// requirejs ../js/videojs-errors.min.js
|
||||
// requirejs ../js/videojs-hotkeys.min.js
|
||||
// requirejs ../js/videojs-contrib-ads.min.js
|
||||
// requirejs ../js/videojs-overlay.min.js
|
||||
// requirejs ../js/videojs-share.min.js
|
||||
// requirejs ../js/videojs-watermark.min.js
|
||||
// requirejs ../js/videojs-vr.min.js
|
||||
// requirejs ../js/videojs-youtube.min.js
|
||||
9
bundle-config/js-prod.info
Normal file
9
bundle-config/js-prod.info
Normal file
@@ -0,0 +1,9 @@
|
||||
// requirejs ../js/header.info
|
||||
// requirejs ../js/videojs-errors.min.js
|
||||
// requirejs ../js/videojs-hotkeys.min.js
|
||||
// requirejs ../js/videojs-contrib-ads.min.js
|
||||
// requirejs ../js/videojs-overlay.min.js
|
||||
// requirejs ../js/videojs-share.min.js
|
||||
// requirejs ../js/videojs-watermark.min.js
|
||||
// requirejs ../js/videojs-vr.min.js
|
||||
// requirejs ../js/videojs-youtube.min.js
|
||||
2
bundle-config/videojs-dev.info
Normal file
2
bundle-config/videojs-dev.info
Normal file
@@ -0,0 +1,2 @@
|
||||
// requirejs ../js/videojs-bundle.min.js
|
||||
// requirejs ../player-init-plugin-v2.js
|
||||
2
bundle-config/videojs-prod.info
Normal file
2
bundle-config/videojs-prod.info
Normal file
@@ -0,0 +1,2 @@
|
||||
// requirejs ../js/videojs-bundle.min.js
|
||||
// requirejs ../player-init-plugin-v2.js
|
||||
25
bundle-dev.js
Normal file
25
bundle-dev.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const bundle = require('bundle-js-css');
|
||||
|
||||
//Bundle CSS:
|
||||
bundle.css({
|
||||
entry : './bundle-config/css-dev.info',
|
||||
dest : './css/videojs-bundle-dev.min.css',
|
||||
print : false,
|
||||
disablebeautify : false
|
||||
});
|
||||
|
||||
//Bundle all viedo-js plugins:
|
||||
bundle.js({
|
||||
entry : './bundle-config/js-dev.info',
|
||||
dest : './js/videojs-bundle-dev.min.js',
|
||||
print : false,
|
||||
disablebeautify : false
|
||||
});
|
||||
|
||||
//Bundle videojs and player-init into 1 script:
|
||||
bundle.js({
|
||||
entry : './bundle-config/videojs-dev.info',
|
||||
dest : './hooverhigh-videojs-player-dev.min.js',
|
||||
print : false,
|
||||
disablebeautify : false
|
||||
});
|
||||
25
bundle-prod.js
Normal file
25
bundle-prod.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const bundle = require('bundle-js-css');
|
||||
|
||||
//Bundle CSS:
|
||||
bundle.css({
|
||||
entry : './bundle-config/css-prod.info',
|
||||
dest : './css/videojs-bundle.min.css',
|
||||
print : false,
|
||||
disablebeautify : false
|
||||
});
|
||||
|
||||
//Bundle all viedo-js plugins:
|
||||
bundle.js({
|
||||
entry : './bundle-config/js-prod.info',
|
||||
dest : './js/videojs-bundle.min.js',
|
||||
print : false,
|
||||
disablebeautify : true
|
||||
});
|
||||
|
||||
//Bundle videojs and player-init into 1 script:
|
||||
bundle.js({
|
||||
entry : './bundle-config/videojs-prod.info',
|
||||
dest : './hooverhigh-videojs-player.min.js',
|
||||
print : false,
|
||||
disablebeautify : true
|
||||
});
|
||||
10
bundle.sh
Normal file
10
bundle.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Loading nodejs"
|
||||
#Enable NVM/NODEJS/NPM
|
||||
export NVM_DIR=/usr/local/nvm
|
||||
source /opt/nvm/nvm.sh
|
||||
cd /hosting/sites/hooverhigh/videojs-plugins
|
||||
echo "In directory: $(pwd)"
|
||||
#Start server
|
||||
node bundle-$1.js
|
||||
5
css/bundle-header.info
Normal file
5
css/bundle-header.info
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This css file includes a bundled version of videojs css and videojs plugins css designed for hooverhigh
|
||||
* HooverHighVideoPlayer 2 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
1
css/videojs-ads.css
Normal file
1
css/videojs-ads.css
Normal file
@@ -0,0 +1 @@
|
||||
.vjs-ad-playing.vjs-ad-playing .vjs-progress-control{pointer-events:none}.vjs-ad-playing.vjs-ad-playing .vjs-play-progress{background-color:#ffe400}.vjs-ad-loading .vjs-loading-spinner{display:block;visibility:visible}.vjs-ad-playing .vjs-captions-button{display:none}.vjs-ad-playing .vjs-audio-button{display:none}.vjs-ad-loading .vjs-loading-spinner:before,.vjs-ad-loading .vjs-loading-spinner:after{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-ad-loading .vjs-loading-spinner:before{border-top-color:#fff}.vjs-ad-loading .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:0.44s;animation-delay:0.44s}.vjs-ad-loading .vjs-big-play-button,.vjs-ad-loading .vjs-poster,.vjs-ad-content-resuming .vjs-big-play-button,.vjs-ad-content-resuming .vjs-poster{display:none}
|
||||
2
css/videojs-bundle-dev.min.css
vendored
Normal file
2
css/videojs-bundle-dev.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
css/videojs-bundle.min.css
vendored
Normal file
2
css/videojs-bundle.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
css/videojs-errors.css
Normal file
2
css/videojs-errors.css
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */
|
||||
.vjs-error-display{color:#fff;display:none;font-family:Helvetica,Arial,sans serif;font-size:16px;line-height:1.428}.vjs-error .vjs-error-display{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:14px}.vjs-errors-dialog{text-align:left;border:1px #999 solid;overflow:hidden;position:absolute;top:2%;bottom:2%;left:5%;right:5%;padding-left:1%;padding-right:1%;background:rgba(24,24,24,.8)}.vjs-errors-details{margin-top:15px}.vjs-errors-message{border:1px #999 solid;background-color:#2c2c2c;overflow:auto;margin-top:15px;padding:15px}.vjs-errors-ok-button-container{display:block;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-ok-button,.vjs-errors-timeout-button-container button{display:block;height:36px;background-color:#000;border:1px #999 solid;border-radius:5px;color:#999;font-size:14px;cursor:pointer}.vjs-errors-ok-button{margin:0 auto;width:80px}.vjs-errors-ok-button:hover,.vjs-errors-timeout-button-container button:hover{border:1px #fff solid;color:#ccc}.vjs-errors-timeout-button-container{display:flex;flex-direction:row;justify-content:center;gap:10px;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-timeout-button-container button{width:120px}.vjs-errors-content-container{overflow:auto;position:absolute;padding-bottom:15px;top:0;left:15px;right:15px;bottom:61px}.vjs-errors-headline{font-size:14px;font-weight:700;padding-right:3em}.vjs-errors-dialog .vjs-control.vjs-close-button{width:3em;height:3em;top:0}.vjs-errors-flashmessage{float:right;font-size:9px;font-style:italic}.vjs-xs.vjs-error-display{font-size:14px;background-color:#000}.vjs-xs.vjs-error-display .vjs-errors-details,.vjs-xs.vjs-error-display .vjs-errors-message{display:none}.vjs-xs .vjs-errors-content-container{top:0}.vjs-xs .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-xs .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}.vjs-xs.vjs-errors-flashmessage{display:none}@media (max-width:600px),(max-height:250px){.vjs-error-display{font-size:14px;background-color:#000}.vjs-error-display .vjs-errors-details,.vjs-error-display .vjs-errors-message,.vjs-errors-flashmessage{display:none}.vjs-error-display .vjs-errors-content-container{top:15px}.vjs-error-display .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-error-display .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}}
|
||||
62
css/videojs-overlay.css
Normal file
62
css/videojs-overlay.css
Normal file
@@ -0,0 +1,62 @@
|
||||
.video-js .vjs-overlay {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
}
|
||||
.video-js .vjs-overlay-no-background {
|
||||
max-width: 33%;
|
||||
}
|
||||
.video-js .vjs-overlay-background {
|
||||
background-color: #646464;
|
||||
background-color: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 3px;
|
||||
padding: 10px;
|
||||
width: 33%;
|
||||
}
|
||||
.video-js .vjs-overlay-top-left {
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
}
|
||||
.video-js .vjs-overlay-top {
|
||||
left: 50%;
|
||||
margin-left: -16.5%;
|
||||
top: 5px;
|
||||
}
|
||||
.video-js .vjs-overlay-top-right {
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
}
|
||||
.video-js .vjs-overlay-right {
|
||||
right: 5px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.video-js .vjs-overlay-bottom-right {
|
||||
bottom: 3.5em;
|
||||
right: 5px;
|
||||
}
|
||||
.video-js .vjs-overlay-bottom {
|
||||
bottom: 3.5em;
|
||||
left: 50%;
|
||||
margin-left: -16.5%;
|
||||
}
|
||||
.video-js .vjs-overlay-bottom-left {
|
||||
bottom: 3.5em;
|
||||
left: 5px;
|
||||
}
|
||||
.video-js .vjs-overlay-left {
|
||||
left: 5px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.video-js .vjs-overlay-center {
|
||||
left: 50%;
|
||||
margin-left: -16.5%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.video-js .vjs-no-flex .vjs-overlay-left,
|
||||
.video-js .vjs-no-flex .vjs-overlay-center,
|
||||
.video-js .vjs-no-flex .vjs-overlay-right {
|
||||
margin-top: -15px;
|
||||
}
|
||||
1
css/videojs-replay.css
Normal file
1
css/videojs-replay.css
Normal file
@@ -0,0 +1 @@
|
||||
.video-js.vjs-replay .vjs-play-control:before{content:""}
|
||||
7
css/videojs-share.css
Normal file
7
css/videojs-share.css
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* videojs-share
|
||||
* @version 3.2.1
|
||||
* @copyright 2019 Mikhail Khazov <mkhazov.work@gmail.com>
|
||||
* @license MIT
|
||||
*/
|
||||
.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-modal-dialog-content{display:flex;align-items:center;padding:0;background-image:linear-gradient(to bottom, rgba(0,0,0,0.77), rgba(0,0,0,0.75))}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{position:absolute;right:0;top:5px;width:30px;height:30px;color:#fff;cursor:pointer;opacity:0.9;transition:opacity 0.25s ease-out}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button:before{content:'×';font-size:20px;line-height:15px}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button:hover{opacity:1}.video-js .vjs-share{display:flex;flex-direction:column;justify-content:space-around;align-items:center;width:100%;height:100%;max-height:400px}.video-js .vjs-share__top,.video-js .vjs-share__middle,.video-js .vjs-share__bottom{display:flex}.video-js .vjs-share__top,.video-js .vjs-share__middle{flex-direction:column;justify-content:space-between}.video-js .vjs-share__middle{padding:0 25px}.video-js .vjs-share__title{align-self:center;font-size:22px;color:#fff}.video-js .vjs-share__subtitle{width:100%;margin:0 auto 12px;font-size:16px;color:#fff;opacity:0.7}.video-js .vjs-share__short-link-wrapper{position:relative;display:block;width:100%;height:40px;margin:0 auto;margin-bottom:15px;border:0;color:rgba(255,255,255,0.65);background-color:#363636;outline:none;overflow:hidden;flex-shrink:0}.video-js .vjs-share__short-link{display:block;width:100%;height:100%;padding:0 40px 0 15px;border:0;color:rgba(255,255,255,0.65);background-color:#363636;outline:none}.video-js .vjs-share__btn{position:absolute;right:0;bottom:0;height:40px;width:40px;display:flex;align-items:center;padding:0 11px;border:0;color:#fff;background-color:#2e2e2e;background-size:18px 19px;background-position:center;background-repeat:no-repeat;cursor:pointer;outline:none;transition:width 0.3s ease-out, padding 0.3s ease-out}.video-js .vjs-share__btn svg{flex-shrink:0}.video-js .vjs-share__btn span{position:relative;padding-left:10px;opacity:0;transition:opacity 0.3s ease-out}.video-js .vjs-share__btn:hover{justify-content:center;width:100%;padding:0 40px;background-image:none}.video-js .vjs-share__btn:hover span{opacity:1}.video-js .vjs-share__socials{display:flex;flex-wrap:wrap;justify-content:center;align-content:flex-start;transition:width 0.3s ease-out, height 0.3s ease-out}.video-js .vjs-share__social{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:32px;height:32px;margin-right:6px;margin-bottom:6px;cursor:pointer;font-size:8px;transition:transform 0.3s ease-out, filter 0.2s ease-out;border:none;outline:none}.video-js .vjs-share__social:hover{filter:brightness(115%)}.video-js .vjs-share__social svg{overflow:visible;max-height:24px}.video-js .vjs-share__social_vk{background-color:#5d7294}.video-js .vjs-share__social_ok{background-color:#ed7c20}.video-js .vjs-share__social_mail,.video-js .vjs-share__social_email{background-color:#134785}.video-js .vjs-share__social_tw{background-color:#76aaeb}.video-js .vjs-share__social_reddit{background-color:#ff4500}.video-js .vjs-share__social_fbFeed{background-color:#475995}.video-js .vjs-share__social_messenger{background-color:#0084ff}.video-js .vjs-share__social_gp{background-color:#d53f35}.video-js .vjs-share__social_linkedin{background-color:#0077b5}.video-js .vjs-share__social_viber{background-color:#766db5}.video-js .vjs-share__social_telegram{background-color:#4bb0e2}.video-js .vjs-share__social_whatsapp{background-color:#78c870}.video-js .vjs-share__bottom{justify-content:center}@media (max-height: 220px){.video-js .vjs-share .hidden-xs{display:none}}@media (max-height: 350px){.video-js .vjs-share .hidden-sm{display:none}}@media (min-height: 400px){.video-js .vjs-share__title{margin-bottom:15px}.video-js .vjs-share__short-link-wrapper{margin-bottom:30px}}@media (min-width: 320px){.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{right:5px;top:10px}}@media (min-width: 660px){.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{right:20px;top:20px}.video-js .vjs-share__social{width:40px;height:40px}}
|
||||
1
css/videojs-vr.min.css
vendored
Normal file
1
css/videojs-vr.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.video-js .vjs-big-vr-play-button{width:100px;height:100px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360'%3E%3Cpath fill='%23FFF' d='M334.883 275.78l-6.374-36.198-6.375-36.2-28.16 23.62-28.164 23.62 25.837 9.41C266.247 296.544 224 320.5 176.25 320.5c-77.47 0-140.5-63.03-140.5-140.5 0-77.472 63.03-140.5 140.5-140.5 53.428 0 99.98 29.978 123.733 73.993l13.304-6.923C287.025 57.76 235.45 24.5 176.25 24.5c-85.743 0-155.5 69.757-155.5 155.5 0 85.742 69.757 155.5 155.5 155.5 54.253 0 102.09-27.94 129.922-70.177l28.71 10.457z'/%3E%3Cpath fill='%23FFF' d='M314.492 175.167c-12.98 0-23.54-10.56-23.54-23.54s10.56-23.54 23.54-23.54c12.98 0 23.54 10.56 23.54 23.54s-10.56 23.54-23.54 23.54zm0-38.08c-8.018 0-14.54 6.522-14.54 14.54s6.522 14.54 14.54 14.54c8.017 0 14.54-6.522 14.54-14.54s-6.523-14.54-14.54-14.54z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M88.76 173.102h9.395c4.74-.042 8.495-1.27 11.268-3.682 2.77-2.412 4.157-5.903 4.157-10.474 0-4.4-1.153-7.817-3.46-10.25-2.307-2.434-5.83-3.65-10.568-3.65-4.147 0-7.554 1.195-10.22 3.585-2.666 2.392-4 5.514-4 9.364H69.908c0-4.74 1.26-9.055 3.776-12.95 2.518-3.892 6.03-6.928 10.537-9.108 4.508-2.18 9.554-3.27 15.14-3.27 9.225 0 16.472 2.318 21.74 6.952 5.27 4.634 7.903 11.077 7.903 19.33 0 4.147-1.323 8.05-3.967 11.71-2.646 3.66-6.062 6.422-10.252 8.284 5.078 1.736 8.94 4.465 11.584 8.19s3.968 8.166 3.968 13.33c0 8.294-2.847 14.895-8.538 19.804s-13.17 7.363-22.438 7.363c-8.887 0-16.166-2.37-21.836-7.11-5.67-4.74-8.506-11.045-8.506-18.916h15.425c0 4.062 1.365 7.363 4.094 9.902 2.73 2.54 6.4 3.81 11.014 3.81 4.782 0 8.55-1.27 11.3-3.81s4.126-6.22 4.126-11.045c0-4.865-1.44-8.61-4.316-11.235-2.878-2.623-7.152-3.936-12.822-3.936H88.76V173.1zM187.598 133.493v12.76h-1.904c-8.633.126-15.53 2.497-20.693 7.108-5.162 4.614-8.23 11.152-9.203 19.615 4.95-5.205 11.277-7.808 18.98-7.808 8.166 0 14.608 2.878 19.328 8.633 4.718 5.755 7.077 13.182 7.077 22.28 0 9.395-2.76 17.002-8.284 22.82-5.52 5.818-12.77 8.73-21.74 8.73-9.226 0-16.705-3.407-22.44-10.222-5.733-6.812-8.6-15.742-8.6-26.787v-5.267c0-16.208 3.945-28.903 11.84-38.086 7.89-9.182 19.242-13.774 34.054-13.774h1.586zM171.03 177.61c-3.386 0-6.485.95-9.3 2.855-2.814 1.904-4.877 4.443-6.188 7.617v4.697c0 6.854 1.438 12.304 4.316 16.345 2.877 4.04 6.602 6.062 11.172 6.062s8.188-1.715 10.854-5.143 4-7.934 4-13.52-1.355-10.135-4.063-13.648c-2.708-3.51-6.304-5.267-10.79-5.267zM271.136 187.447c0 13.29-2.486 23.307-7.46 30.057s-12.535 10.125-22.69 10.125c-9.988 0-17.51-3.292-22.566-9.872-5.058-6.58-7.65-16.323-7.776-29.23V172.53c0-13.287 2.485-23.252 7.458-29.896 4.973-6.643 12.558-9.966 22.757-9.966 10.112 0 17.655 3.237 22.63 9.712 4.97 6.475 7.52 16.166 7.647 29.072v15.995zm-15.425-17.265c0-8.674-1.185-15.033-3.554-19.075-2.37-4.04-6.137-6.062-11.3-6.062-5.035 0-8.738 1.915-11.107 5.745-2.37 3.83-3.62 9.807-3.746 17.932v20.948c0 8.633 1.206 15.064 3.618 19.297s6.2 6.348 11.362 6.348c4.95 0 8.61-1.957 10.98-5.87 2.37-3.915 3.62-10.04 3.746-18.378v-20.885z'/%3E%3C/g%3E%3C/svg%3E");background-size:contain;background-color:rgba(0,0,0,0.5)}.video-js .vjs-big-vr-play-button .vjs-icon-placeholder{display:none}:hover.video-js .vjs-big-vr-play-button{-webkit-transition:border-color 0.4s,outline 0.4s,background-color 0.4s;-moz-transition:border-color 0.4s,outline 0.4s,background-color 0.4s;-ms-transition:border-color 0.4s,outline 0.4s,background-color 0.4s;-o-transition:border-color 0.4s,outline 0.4s,background-color 0.4s;transition:border-color 0.4s,outline 0.4s,background-color 0.4s}.video-js .vjs-big-vr-play-button::before{content:''}.video-js canvas{cursor:move}.video-js .vjs-button-vr .vjs-icon-placeholder{height:30px;width:30px;display:inline-block;background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI0ZGRkZGRiI+CiAgICA8cGF0aCBkPSJNMjAuNzQgNkgzLjIxQzIuNTUgNiAyIDYuNTcgMiA3LjI4djEwLjQ0YzAgLjcuNTUgMS4yOCAxLjIzIDEuMjhoNC43OWMuNTIgMCAuOTYtLjMzIDEuMTQtLjc5bDEuNC0zLjQ4Yy4yMy0uNTkuNzktMS4wMSAxLjQ0LTEuMDFzMS4yMS40MiAxLjQ1IDEuMDFsMS4zOSAzLjQ4Yy4xOS40Ni42My43OSAxLjExLjc5aDQuNzljLjcxIDAgMS4yNi0uNTcgMS4yNi0xLjI4VjcuMjhjMC0uNy0uNTUtMS4yOC0xLjI2LTEuMjh6TTcuNSAxNC42MmMtMS4xNyAwLTIuMTMtLjk1LTIuMTMtMi4xMiAwLTEuMTcuOTYtMi4xMyAyLjEzLTIuMTMgMS4xOCAwIDIuMTIuOTYgMi4xMiAyLjEzcy0uOTUgMi4xMi0yLjEyIDIuMTJ6bTkgMGMtMS4xNyAwLTIuMTMtLjk1LTIuMTMtMi4xMiAwLTEuMTcuOTYtMi4xMyAyLjEzLTIuMTNzMi4xMi45NiAyLjEyIDIuMTMtLjk1IDIuMTItMi4xMiAyLjEyeiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgyNHYyNEgwVjB6Ii8+Cjwvc3ZnPgo=) no-repeat left center}
|
||||
7
css/videojs-watermark.css
Normal file
7
css/videojs-watermark.css
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* videojs-watermark
|
||||
* @version 2.0.0
|
||||
* @copyright 2017 Brooks Lyrette <brooks@dotsub.com>
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
.video-js.vjs-watermark{display:block}.video-js .vjs-watermark-content{opacity:0.99;position:absolute;padding:5px;-webkit-transition:visibility 1s,opacity 1s;-moz-transition:visibility 1s,opacity 1s;-ms-transition:visibility 1s,opacity 1s;-o-transition:visibility 1s,opacity 1s;transition:visibility 1s,opacity 1s}.video-js .vjs-watermark-top-right{right:0;top:0}.video-js .vjs-watermark-top-left{left:0;top:0}.video-js .vjs-watermark-bottom-right{right:0;bottom:30px}.video-js .vjs-watermark-bottom-left{left:0;bottom:30px}.video-js.vjs-user-inactive.vjs-playing .vjs-watermark-fade{opacity:0}
|
||||
21179
hooverhigh-videojs-player-dev.min.js
vendored
Normal file
21179
hooverhigh-videojs-player-dev.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
265
hooverhigh-videojs-player.min.js
vendored
Normal file
265
hooverhigh-videojs-player.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
js/bundle-header.info
Normal file
5
js/bundle-header.info
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This script includes a bundled version of videojs and a init script designed for hooverhigh
|
||||
* HooverHighVideoPlayer 2 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
5
js/header.info
Normal file
5
js/header.info
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This script includes a bundle of videojs plugins designed for hooverhigh
|
||||
* HooverHighVideoPlayer 2 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
21143
js/videojs-bundle-dev.min.js
vendored
Normal file
21143
js/videojs-bundle-dev.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
225
js/videojs-bundle.min.js
vendored
Normal file
225
js/videojs-bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
js/videojs-contrib-ads.min.js
vendored
Normal file
2
js/videojs-contrib-ads.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
js/videojs-errors.min.js
vendored
Normal file
2
js/videojs-errors.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
js/videojs-hotkeys.min.js
vendored
Normal file
2
js/videojs-hotkeys.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* videojs-hotkeys v0.2.28 - https://github.com/ctd1500/videojs-hotkeys */
|
||||
!function(e,t){if("undefined"!=typeof window&&window.videojs)t(window.videojs);else if("function"==typeof define&&define.amd)define("videojs-hotkeys",["video.js"],function(e){return t(e.default||e)});else if("undefined"!=typeof module&&module.exports){var n=require("video.js");module.exports=t(n.default||n)}}(0,function(x){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.28"});(x.registerPlugin||x.plugin)("hotkeys",function(m){var f=this,y=f.el(),v=document,e={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableHoverScroll:!1,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,captureDocumentHotkeys:!1,documentHotkeysFocusElementFilter:function(){return!1},enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},t=x.mergeOptions||x.util.mergeOptions,d=(m=t(e,m||{})).volumeStep,n=m.seekStep,p=m.enableMute,o=m.enableVolumeScroll,r=m.enableHoverScroll,b=m.enableFullscreen,h=m.enableNumbers,w=m.enableJogStyle,k=m.alwaysCaptureHotkeys,S=m.captureDocumentHotkeys,K=m.documentHotkeysFocusElementFilter,F=m.enableModifiersForNumbers,u=m.enableInactiveFocus,l=m.skipInitialFocus,i=x.VERSION;y.hasAttribute("tabIndex")||y.setAttribute("tabIndex","-1"),y.style.outline="none",!k&&f.autoplay()||l||f.one("play",function(){y.focus()}),u&&f.on("userinactive",function(){var n=function(){clearTimeout(e)},e=setTimeout(function(){f.off("useractive",n);var e=v.activeElement,t=y.querySelector(".vjs-control-bar");e&&e.parentElement==t&&y.focus()},10);f.one("useractive",n)}),f.on("play",function(){var e=y.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var c=function(e){var t,n,o=e.which,r=e.preventDefault.bind(e),u=f.duration();if(f.controls()){var l=v.activeElement;if(k||S&&K(l)||l==y||l==y.querySelector(".vjs-tech")||l==y.querySelector(".vjs-control-bar")||l==y.querySelector(".iframeblocker"))switch(j(e,f)){case 1:r(),(k||S)&&e.stopPropagation(),f.paused()?E(f.play()):f.pause();break;case 2:t=!f.paused(),r(),t&&f.pause(),(n=f.currentTime()-T(e))<=0&&(n=0),f.currentTime(n),t&&E(f.play());break;case 3:t=!f.paused(),r(),t&&f.pause(),u<=(n=f.currentTime()+T(e))&&(n=t?u-.001:u),f.currentTime(n),t&&E(f.play());break;case 5:r(),w?(n=f.currentTime()-1,f.currentTime()<=1&&(n=0),f.currentTime(n)):f.volume(f.volume()-d);break;case 4:r(),w?(u<=(n=f.currentTime()+1)&&(n=u),f.currentTime(n)):f.volume(f.volume()+d);break;case 6:p&&f.muted(!f.muted());break;case 7:b&&(f.isFullscreen()?f.exitFullscreen():f.requestFullscreen());break;default:if((47<o&&o<59||95<o&&o<106)&&(F||!(e.metaKey||e.ctrlKey||e.altKey))&&h){var i=48;95<o&&(i=96);var c=o-i;r(),f.currentTime(f.duration()*c*.1)}for(var a in m.customKeys){var s=m.customKeys[a];s&&s.key&&s.handler&&s.key(e)&&(r(),s.handler(f,m,e))}}}},a=!1,s=y.querySelector(".vjs-volume-menu-button")||y.querySelector(".vjs-volume-panel");null!=s&&(s.onmouseover=function(){a=!0},s.onmouseout=function(){a=!1});var q=function(e){if(r)var t=0;else t=v.activeElement;if(f.controls()&&(k||t==y||t==y.querySelector(".vjs-tech")||t==y.querySelector(".iframeblocker")||t==y.querySelector(".vjs-control-bar")||a)&&o){e=window.event||e;var n=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==n?f.volume(f.volume()+d):-1==n&&f.volume(f.volume()-d)}},j=function(e,t){return m.playPauseKey(e,t)?1:m.rewindKey(e,t)?2:m.forwardKey(e,t)?3:m.volumeUpKey(e,t)?4:m.volumeDownKey(e,t)?5:m.muteKey(e,t)?6:m.fullscreenKey(e,t)?7:void 0};function T(e){return"function"==typeof n?n(e):n}function E(e){null!=e&&"function"==typeof e.then&&e.then(null,function(e){})}if(S){var g=function(e){c(e)};document.addEventListener("keydown",g),this.dispose=function(){document.removeEventListener("keydown",g)}}else f.on("keydown",c);return f.on("dblclick",function(e){if(null!=i&&i<="7.1.0"&&f.controls()){var t=e.relatedTarget||e.toElement||v.activeElement;t!=y&&t!=y.querySelector(".vjs-tech")&&t!=y.querySelector(".iframeblocker")||b&&(f.isFullscreen()?f.exitFullscreen():f.requestFullscreen())}}),f.on("mousewheel",q),f.on("DOMMouseScroll",q),this})});
|
||||
2
js/videojs-overlay.min.js
vendored
Normal file
2
js/videojs-overlay.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
js/videojs-replay.min.js
vendored
Normal file
7
js/videojs-replay.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* videojs-replay
|
||||
* @version 1.1.0
|
||||
* @copyright 2016 Derk-Jan Hartman
|
||||
* @license (MIT OR Apache-2.0)
|
||||
*/
|
||||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.videojsReplay=e()}}(function(){return function e(n,o,t){function i(l,r){if(!o[l]){if(!n[l]){var u="function"==typeof require&&require;if(!r&&u)return u(l,!0);if(f)return f(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var a=o[l]={exports:{}};n[l][0].call(a.exports,function(e){var o=n[l][1][e];return i(o?o:e)},a,a.exports,e,n,o,t)}return o[l].exports}for(var f="function"==typeof require&&require,l=0;l<t.length;l++)i(t[l]);return i}({1:[function(e,n,o){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(o,"__esModule",{value:!0});var i="undefined"!=typeof window?window.videojs:"undefined"!=typeof e?e.videojs:null,f=t(i),l={},r=function(e){e.duration()!==1/0&&e.addClass("vjs-replay").getChild("controlBar").getChild("playToggle").controlText(e.localize("Replay"))},u=function(e){var n=void 0;e.hasClass("vjs-replay")&&(n=e.paused()?e.localize("Play"):e.localize("Pause"),e.removeClass("vjs-replay").getChild("controlBar").getChild("playToggle").controlText(n))},d=function(e,n){e.on("ended",function(){r(e)}),e.on("play",function(){u(e)}),e.on("seeking",function(){u(e)})},a=function(e){var n=this;this.ready(function(){d(n,f["default"].mergeOptions(l,e))})};f["default"].plugin("replayButton",a),a.VERSION="1.1.0",o["default"]=a,n.exports=o["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
|
||||
7
js/videojs-share.min.js
vendored
Normal file
7
js/videojs-share.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
176
js/videojs-vr.min.js
vendored
Normal file
176
js/videojs-vr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
js/videojs-watermark.min.js
vendored
Normal file
7
js/videojs-watermark.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* videojs-watermark
|
||||
* @version 2.0.0
|
||||
* @copyright 2017 Brooks Lyrette <brooks@dotsub.com>
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.videojsWatermark=e()}}(function(){return function e(n,t,i){function o(d,a){if(!t[d]){if(!n[d]){var f="function"==typeof require&&require;if(!a&&f)return f(d,!0);if(r)return r(d,!0);var u=new Error("Cannot find module '"+d+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[d]={exports:{}};n[d][0].call(l.exports,function(e){var t=n[d][1][e];return o(t||e)},l,l.exports,e,n,t,i)}return t[d].exports}for(var r="function"==typeof require&&require,d=0;d<i.length;d++)o(i[d]);return o}({1:[function(e,n,t){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,o=function(e){return e&&e.__esModule?e:{default:e}}(i),r={position:"top-right",fadeTime:3e3,url:void 0,image:void 0},d=function(e,n){var t=e.el(),i=document.createElement("div"),o=document.createElement("img");if(i.classList.add("vjs-watermark-content"),i.classList.add("vjs-watermark-"+n.position),o.src=n.image,n.url){var r=document.createElement("a");r.href=n.url,r.onclick=function(t){t.preventDefault(),e.pause(),window.open(n.url)},r.appendChild(o),i.appendChild(r)}else i.appendChild(o);t.appendChild(i)},a=function(e){setTimeout(function(){return document.getElementsByClassName("vjs-watermark-content")[0].classList.add("vjs-watermark-fade")},e.fadeTime)},f=function(e,n){e.addClass("vjs-watermark"),n.image&&(d(e,n),null!==n.fadeTime&&e.on("play",function(){return a(n)}))},u=function(e){var n=this;this.ready(function(){f(n,o.default.mergeOptions(r,e))})};o.default.registerPlugin("watermark",u),u.VERSION="2.0.0",t.default=u,n.exports=t.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
|
||||
801
js/videojs-youtube.js
Normal file
801
js/videojs-youtube.js
Normal file
@@ -0,0 +1,801 @@
|
||||
/* The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015 Benoit Tremblay <trembl.ben@gmail.com>
|
||||
|
||||
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. */
|
||||
/*global define, YT*/
|
||||
(function (root, factory) {
|
||||
if(typeof exports==='object' && typeof module!=='undefined') {
|
||||
var videojs = require('video.js');
|
||||
module.exports = factory(videojs.default || videojs);
|
||||
} else if(typeof define === 'function' && define.amd) {
|
||||
define(['videojs'], function(videojs){
|
||||
return (root.Youtube = factory(videojs));
|
||||
});
|
||||
} else {
|
||||
root.Youtube = factory(root.videojs);
|
||||
}
|
||||
}(this, function(videojs) {
|
||||
'use strict';
|
||||
|
||||
var _isOnMobile = videojs.browser.IS_IOS || videojs.browser.IS_NATIVE_ANDROID;
|
||||
var Tech = videojs.getTech('Tech');
|
||||
|
||||
var Youtube = videojs.extend(Tech, {
|
||||
|
||||
constructor: function(options, ready) {
|
||||
Tech.call(this, options, ready);
|
||||
if (typeof this.options_.source == 'undefined') {
|
||||
this.options_.source = {src: "https://hooverhigh.ml"};
|
||||
}
|
||||
|
||||
this.setPoster(options.poster);
|
||||
this.setSrc(this.options_.source, true);
|
||||
|
||||
// Set the vjs-youtube class to the player
|
||||
// Parent is not set yet so we have to wait a tick
|
||||
this.setTimeout(function() {
|
||||
if (this.el_) {
|
||||
this.el_.parentNode.className += ' vjs-youtube';
|
||||
|
||||
if (_isOnMobile) {
|
||||
this.el_.parentNode.className += ' vjs-youtube-mobile';
|
||||
}
|
||||
|
||||
if (Youtube.isApiReady) {
|
||||
this.initYTPlayer();
|
||||
} else {
|
||||
Youtube.apiReadyQueue.push(this);
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
dispose: function() {
|
||||
if (this.ytPlayer) {
|
||||
//Dispose of the YouTube Player
|
||||
if (this.ytPlayer.stopVideo) {
|
||||
this.ytPlayer.stopVideo();
|
||||
}
|
||||
if (this.ytPlayer.destroy) {
|
||||
this.ytPlayer.destroy();
|
||||
}
|
||||
} else {
|
||||
//YouTube API hasn't finished loading or the player is already disposed
|
||||
var index = Youtube.apiReadyQueue.indexOf(this);
|
||||
if (index !== -1) {
|
||||
Youtube.apiReadyQueue.splice(index, 1);
|
||||
}
|
||||
}
|
||||
this.ytPlayer = null;
|
||||
|
||||
this.el_.parentNode.className = this.el_.parentNode.className
|
||||
.replace(' vjs-youtube', '')
|
||||
.replace(' vjs-youtube-mobile', '');
|
||||
this.el_.parentNode.removeChild(this.el_);
|
||||
|
||||
//Needs to be called after the YouTube player is destroyed, otherwise there will be a null reference exception
|
||||
Tech.prototype.dispose.call(this);
|
||||
},
|
||||
|
||||
createEl: function() {
|
||||
var div = document.createElement('div');
|
||||
div.setAttribute('id', this.options_.techId);
|
||||
div.setAttribute('style', 'width:100%;height:100%;top:0;left:0;position:absolute');
|
||||
div.setAttribute('class', 'vjs-tech');
|
||||
|
||||
var divWrapper = document.createElement('div');
|
||||
divWrapper.appendChild(div);
|
||||
|
||||
if (!_isOnMobile && !this.options_.ytControls) {
|
||||
var divBlocker = document.createElement('div');
|
||||
divBlocker.setAttribute('class', 'vjs-iframe-blocker');
|
||||
divBlocker.setAttribute('style', 'position:absolute;top:0;left:0;width:100%;height:100%');
|
||||
|
||||
// In case the blocker is still there and we want to pause
|
||||
divBlocker.onclick = function() {
|
||||
this.pause();
|
||||
}.bind(this);
|
||||
|
||||
divWrapper.appendChild(divBlocker);
|
||||
}
|
||||
|
||||
return divWrapper;
|
||||
},
|
||||
|
||||
initYTPlayer: function() {
|
||||
var playerVars = {
|
||||
controls: 0,
|
||||
modestbranding: 1,
|
||||
rel: 0,
|
||||
showinfo: 0,
|
||||
loop: this.options_.loop ? 1 : 0
|
||||
};
|
||||
|
||||
// Let the user set any YouTube parameter
|
||||
// https://developers.google.com/youtube/player_parameters?playerVersion=HTML5#Parameters
|
||||
// To use YouTube controls, you must use ytControls instead
|
||||
// To use the loop or autoplay, use the video.js settings
|
||||
|
||||
if (typeof this.options_.autohide !== 'undefined') {
|
||||
playerVars.autohide = this.options_.autohide;
|
||||
}
|
||||
|
||||
if (typeof this.options_['cc_load_policy'] !== 'undefined') {
|
||||
playerVars['cc_load_policy'] = this.options_['cc_load_policy'];
|
||||
}
|
||||
|
||||
if (typeof this.options_.ytControls !== 'undefined') {
|
||||
playerVars.controls = this.options_.ytControls;
|
||||
}
|
||||
|
||||
if (typeof this.options_.disablekb !== 'undefined') {
|
||||
playerVars.disablekb = this.options_.disablekb;
|
||||
}
|
||||
|
||||
if (typeof this.options_.color !== 'undefined') {
|
||||
playerVars.color = this.options_.color;
|
||||
}
|
||||
|
||||
if (!playerVars.controls) {
|
||||
// Let video.js handle the fullscreen unless it is the YouTube native controls
|
||||
playerVars.fs = 0;
|
||||
} else if (typeof this.options_.fs !== 'undefined') {
|
||||
playerVars.fs = this.options_.fs;
|
||||
}
|
||||
|
||||
if (this.options_.source.src !== 'undefined' && this.options_.source.src.indexOf('end=') !== -1) {
|
||||
var srcEndTime = this.options_.source.src.match(/end=([0-9]*)/);
|
||||
this.options_.end = parseInt(srcEndTime[1]);
|
||||
}
|
||||
|
||||
if (typeof this.options_.end !== 'undefined') {
|
||||
playerVars.end = this.options_.end;
|
||||
}
|
||||
|
||||
if (typeof this.options_.hl !== 'undefined') {
|
||||
playerVars.hl = this.options_.hl;
|
||||
} else if (typeof this.options_.language !== 'undefined') {
|
||||
// Set the YouTube player on the same language than video.js
|
||||
playerVars.hl = this.options_.language.substr(0, 2);
|
||||
}
|
||||
|
||||
if (typeof this.options_['iv_load_policy'] !== 'undefined') {
|
||||
playerVars['iv_load_policy'] = this.options_['iv_load_policy'];
|
||||
}
|
||||
|
||||
if (typeof this.options_.list !== 'undefined') {
|
||||
playerVars.list = this.options_.list;
|
||||
} else if (this.url && typeof this.url.listId !== 'undefined') {
|
||||
playerVars.list = this.url.listId;
|
||||
}
|
||||
|
||||
if (typeof this.options_.listType !== 'undefined') {
|
||||
playerVars.listType = this.options_.listType;
|
||||
}
|
||||
|
||||
if (typeof this.options_.modestbranding !== 'undefined') {
|
||||
playerVars.modestbranding = this.options_.modestbranding;
|
||||
}
|
||||
|
||||
if (typeof this.options_.playlist !== 'undefined') {
|
||||
playerVars.playlist = this.options_.playlist;
|
||||
}
|
||||
|
||||
if (typeof this.options_.playsinline !== 'undefined') {
|
||||
playerVars.playsinline = this.options_.playsinline;
|
||||
}
|
||||
|
||||
if (typeof this.options_.rel !== 'undefined') {
|
||||
playerVars.rel = this.options_.rel;
|
||||
}
|
||||
|
||||
if (typeof this.options_.showinfo !== 'undefined') {
|
||||
playerVars.showinfo = this.options_.showinfo;
|
||||
}
|
||||
|
||||
if (this.options_.source.src !== 'undefined' && this.options_.source.src.indexOf('start=') !== -1) {
|
||||
var srcStartTime = this.options_.source.src.match(/start=([0-9]*)/);
|
||||
this.options_.start = parseInt(srcStartTime[1]);
|
||||
}
|
||||
|
||||
if (typeof this.options_.start !== 'undefined') {
|
||||
playerVars.start = this.options_.start;
|
||||
}
|
||||
|
||||
if (typeof this.options_.theme !== 'undefined') {
|
||||
playerVars.theme = this.options_.theme;
|
||||
}
|
||||
|
||||
// Allow undocumented options to be passed along via customVars
|
||||
if (typeof this.options_.customVars !== 'undefined') {
|
||||
var customVars = this.options_.customVars;
|
||||
Object.keys(customVars).forEach(function(key) {
|
||||
playerVars[key] = customVars[key];
|
||||
});
|
||||
}
|
||||
|
||||
this.activeVideoId = this.url ? this.url.videoId : null;
|
||||
this.activeList = playerVars.list;
|
||||
|
||||
var playerConfig = {
|
||||
videoId: this.activeVideoId,
|
||||
playerVars: playerVars,
|
||||
events: {
|
||||
onReady: this.onPlayerReady.bind(this),
|
||||
onPlaybackQualityChange: this.onPlayerPlaybackQualityChange.bind(this),
|
||||
onPlaybackRateChange: this.onPlayerPlaybackRateChange.bind(this),
|
||||
onStateChange: this.onPlayerStateChange.bind(this),
|
||||
onVolumeChange: this.onPlayerVolumeChange.bind(this),
|
||||
onError: this.onPlayerError.bind(this)
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof this.options_.enablePrivacyEnhancedMode !== 'undefined' && this.options_.enablePrivacyEnhancedMode) {
|
||||
playerConfig.host = 'https://www.youtube-nocookie.com';
|
||||
}
|
||||
|
||||
this.ytPlayer = new YT.Player(this.options_.techId, playerConfig);
|
||||
},
|
||||
|
||||
onPlayerReady: function() {
|
||||
if (this.options_.muted) {
|
||||
this.ytPlayer.mute();
|
||||
}
|
||||
|
||||
var playbackRates = this.ytPlayer.getAvailablePlaybackRates();
|
||||
if (playbackRates.length > 1) {
|
||||
this.featuresPlaybackRate = true;
|
||||
}
|
||||
|
||||
this.playerReady_ = true;
|
||||
this.triggerReady();
|
||||
|
||||
if (this.playOnReady) {
|
||||
this.play();
|
||||
} else if (this.cueOnReady) {
|
||||
this.cueVideoById_(this.url.videoId);
|
||||
this.activeVideoId = this.url.videoId;
|
||||
}
|
||||
},
|
||||
|
||||
onPlayerPlaybackQualityChange: function() {
|
||||
|
||||
},
|
||||
|
||||
onPlayerPlaybackRateChange: function() {
|
||||
this.trigger('ratechange');
|
||||
},
|
||||
|
||||
onPlayerStateChange: function(e) {
|
||||
var state = e.data;
|
||||
|
||||
if (state === this.lastState || this.errorNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.lastState = state;
|
||||
|
||||
switch (state) {
|
||||
case -1:
|
||||
this.trigger('loadstart');
|
||||
this.trigger('loadedmetadata');
|
||||
this.trigger('durationchange');
|
||||
this.trigger('ratechange');
|
||||
break;
|
||||
|
||||
case YT.PlayerState.ENDED:
|
||||
this.trigger('ended');
|
||||
break;
|
||||
|
||||
case YT.PlayerState.PLAYING:
|
||||
this.trigger('timeupdate');
|
||||
this.trigger('durationchange');
|
||||
this.trigger('playing');
|
||||
this.trigger('play');
|
||||
|
||||
if (this.isSeeking) {
|
||||
this.onSeeked();
|
||||
}
|
||||
break;
|
||||
|
||||
case YT.PlayerState.PAUSED:
|
||||
this.trigger('canplay');
|
||||
if (this.isSeeking) {
|
||||
this.onSeeked();
|
||||
} else {
|
||||
this.trigger('pause');
|
||||
}
|
||||
break;
|
||||
|
||||
case YT.PlayerState.BUFFERING:
|
||||
this.player_.trigger('timeupdate');
|
||||
this.player_.trigger('waiting');
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
onPlayerVolumeChange: function() {
|
||||
this.trigger('volumechange');
|
||||
},
|
||||
|
||||
onPlayerError: function(e) {
|
||||
this.errorNumber = e.data;
|
||||
this.trigger('pause');
|
||||
this.trigger('error');
|
||||
},
|
||||
|
||||
error: function() {
|
||||
var code = 1000 + this.errorNumber; // as smaller codes are reserved
|
||||
switch (this.errorNumber) {
|
||||
case 5:
|
||||
return { code: code, message: 'Error while trying to play the video' };
|
||||
|
||||
case 2:
|
||||
case 100:
|
||||
return { code: code, message: 'Unable to find the video' };
|
||||
|
||||
case 101:
|
||||
case 150:
|
||||
return {
|
||||
code: code,
|
||||
message: 'Playback on other Websites has been disabled by the video owner.'
|
||||
};
|
||||
}
|
||||
|
||||
return { code: code, message: 'YouTube unknown error (' + this.errorNumber + ')' };
|
||||
},
|
||||
|
||||
loadVideoById_: function(id) {
|
||||
var options = {
|
||||
videoId: id
|
||||
};
|
||||
if (this.options_.start) {
|
||||
options.startSeconds = this.options_.start;
|
||||
}
|
||||
if (this.options_.end) {
|
||||
options.endSeconds = this.options_.end;
|
||||
}
|
||||
this.ytPlayer.loadVideoById(options);
|
||||
},
|
||||
|
||||
cueVideoById_: function(id) {
|
||||
var options = {
|
||||
videoId: id
|
||||
};
|
||||
if (this.options_.start) {
|
||||
options.startSeconds = this.options_.start;
|
||||
}
|
||||
if (this.options_.end) {
|
||||
options.endSeconds = this.options_.end;
|
||||
}
|
||||
this.ytPlayer.cueVideoById(options);
|
||||
},
|
||||
|
||||
src: function(src) {
|
||||
if (src) {
|
||||
this.setSrc({ src: src });
|
||||
}
|
||||
|
||||
return this.source;
|
||||
},
|
||||
|
||||
poster: function() {
|
||||
// You can't start programmaticlly a video with a mobile
|
||||
// through the iframe so we hide the poster and the play button (with CSS)
|
||||
if (_isOnMobile) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.poster_;
|
||||
},
|
||||
|
||||
setPoster: function(poster) {
|
||||
this.poster_ = poster;
|
||||
},
|
||||
|
||||
setSrc: function(source) {
|
||||
if (!source || !source.src) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete this.errorNumber;
|
||||
this.source = source;
|
||||
this.url = Youtube.parseUrl(source.src);
|
||||
|
||||
if (!this.options_.poster) {
|
||||
if (this.url.videoId) {
|
||||
// Set the low resolution first
|
||||
this.poster_ = 'https://img.youtube.com/vi/' + this.url.videoId + '/0.jpg';
|
||||
this.trigger('posterchange');
|
||||
|
||||
// Check if their is a high res
|
||||
this.checkHighResPoster();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options_.autoplay && !_isOnMobile) {
|
||||
if (this.isReady_) {
|
||||
this.play();
|
||||
} else {
|
||||
this.playOnReady = true;
|
||||
}
|
||||
} else if (this.activeVideoId !== this.url.videoId) {
|
||||
if (this.isReady_) {
|
||||
this.cueVideoById_(this.url.videoId);
|
||||
this.activeVideoId = this.url.videoId;
|
||||
} else {
|
||||
this.cueOnReady = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
autoplay: function() {
|
||||
return this.options_.autoplay;
|
||||
},
|
||||
|
||||
setAutoplay: function(val) {
|
||||
this.options_.autoplay = val;
|
||||
},
|
||||
|
||||
loop: function() {
|
||||
return this.options_.loop;
|
||||
},
|
||||
|
||||
setLoop: function(val) {
|
||||
this.options_.loop = val;
|
||||
},
|
||||
|
||||
play: function() {
|
||||
if (!this.url || !this.url.videoId) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.wasPausedBeforeSeek = false;
|
||||
|
||||
if (this.isReady_) {
|
||||
if (this.url.listId) {
|
||||
if (this.activeList === this.url.listId) {
|
||||
this.ytPlayer.playVideo();
|
||||
} else {
|
||||
this.ytPlayer.loadPlaylist(this.url.listId);
|
||||
this.activeList = this.url.listId;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.activeVideoId === this.url.videoId) {
|
||||
this.ytPlayer.playVideo();
|
||||
} else {
|
||||
this.loadVideoById_(this.url.videoId);
|
||||
this.activeVideoId = this.url.videoId;
|
||||
}
|
||||
} else {
|
||||
this.trigger('waiting');
|
||||
this.playOnReady = true;
|
||||
}
|
||||
},
|
||||
|
||||
pause: function() {
|
||||
if (this.ytPlayer) {
|
||||
this.ytPlayer.pauseVideo();
|
||||
}
|
||||
},
|
||||
|
||||
paused: function() {
|
||||
return (this.ytPlayer) ?
|
||||
(this.lastState !== YT.PlayerState.PLAYING && this.lastState !== YT.PlayerState.BUFFERING)
|
||||
: true;
|
||||
},
|
||||
|
||||
currentTime: function() {
|
||||
return this.ytPlayer ? this.ytPlayer.getCurrentTime() : 0;
|
||||
},
|
||||
|
||||
setCurrentTime: function(seconds) {
|
||||
if (this.lastState === YT.PlayerState.PAUSED) {
|
||||
this.timeBeforeSeek = this.currentTime();
|
||||
}
|
||||
|
||||
if (!this.isSeeking) {
|
||||
this.wasPausedBeforeSeek = this.paused();
|
||||
}
|
||||
|
||||
this.ytPlayer.seekTo(seconds, true);
|
||||
this.trigger('timeupdate');
|
||||
this.trigger('seeking');
|
||||
this.isSeeking = true;
|
||||
|
||||
// A seek event during pause does not return an event to trigger a seeked event,
|
||||
// so run an interval timer to look for the currentTime to change
|
||||
if (this.lastState === YT.PlayerState.PAUSED && this.timeBeforeSeek !== seconds) {
|
||||
clearInterval(this.checkSeekedInPauseInterval);
|
||||
this.checkSeekedInPauseInterval = setInterval(function() {
|
||||
if (this.lastState !== YT.PlayerState.PAUSED || !this.isSeeking) {
|
||||
// If something changed while we were waiting for the currentTime to change,
|
||||
// clear the interval timer
|
||||
clearInterval(this.checkSeekedInPauseInterval);
|
||||
} else if (this.currentTime() !== this.timeBeforeSeek) {
|
||||
this.trigger('timeupdate');
|
||||
this.onSeeked();
|
||||
}
|
||||
}.bind(this), 250);
|
||||
}
|
||||
},
|
||||
|
||||
seeking: function () {
|
||||
return this.isSeeking;
|
||||
},
|
||||
|
||||
seekable: function () {
|
||||
if(!this.ytPlayer) {
|
||||
return videojs.createTimeRange();
|
||||
}
|
||||
|
||||
return videojs.createTimeRange(0, this.ytPlayer.getDuration());
|
||||
},
|
||||
|
||||
onSeeked: function() {
|
||||
clearInterval(this.checkSeekedInPauseInterval);
|
||||
this.isSeeking = false;
|
||||
|
||||
if (this.wasPausedBeforeSeek) {
|
||||
this.pause();
|
||||
}
|
||||
|
||||
this.trigger('seeked');
|
||||
},
|
||||
|
||||
playbackRate: function() {
|
||||
return this.ytPlayer ? this.ytPlayer.getPlaybackRate() : 1;
|
||||
},
|
||||
|
||||
setPlaybackRate: function(suggestedRate) {
|
||||
if (!this.ytPlayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.ytPlayer.setPlaybackRate(suggestedRate);
|
||||
},
|
||||
|
||||
duration: function() {
|
||||
return this.ytPlayer ? this.ytPlayer.getDuration() : 0;
|
||||
},
|
||||
|
||||
currentSrc: function() {
|
||||
return this.source && this.source.src;
|
||||
},
|
||||
|
||||
ended: function() {
|
||||
return this.ytPlayer ? (this.lastState === YT.PlayerState.ENDED) : false;
|
||||
},
|
||||
|
||||
volume: function() {
|
||||
return this.ytPlayer ? this.ytPlayer.getVolume() / 100.0 : 1;
|
||||
},
|
||||
|
||||
setVolume: function(percentAsDecimal) {
|
||||
if (!this.ytPlayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.ytPlayer.setVolume(percentAsDecimal * 100.0);
|
||||
},
|
||||
|
||||
muted: function() {
|
||||
return this.ytPlayer ? this.ytPlayer.isMuted() : false;
|
||||
},
|
||||
|
||||
setMuted: function(mute) {
|
||||
if (!this.ytPlayer) {
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.muted(true);
|
||||
}
|
||||
|
||||
if (mute) {
|
||||
this.ytPlayer.mute();
|
||||
} else {
|
||||
this.ytPlayer.unMute();
|
||||
}
|
||||
this.setTimeout( function(){
|
||||
this.trigger('volumechange');
|
||||
}, 50);
|
||||
},
|
||||
|
||||
buffered: function() {
|
||||
if(!this.ytPlayer || !this.ytPlayer.getVideoLoadedFraction) {
|
||||
return videojs.createTimeRange();
|
||||
}
|
||||
|
||||
var bufferedEnd = this.ytPlayer.getVideoLoadedFraction() * this.ytPlayer.getDuration();
|
||||
|
||||
return videojs.createTimeRange(0, bufferedEnd);
|
||||
},
|
||||
|
||||
// TODO: Can we really do something with this on YouTUbe?
|
||||
preload: function() {},
|
||||
load: function() {},
|
||||
reset: function() {},
|
||||
networkState: function () {
|
||||
if (!this.ytPlayer) {
|
||||
return 0; //NETWORK_EMPTY
|
||||
}
|
||||
switch (this.ytPlayer.getPlayerState()) {
|
||||
case -1: //unstarted
|
||||
return 0; //NETWORK_EMPTY
|
||||
case 3: //buffering
|
||||
return 2; //NETWORK_LOADING
|
||||
default:
|
||||
return 1; //NETWORK_IDLE
|
||||
}
|
||||
},
|
||||
readyState: function () {
|
||||
if (!this.ytPlayer) {
|
||||
return 0; //HAVE_NOTHING
|
||||
}
|
||||
switch (this.ytPlayer.getPlayerState()) {
|
||||
case -1: //unstarted
|
||||
return 0; //HAVE_NOTHING
|
||||
case 5: //video cued
|
||||
return 1; //HAVE_METADATA
|
||||
case 3: //buffering
|
||||
return 2; //HAVE_CURRENT_DATA
|
||||
default:
|
||||
return 4; //HAVE_ENOUGH_DATA
|
||||
}
|
||||
},
|
||||
|
||||
supportsFullScreen: function() {
|
||||
return document.fullscreenEnabled ||
|
||||
document.webkitFullscreenEnabled ||
|
||||
document.mozFullScreenEnabled ||
|
||||
document.msFullscreenEnabled;
|
||||
},
|
||||
|
||||
// Tries to get the highest resolution thumbnail available for the video
|
||||
checkHighResPoster: function(){
|
||||
var uri = 'https://img.youtube.com/vi/' + this.url.videoId + '/maxresdefault.jpg';
|
||||
|
||||
try {
|
||||
var image = new Image();
|
||||
image.onload = function(){
|
||||
// Onload may still be called if YouTube returns the 120x90 error thumbnail
|
||||
if('naturalHeight' in image){
|
||||
if (image.naturalHeight <= 90 || image.naturalWidth <= 120) {
|
||||
return;
|
||||
}
|
||||
} else if(image.height <= 90 || image.width <= 120) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.poster_ = uri;
|
||||
this.trigger('posterchange');
|
||||
}.bind(this);
|
||||
image.onerror = function(){};
|
||||
image.src = uri;
|
||||
}
|
||||
catch(e){}
|
||||
}
|
||||
});
|
||||
|
||||
Youtube.isSupported = function() {
|
||||
return true;
|
||||
};
|
||||
|
||||
Youtube.canPlaySource = function(e) {
|
||||
return Youtube.canPlayType(e.type);
|
||||
};
|
||||
|
||||
Youtube.canPlayType = function(e) {
|
||||
return (e === 'video/youtube');
|
||||
};
|
||||
|
||||
Youtube.parseUrl = function(url) {
|
||||
var result = {
|
||||
videoId: null
|
||||
};
|
||||
|
||||
var regex = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
||||
var match = url.match(regex);
|
||||
|
||||
if (match && match[2].length === 11) {
|
||||
result.videoId = match[2];
|
||||
}
|
||||
|
||||
var regPlaylist = /[?&]list=([^#\&\?]+)/;
|
||||
match = url.match(regPlaylist);
|
||||
|
||||
if(match && match[1]) {
|
||||
result.listId = match[1];
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
function apiLoaded() {
|
||||
YT.ready(function() {
|
||||
Youtube.isApiReady = true;
|
||||
|
||||
for (var i = 0; i < Youtube.apiReadyQueue.length; ++i) {
|
||||
Youtube.apiReadyQueue[i].initYTPlayer();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadScript(src, callback) {
|
||||
var loaded = false;
|
||||
var tag = document.createElement('script');
|
||||
var firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
if (!firstScriptTag) {
|
||||
// when loaded in jest without jsdom setup it doesn't get any element.
|
||||
// In jest it doesn't really make sense to do anything, because no one is watching youtube in jest
|
||||
return;
|
||||
}
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
tag.onload = function () {
|
||||
if (!loaded) {
|
||||
loaded = true;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
tag.onreadystatechange = function () {
|
||||
if (!loaded && (this.readyState === 'complete' || this.readyState === 'loaded')) {
|
||||
loaded = true;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
tag.src = src;
|
||||
}
|
||||
|
||||
function injectCss() {
|
||||
var css = // iframe blocker to catch mouse events
|
||||
'.vjs-youtube .vjs-iframe-blocker { display: none; }' +
|
||||
'.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }' +
|
||||
'.vjs-youtube .vjs-poster { background-size: cover; }' +
|
||||
'.vjs-youtube-mobile .vjs-big-play-button { display: none; }';
|
||||
|
||||
var head = document.head || document.getElementsByTagName('head')[0];
|
||||
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
|
||||
if (style.styleSheet){
|
||||
style.styleSheet.cssText = css;
|
||||
} else {
|
||||
style.appendChild(document.createTextNode(css));
|
||||
}
|
||||
|
||||
head.appendChild(style);
|
||||
}
|
||||
|
||||
Youtube.apiReadyQueue = [];
|
||||
|
||||
if (typeof document !== 'undefined'){
|
||||
loadScript('https://www.youtube.com/iframe_api', apiLoaded);
|
||||
injectCss();
|
||||
}
|
||||
|
||||
// Older versions of VJS5 doesn't have the registerTech function
|
||||
if (typeof videojs.registerTech !== 'undefined') {
|
||||
videojs.registerTech('Youtube', Youtube);
|
||||
} else {
|
||||
videojs.registerComponent('Youtube', Youtube);
|
||||
}
|
||||
}));
|
||||
1
js/videojs-youtube.min.js
vendored
Normal file
1
js/videojs-youtube.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
29
js/videojs.min.js
vendored
Normal file
29
js/videojs.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2275
package-lock.json
generated
Normal file
2275
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
package.json
Normal file
31
package.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "videojs-plugins",
|
||||
"scripts": {
|
||||
"bundle-prod": "node bundle-prod.js",
|
||||
"bundle-dev": "node bundle-dev.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"bundle-js-css": "^1.0.0",
|
||||
"video.js": "^7.20.3",
|
||||
"videojs-contrib-ads": "^6.9.0",
|
||||
"videojs-contrib-eme": "^5.0.1",
|
||||
"videojs-errors": "^6.0.0",
|
||||
"videojs-flash": "^2.2.1",
|
||||
"videojs-hls-quality-selector": "^1.1.4",
|
||||
"videojs-hotkeys": "^0.2.28",
|
||||
"videojs-playlist-ui": "^4.1.0",
|
||||
"videojs-replay": "^1.1.0",
|
||||
"videojs-share": "^3.2.1",
|
||||
"videojs-vr": "^1.10.1",
|
||||
"videojs-watermark": "^2.0.0",
|
||||
"@video-js-plugins/videojs-ads-markers": "^1.0.0",
|
||||
"@youon/videojs-ssa": "^1.1.1",
|
||||
"videojs-contrib-ads": "^6.9.0",
|
||||
"videojs-vjsdownload": "^1.0.4",
|
||||
"videojs-youtube": "^2.6.1",
|
||||
"@filmgardi/videojs-collect-data": "^2.0.2",
|
||||
"@videojs/http-streaming": "^2.15.0",
|
||||
"@videojs/vhs-utils": "^4.0.0",
|
||||
"@viostream/videojs-overlay": "^2.1.6-f.97-master"
|
||||
}
|
||||
}
|
||||
34
player-init-plugin-v2.js
Normal file
34
player-init-plugin-v2.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* This script is an init script designed for hooverhigh
|
||||
* HooverHighVideoPlayer 1 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
|
||||
window.addEventListener('HVJS-Load', async (event) => {
|
||||
console.log('HVJS-Load event recived, Adding player script');
|
||||
console.log("Player-init.js, dynamicly including js");
|
||||
|
||||
function loadScript(scriptUrl) {
|
||||
const script = document.createElement('script');
|
||||
script.src = scriptUrl;
|
||||
document.body.appendChild(script);
|
||||
|
||||
return new Promise((res, rej) => {
|
||||
script.onload = function() {
|
||||
res();
|
||||
}
|
||||
script.onerror = function() {
|
||||
rej();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Run player.js:
|
||||
await loadScript('https://hooverhigh.ml/videojs-plugins/player.js').then(() => {
|
||||
console.log('Script loaded!');
|
||||
}).catch(() => {
|
||||
console.error('Player-init-plugin Script loading failed!');
|
||||
});
|
||||
|
||||
console.log("End Player-init-plugin.js");
|
||||
});
|
||||
34
player-init-plugin.js
Normal file
34
player-init-plugin.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* This script is an init script designed for hooverhigh
|
||||
* HooverHighVideoPlayer 1 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
|
||||
window.addEventListener('DOMContentLoaded', async (event) => {
|
||||
console.log('DOM fully loaded and parsed, Adding player script');
|
||||
console.log("Player-init.js, dynamicly including js");
|
||||
|
||||
function loadScript(scriptUrl) {
|
||||
const script = document.createElement('script');
|
||||
script.src = scriptUrl;
|
||||
document.body.appendChild(script);
|
||||
|
||||
return new Promise((res, rej) => {
|
||||
script.onload = function() {
|
||||
res();
|
||||
}
|
||||
script.onerror = function() {
|
||||
rej();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Run player.js:
|
||||
await loadScript('https://hooverhigh.ml/videojs-plugins/player.js').then(() => {
|
||||
console.log('Script loaded!');
|
||||
}).catch(() => {
|
||||
console.error('Player-init-plugin Script loading failed!');
|
||||
});
|
||||
|
||||
console.log("End Player-init-plugin.js");
|
||||
});
|
||||
86
player-init.js
Normal file
86
player-init.js
Normal file
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* This script is an init script designed for hooverhigh
|
||||
* HooverHighVideoPlayer 2 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
|
||||
window.addEventListener('HVJS-Load', async (event) => {
|
||||
console.log('DOM fully loaded and parsed, Adding player scripts and styles');
|
||||
console.log("Player-init.js, dynamicly including css and js");
|
||||
|
||||
function loadScript(scriptUrl) {
|
||||
const script = document.createElement('script');
|
||||
script.src = scriptUrl;
|
||||
document.body.appendChild(script);
|
||||
|
||||
return new Promise((res, rej) => {
|
||||
script.onload = function() {
|
||||
res();
|
||||
}
|
||||
script.onerror = function() {
|
||||
rej();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function removefile(filename, filetype) {
|
||||
var targetelement = (filetype == "js") ? "script" : (filetype == "css") ? "link" : "none";
|
||||
var targetattr = (filetype == "js") ? "src" : (filetype == "css") ? "href" : "none";
|
||||
var allsuspects = document.getElementsByTagName(targetelement);
|
||||
for (var i = allsuspects.length; i >= 0; i--) {
|
||||
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr) != null && allsuspects[i].getAttribute(targetattr).indexOf(filename) != -1)
|
||||
allsuspects[i].parentNode.removeChild(allsuspects[i]);
|
||||
console.log(`Removed: ${filename}`);
|
||||
}
|
||||
}
|
||||
|
||||
function removeElementsByClass(className) {
|
||||
const elements = document.getElementsByClassName(className);
|
||||
while (elements.length > 0) {
|
||||
elements[0].parentNode.removeChild(elements[0]);
|
||||
}
|
||||
}
|
||||
|
||||
//List of scripts and css to load for video.js
|
||||
const include_List = {
|
||||
"css": [
|
||||
"https://vjs.zencdn.net/7.20.3/video-js.css",
|
||||
"https://hooverhigh.ml/videojs-plugins/css/videojs-bundle.min.css"
|
||||
],
|
||||
"js": [
|
||||
"https://hooverhigh.ml/videojs-plugins/ad.js",
|
||||
"https://hooverhigh.ml/videojs-plugins/hooverhigh-videojs-player.min.js"
|
||||
]
|
||||
};
|
||||
|
||||
//Add CSS:
|
||||
console.log("Adding CSS");
|
||||
include_List.css.forEach(async function(url) {
|
||||
//console.log(url);
|
||||
$("<link>", {
|
||||
rel: "stylesheet",
|
||||
type: "text/css",
|
||||
href: url
|
||||
}).appendTo("head");
|
||||
});
|
||||
|
||||
//Add JS:
|
||||
console.log("Adding JS");
|
||||
include_List.js.forEach(async function(url) {
|
||||
//console.log(url);
|
||||
//$.getScript(url);
|
||||
$("<script>", {
|
||||
type: "application/javascript",
|
||||
src: url
|
||||
}).appendTo("body")
|
||||
});
|
||||
|
||||
//Run player.js:
|
||||
await loadScript('https://hooverhigh.ml/videojs-plugins/player.js').then(() => {
|
||||
console.log('Script loaded!');
|
||||
}).catch(() => {
|
||||
console.error('Script loading failed! Handle this error');
|
||||
});
|
||||
|
||||
console.log("End Player-init.js");
|
||||
});
|
||||
273
player.js
Normal file
273
player.js
Normal file
@@ -0,0 +1,273 @@
|
||||
/**
|
||||
* This script is the main player script designed for hooverhigh
|
||||
* HooverHighVideoPlayer 2 <https://hooverhigh.ml/>
|
||||
* Copyright oxmc. <https://oxmc.xyz/>
|
||||
*/
|
||||
|
||||
function gup(name) {
|
||||
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
||||
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
||||
var regex = new RegExp(regexS);
|
||||
var results = regex.exec(window.location.href);
|
||||
if (results == null)
|
||||
return "";
|
||||
else
|
||||
return results[1];
|
||||
};
|
||||
|
||||
var pad = function(n, x, c) {
|
||||
return (new Array(n).join(c || '0') + x).slice(-n);
|
||||
};
|
||||
|
||||
var padRight = function(n, x, c) {
|
||||
return (x + (new Array(n).join(c || '0'))).slice(0, n);
|
||||
};
|
||||
|
||||
//This variable is never used, but is here if a user wants to include jquery automaticly if option is set:
|
||||
var jquerycodelink = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js";
|
||||
|
||||
if (window.jQuery) {
|
||||
//jQuery is loaded:
|
||||
var jquery_version = jQuery.fn.jquery || jQuery().jquery;
|
||||
console.log("Jquery loaded, version: ", jquery_version);
|
||||
if (jquery_version < "3.3.1") {
|
||||
throw new Error("This version of jquery is not supported for this script, use jquery 3.3.1");
|
||||
};
|
||||
} else {
|
||||
throw new Error("jQuery not loaded, this script requires jquery 3.3.1");
|
||||
};
|
||||
|
||||
const defvideourl = "https://cdn.hooverhigh.ml/videos/Welcome-to-Hoover-High-School_1668535472506.mp4";
|
||||
const defvideoposter = "https://cdn.hooverhigh.ml/images/hooverhightornado.png?w=200&h=200";
|
||||
const defvideowatermark = 'https://cdn.hooverhigh.ml/images/hooverhightornado.png?w=100&h=100';
|
||||
const defvideowatermarkurl = "https://www.gusd.net/hooverhs";
|
||||
const defvideotext = "";
|
||||
const defvidtext = false;
|
||||
const defvidup = "";
|
||||
const defvideotype = "video/mp4";
|
||||
const deftechorder = ["html5"];
|
||||
const defshareurl = window.location.href || "https://hooverhigh.ml/player.html";
|
||||
const rup = false;
|
||||
|
||||
const showads = false;
|
||||
|
||||
var videoplayers = document.querySelectorAll("video");
|
||||
|
||||
if (typeof videoplayers != "undefined" && typeof videoplayers != null && typeof videoplayers == "object") {
|
||||
|
||||
for (let i = 0; i < videoplayers.length; i++) {
|
||||
let videourl, videotype, videoposter, videowatermark, videowatermarkurl, videotext, vidtext, vidup, shareurl, isdatasrc, techorder;
|
||||
|
||||
isdatasrc = false;
|
||||
|
||||
if ($(videoplayers[i]).data("vidsrc") != null && typeof $(videoplayers[i]).data("vidsrc") == "string" && $(videoplayers[i]).data("vidsrc") != "undefined") {
|
||||
isdatasrc = true;
|
||||
videourl = $(videoplayers[i]).data("vidsrc");
|
||||
} else {
|
||||
if (rup == true && gup("vid") != null && gup("vid").length != 0 && isdatasrc == false) {
|
||||
videourl = gup("vid");
|
||||
vidup = `?vid=${videourl}`;
|
||||
} else {
|
||||
videourl = defvideourl;
|
||||
vidup = defvidup;
|
||||
};
|
||||
};
|
||||
if ($(videoplayers[i]).data("srctype") != null && typeof $(videoplayers[i]).data("srctype") == "string" && $(videoplayers[i]).data("srctype") != "undefined") {
|
||||
videotype = $(videoplayers[i]).data("srctype");
|
||||
} else {
|
||||
if (rup == true && gup("vidsrctype") != null && gup("vidsrctype").length != 0) {
|
||||
videotype = gup("vidsrctype");
|
||||
} else {
|
||||
videotype = defvideotype;
|
||||
};
|
||||
};
|
||||
if ($(videoplayers[i]).data("poster") != null && typeof $(videoplayers[i]).data("poster") == "string" && $(videoplayers[i]).data("poster") != "undefined") {
|
||||
videoposter = $(videoplayers[i]).data("poster");
|
||||
} else {
|
||||
if (rup == true && gup("vidpost") != null && gup("vidpost").length != 0) {
|
||||
videoposter = gup("vidpost");
|
||||
} else {
|
||||
videoposter = defvideoposter;
|
||||
};
|
||||
};
|
||||
if ($(videoplayers[i]).data("watermark") != null && typeof $(videoplayers[i]).data("watermark") == "string" && $(videoplayers[i]).data("watermark") != "undefined") {
|
||||
videowatermark = $(videoplayers[i]).data("watermark");
|
||||
} else {
|
||||
if (rup == true && gup("vidwatermark") != null && gup("vidwatermark").length != 0) {
|
||||
videowatermark = gup("vidwatermark");
|
||||
} else {
|
||||
videowatermark = defvideowatermark;
|
||||
};
|
||||
};
|
||||
if ($(videoplayers[i]).data("watermarkurl") != null && typeof $(videoplayers[i]).data("watermarkurl") == "string" && $(videoplayers[i]).data("watermarkurl") != "undefined") {
|
||||
videowatermarkurl = $(videoplayers[i]).data("watermarkurl");
|
||||
} else {
|
||||
if (rup == true && gup("vidwatermarkurl") != null && gup("vidwatermarkurl").length != 0) {
|
||||
videowatermarkurl = gup("vidwatermarkurl");
|
||||
} else {
|
||||
videowatermarkurl = defvideowatermarkurl;
|
||||
};
|
||||
};
|
||||
if (rup == true && gup("vidtext") != null && gup("vidtext").length != 0) {
|
||||
videotext = gup("vidtext");
|
||||
vidtext = true;
|
||||
} else {
|
||||
videotext = defvideotext;
|
||||
vidtext = defvidtext;
|
||||
};
|
||||
|
||||
shareurl = `${defshareurl}${vidup}`;
|
||||
|
||||
if (videotype == "video/youtube") {
|
||||
techorder = ["youtube", "html5"];
|
||||
shareurl = videourl;
|
||||
} else {
|
||||
techorder = deftechorder;
|
||||
};
|
||||
|
||||
//console.log(videourl);
|
||||
//console.log(videotype);
|
||||
//console.log(videoposter);
|
||||
//console.log(videowatermark);
|
||||
//console.log(videowatermarkurl);
|
||||
//console.log(vidtext);
|
||||
//console.log(techorder);
|
||||
|
||||
var player = videojs(videoplayers[i], {
|
||||
plugins: {
|
||||
hotkeys: {
|
||||
volumeStep: 0.1,
|
||||
seekStep: 5,
|
||||
enableModifiersForNumbers: false
|
||||
},
|
||||
},
|
||||
textTrackSettings: vidtext,
|
||||
techOrder: techorder
|
||||
});
|
||||
|
||||
if ($(videoplayers[i]).data("vr") != null && typeof $(videoplayers[i]).data("vr") == "boolean" && $(videoplayers[i]).data("vr") != "undefined" && $(videoplayers[i]).data("vr") == true) {
|
||||
console.log("VR Init");
|
||||
player.mediainfo = player.mediainfo || {};
|
||||
player.mediainfo.projection = '360';
|
||||
// AUTO is the default and looks at mediainfo:
|
||||
player.vr({projection: 'AUTO', debug: true, forceCardboard: false});
|
||||
};
|
||||
|
||||
if (showads == true) {
|
||||
// initalize ad plugin for this player
|
||||
player.exampleAds({
|
||||
debug: true
|
||||
});
|
||||
|
||||
var Html5 = videojs.getTech('Html5');
|
||||
|
||||
var eventList = Html5.Events.concat(Html5.Events.map(function(evt) {
|
||||
return 'ad' + evt;
|
||||
})).concat(Html5.Events.map(function(evt) {
|
||||
return 'content' + evt;
|
||||
})).concat([
|
||||
// events emitted by ad plugin
|
||||
'adtimeout',
|
||||
'contentupdate',
|
||||
'contentplayback',
|
||||
'readyforpreroll',
|
||||
'readyforpostroll',
|
||||
// events emitted by third party ad implementors
|
||||
'adsready',
|
||||
'adscanceled',
|
||||
'adplaying',
|
||||
'adstart', // startLinearAdMode()
|
||||
'adend', // endLinearAdMode()
|
||||
'nopreroll',
|
||||
'nopostroll'
|
||||
|
||||
]).filter(function(evt) {
|
||||
var events = {
|
||||
progress: 1,
|
||||
timeupdate: 1,
|
||||
suspend: 1,
|
||||
emptied: 1,
|
||||
durationchange: 1,
|
||||
contentprogress: 1,
|
||||
contenttimeupdate: 1,
|
||||
contentsuspend: 1,
|
||||
contentemptied: 1,
|
||||
adprogress: 1,
|
||||
adtimeupdate: 1,
|
||||
adsuspend: 1,
|
||||
ademptied: 1,
|
||||
adabort: 1
|
||||
}
|
||||
|
||||
return !(evt in events);
|
||||
});
|
||||
|
||||
player.on(eventList, function(event) {
|
||||
var d, str, evt;
|
||||
|
||||
evt = event.type;
|
||||
|
||||
d = new Date();
|
||||
d = '' +
|
||||
pad(2, d.getHours()) + ':' +
|
||||
pad(2, d.getMinutes()) + ':' +
|
||||
pad(2, d.getSeconds()) + '.' +
|
||||
pad(3, d.getMilliseconds());
|
||||
});
|
||||
};
|
||||
|
||||
var shareOptions = {
|
||||
socials: ['fb', 'tw', 'reddit', 'telegram', 'whatsapp'],
|
||||
url: shareurl,
|
||||
title: 'HooverHigh Video',
|
||||
description: 'video.js share plugin',
|
||||
image: 'https://hooverhigh.ml/assets/img/HooverHS.png',
|
||||
// required for Facebook and Messenger
|
||||
fbAppId: '436772158593997',
|
||||
redirectUri: `${shareurl}#close`,
|
||||
embedCode: `<iframe src='${shareurl}' width='560' height='315' frameborder='0' allowfullscreen></iframe>`
|
||||
}
|
||||
|
||||
//Init plugins:
|
||||
player.errors();
|
||||
player.errors.extend({
|
||||
"web-vr-hls-cors-not-supported": {
|
||||
headline: 'HLS 360 Error',
|
||||
message: 'Your browser/device does not support HLS 360 video. See http://webvr.info for assistance.'
|
||||
}
|
||||
});
|
||||
//player.replayButton();
|
||||
player.share(shareOptions);
|
||||
|
||||
//Set player src and poster:
|
||||
player.poster(videoposter);
|
||||
player.src({
|
||||
src: videourl,
|
||||
type: videotype,
|
||||
});
|
||||
|
||||
//Set player watermark:
|
||||
player.watermark({
|
||||
fadeTime: null,
|
||||
position: 'top-right',
|
||||
image: videowatermark,
|
||||
url: videowatermarkurl
|
||||
});
|
||||
|
||||
//Captions:
|
||||
if (vidtext != null && vidtext == true) {
|
||||
const trackEl = player.addRemoteTextTrack({
|
||||
src: videotext
|
||||
}, false);
|
||||
// Get all text tracks for the current player.
|
||||
/*var tracks = player.textTracks();
|
||||
for (var i = 0; i < tracks.length; i++) {
|
||||
var track = tracks[i];*/
|
||||
// Find the English captions track and mark it as "showing".
|
||||
/*if (track.kind === 'captions' && track.language === 'en') {
|
||||
track.mode = 'showing';
|
||||
}
|
||||
}*/
|
||||
};
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user