Merge branch 'v3' into 'master'
Merge Electron receiver 2.0.0 into master See merge request videostreaming/fcast!3
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
.DS_Store
|
||||
|
||||
# Ignore VSCode user project settings
|
||||
.vscode
|
|
@ -1,13 +1,14 @@
|
|||
stages:
|
||||
- buildDockerContainers
|
||||
- buildAndDeployAndroid
|
||||
- deployWebsite
|
||||
- buildAndDeployElectron
|
||||
|
||||
variables:
|
||||
ANDROID_VERSION_NAME:
|
||||
ANDROID_VERSION_NAME:
|
||||
value: ""
|
||||
description: "Enter the version name here (e.g. 1.0.1)."
|
||||
ANDROID_VERSION_CODE:
|
||||
ANDROID_VERSION_CODE:
|
||||
value: ""
|
||||
description: "Enter the version code here (e.g. 1)."
|
||||
|
||||
|
|
30
README.md
|
@ -1,8 +1,24 @@
|
|||
# FCast
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://opensource.org/license/mit"><img src="https://img.shields.io/badge/License-MIT-blue.svg?color=008BD7&style=for-the-badge&label=License&logoColor=000000&labelColor=ececec" alt="License: MIT"></a>
|
||||
<br/>
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://fcast.org/">
|
||||
<img src="website/images/ic_banner.svg" height="300">
|
||||
</a>
|
||||
</p>
|
||||
<h3 align="center"> Open source protocol for audio and video content streaming</h3>
|
||||
<br/>
|
||||
|
||||
|
||||
## What is FCast?
|
||||
|
||||
FCast is an open source protocol that enables wireless streaming of audio and video content between devices, supporting various stream types such as DASH, HLS, and mp4.
|
||||
|
||||
Unlike proprietary protocols like Chromecast and AirPlay, FCast offers an open approach, empowering third-party developers to create their own receiver devices or integrate the FCast protocol into their own apps.
|
||||
Unlike proprietary protocols like Chromecast and AirPlay, FCast offers an open approach, empowering third-party developers to create their own receiver devices or integrate the FCast protocol into their own apps.
|
||||
|
||||
## Features
|
||||
|
||||
|
@ -13,11 +29,11 @@ Unlike proprietary protocols like Chromecast and AirPlay, FCast offers an open a
|
|||
- mDNS for device discovery
|
||||
- Extensive freedom for developers to create custom receivers
|
||||
|
||||
## Client-Receiver Interaction in FCast
|
||||
## Sender-Receiver Interaction in FCast
|
||||
|
||||
In FCast, a "client" is a device or software application that discovers and communicates with a "receiver". The client, which can be a terminal client or an Android application, uses the FCast protocol to send media content to the receiver, such as a TV or media top box. The client initiates the media streaming by connecting to the receiver, launching the media, and then the receiver begins playing the media. Once the media is launched, the client can control the playback, allowing operations like pause, resume, seek, and volume adjustment.
|
||||
In FCast, a "sender" is a device or software application that discovers and communicates with a "receiver". The sender, which can be a terminal client or an Android application, uses the FCast protocol to send media content to the receiver, such as a TV or media top box. The sender initiates the media streaming by connecting to the receiver, launching the media, and then the receiver begins playing the media. Once the media is launched, the sender can control the playback, allowing operations like pause, resume, seek, and volume adjustment.
|
||||
|
||||
A "receiver", in this context, is a software implementation running on various platforms (Linux, Windows, MacOS, Android, ...) that receives media content from the client. It continuously provides updates to the client about the current state of playback.
|
||||
A "receiver", in this context, is a software implementation running on various platforms (Linux, Windows, MacOS, Android, ...) that receives media content from the sender. It continuously provides updates to the sender about the current state of playback.
|
||||
|
||||
## Project Structure
|
||||
|
||||
|
@ -26,7 +42,7 @@ A "receiver", in this context, is a software implementation running on various p
|
|||
- [**MacOS, Windows, Linux**](receivers/electron) electron.
|
||||
- Apple TV (future)
|
||||
|
||||
- Clients
|
||||
- Senders
|
||||
- [**Grayjay**](https://github.com/futo-org/grayjay-android) is a player that exposes multiple video websites as sources in the app.
|
||||
- Browser plugin (future)
|
||||
|
||||
|
@ -40,4 +56,4 @@ This project is licensed under the MIT License - see the LICENSE.md file for det
|
|||
|
||||
## Documentation
|
||||
|
||||
Click [here](https://gitlab.com/futo-org/fcast/-/wikis/Protocol-version-1) to see the protocol documentation.
|
||||
Click [here](https://gitlab.futo.org/videostreaming/fcast/-/wikis/Protocol-version-1) to see the protocol documentation.
|
||||
|
|
|
@ -1,675 +0,0 @@
|
|||
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) 2023 Koen
|
||||
|
||||
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) 2023 Koen
|
||||
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>.
|
||||
|
|
@ -59,7 +59,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
.long("mime_type")
|
||||
.value_name("MIME_TYPE")
|
||||
.help("Mime type (e.g., video/mp4)")
|
||||
.required(true)
|
||||
.required_unless_present("file")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(Arg::with_name("file")
|
||||
|
@ -189,9 +189,23 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
|
||||
let mut join_handle: Option<JoinHandle<Result<(), String>>> = None;
|
||||
if let Some(play_matches) = matches.subcommand_matches("play") {
|
||||
let file_path = play_matches.value_of("file");
|
||||
|
||||
let mime_type = match play_matches.value_of("mime_type") {
|
||||
Some(s) => s.to_string(),
|
||||
_ => return Err("MIME type is required.".into())
|
||||
_ => {
|
||||
if file_path.is_none() {
|
||||
return Err("MIME type is required.".into());
|
||||
}
|
||||
match file_path.unwrap().split('.').last() {
|
||||
Some("mkv") => "video/x-matroska".to_string(),
|
||||
Some("mov") => "video/quicktime".to_string(),
|
||||
Some("mp4") | Some("m4v") => "video/mp4".to_string(),
|
||||
Some("mpg") | Some("mpeg") => "video/mpeg".to_string(),
|
||||
Some("webm") => "video/webm".to_string(),
|
||||
_ => return Err("MIME type is required.".into()),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let time = match play_matches.value_of("timestamp") {
|
||||
|
@ -216,8 +230,6 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
).collect::<HashMap<String, String>>());
|
||||
|
||||
let file_path = play_matches.value_of("file");
|
||||
|
||||
let mut play_message = if let Some(file_path) = file_path {
|
||||
match local_ip {
|
||||
Some(lip) => {
|
||||
|
@ -235,7 +247,6 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let url = result.0;
|
||||
join_handle = Some(result.1);
|
||||
|
||||
//TODO: Make this work
|
||||
PlayMessage::new(
|
||||
mime_type,
|
||||
Some(url),
|
||||
|
@ -354,8 +365,13 @@ impl ServerState {
|
|||
}
|
||||
|
||||
fn host_file_and_get_url(local_ip: &IpAddr, file_path: &str, mime_type: &String, running: &Arc<AtomicBool>) -> Result<(String, thread::JoinHandle<Result<(), String>>), String> {
|
||||
let local_ip_str = if local_ip.is_ipv6() {
|
||||
format!("[{}]", local_ip)
|
||||
} else {
|
||||
format!("{}", local_ip)
|
||||
};
|
||||
let server = {
|
||||
let this = Server::http(format!("{}:0", local_ip));
|
||||
let this = Server::http(format!("{local_ip_str}:0"));
|
||||
match this {
|
||||
Ok(t) => Ok(t),
|
||||
Err(e) => Err((|e| format!("Failed to create server: {}", e))(e)),
|
||||
|
@ -363,7 +379,7 @@ fn host_file_and_get_url(local_ip: &IpAddr, file_path: &str, mime_type: &String,
|
|||
}?;
|
||||
|
||||
let url = match server.server_addr() {
|
||||
ListenAddr::IP(addr) => format!("http://{}:{}/", local_ip, addr.port()),
|
||||
ListenAddr::IP(addr) => format!("http://{local_ip_str}:{}/", addr.port()),
|
||||
#[cfg(unix)]
|
||||
ListenAddr::Unix(_) => return Err("Unix socket addresses are not supported.".to_string()),
|
||||
};
|
||||
|
|
3
receivers/electron/.gitignore
vendored
|
@ -129,4 +129,5 @@ dist
|
|||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
packaging/*.zip
|
||||
# Ignore VSCode user project settings
|
||||
.vscode
|
||||
|
|
|
@ -1,7 +1,77 @@
|
|||
buildAndDeployElectron:
|
||||
stage: buildAndDeployElectron
|
||||
|
||||
buildElectronDockerContainer:
|
||||
stage: buildDockerContainers
|
||||
image: docker:20.10.16
|
||||
services:
|
||||
- docker:20.10.16-dind
|
||||
tags:
|
||||
- fcast
|
||||
before_script:
|
||||
- cd receivers/electron
|
||||
script:
|
||||
- sh deploy.sh
|
||||
when: manual
|
||||
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
|
||||
- docker build -t $CI_REGISTRY/videostreaming/fcast/receiver-electron-dev:latest .
|
||||
- docker push $CI_REGISTRY/videostreaming/fcast/receiver-electron-dev:latest
|
||||
when: manual
|
||||
|
||||
buildMac:
|
||||
stage: buildAndDeployElectron
|
||||
tags:
|
||||
- m1-macos
|
||||
before_script:
|
||||
- cd receivers/electron
|
||||
script:
|
||||
- npm install
|
||||
- npm run build
|
||||
- npm run make -- --platform="darwin" --arch="arm64"
|
||||
- npm run make -- --platform="darwin" --arch="x64"
|
||||
- scp -r out/make/* root@$FCAST_DO_RUNNER_IP:/artifacts/
|
||||
artifacts:
|
||||
untracked: false
|
||||
when: on_success
|
||||
access: all
|
||||
expire_in: "30 days"
|
||||
paths:
|
||||
- receivers/electron/out/make/*
|
||||
when: manual
|
||||
|
||||
buildWindowsAndLinux:
|
||||
stage: buildAndDeployElectron
|
||||
image: gitlab.futo.org:5050/videostreaming/fcast/receiver-electron-dev:latest
|
||||
tags:
|
||||
- fcast
|
||||
before_script:
|
||||
- cd receivers/electron
|
||||
script:
|
||||
- npm install
|
||||
- npm run build
|
||||
- npm run make -- --platform="win32" --arch="x64"
|
||||
- npm run make -- --platform="linux" --arch="x64"
|
||||
- npm run make -- --platform="linux" --arch="arm64"
|
||||
- cp -rf out/make/* /artifacts/
|
||||
artifacts:
|
||||
untracked: false
|
||||
when: on_success
|
||||
access: all
|
||||
expire_in: "30 days"
|
||||
paths:
|
||||
- receivers/electron/out/make/*
|
||||
exclude:
|
||||
- receivers/electron/out/make/wix/x64/*.w*
|
||||
when: manual
|
||||
|
||||
deploy:
|
||||
stage: buildAndDeployElectron
|
||||
image: python:3.12.7-bookworm
|
||||
tags:
|
||||
- fcast
|
||||
# dependencies:
|
||||
# - buildMac
|
||||
# - buildWindowsAndLinux
|
||||
before_script:
|
||||
- cd receivers/electron
|
||||
- pip install boto3
|
||||
- pip install requests
|
||||
script:
|
||||
- python3 scripts/deploy/deploy.py
|
||||
when: manual
|
||||
|
|
1
receivers/electron/.npmrc
Normal file
|
@ -0,0 +1 @@
|
|||
@futo:registry=https://gitlab.futo.org/api/v4/projects/305/packages/npm/
|
19
receivers/electron/Dockerfile
Normal file
|
@ -0,0 +1,19 @@
|
|||
FROM node:22.10.0-bookworm
|
||||
|
||||
RUN dpkg --add-architecture i386
|
||||
RUN apt update && apt install -y zip dpkg fakeroot rpm wget p7zip-full unzip rsync jq awscli
|
||||
RUN wget https://github.com/ebourg/jsign/releases/download/6.0/jsign_6.0_all.deb
|
||||
RUN apt install -y ./jsign_6.0_all.deb
|
||||
|
||||
RUN mkdir -pm755 /etc/apt/keyrings
|
||||
RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
||||
RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
|
||||
RUN echo "deb http://deb.debian.org/debian bookworm main contrib non-free" > /etc/apt/sources.list
|
||||
RUN echo "deb http://deb.debian.org/debian bookworm-updates main contrib non-free" >> /etc/apt/sources.list
|
||||
|
||||
RUN apt update && apt install -y --install-recommends winehq-stable mono-devel winetricks
|
||||
RUN winetricks -q -f dotnet45
|
||||
|
||||
RUN wget https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip
|
||||
RUN unzip wix314-binaries.zip -d wix314-binaries
|
||||
ENV WINEPATH="/wix314-binaries/"
|
|
@ -1,674 +0,0 @@
|
|||
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) 2023 Koen
|
||||
|
||||
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) 2023 Koen
|
||||
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>.
|
|
@ -6,29 +6,31 @@ FCast is a protocol designed for wireless streaming of audio and video content b
|
|||
|
||||
The FCast receiver is a working receiver implementation compatible with Linux, Windows and MacOS that supports various stream types such as DASH, HLS and mp4.
|
||||
|
||||

|
||||

|
||||
|
||||
# Protocol specification
|
||||
|
||||
The protocol specification can be found here https://gitlab.com/futo-org/fcast/-/wikis/home
|
||||
The protocol specification can be found here https://gitlab.futo.org/videostreaming/fcast/-/wikis/home
|
||||
|
||||
# Clients
|
||||
# Receiver application
|
||||
|
||||
# Receivers
|
||||
|
||||
There are currently receivers for
|
||||
|
||||
|
||||
|
||||
1. Download the latest build for your platform from https://gitlab.com/futo-org/fcast/-/releases or build it yourself by following the build instructions.
|
||||
1. Download the latest build for your platform from https://fcast.org/#downloads or build it yourself by following the build instructions.
|
||||
2. Unzip the archive at your desired location.
|
||||
3. Run the FCast receiver.
|
||||
- **MacOS:** Run the FCastReceiver application
|
||||
- **MacOS:** Run the `FCast Receiver` application
|
||||
- **Linux:** Run the `fcast-receiver` application
|
||||
- **Windows:** Run the `fcast-receiver.exe` application
|
||||
4. You should now have the receiver running on the background. On desktop it will have a tray icon as such allowing you to close the receiver.
|
||||
4. The application will open the main window where you can setup a connection to your sender device.
|
||||
|
||||

|
||||

|
||||
|
||||
The application will continue to run in the system tray when you close the player or main window. You can exit the application or access other menu options from the tray icon.
|
||||
|
||||
There are also command line flags to customize application behavior, some of which include:
|
||||
* `--no-main-window`: Hide the main window on start
|
||||
* `--fullscreen`: Start the main window in fullscreen
|
||||
|
||||
Use the `--help` flag to see full list of available flags.
|
||||
|
||||
# Connecting to the FCast receiver with the video streaming application
|
||||
|
||||
|
@ -56,52 +58,38 @@ There are currently receivers for
|
|||
|
||||
# How to build
|
||||
|
||||
# Preparing for build
|
||||
## Preparing for build
|
||||
|
||||
Run the following commands in the `root` directory.
|
||||
A docker file is provided to setup your build environment. From the root of the repository:
|
||||
* Build: `docker build -t fcast/receiver-electron-dev:latest receivers/electron/`
|
||||
* Run: `docker run --rm -it -w /app/receivers/electron --entrypoint='bash' -v .:/app fcast/receiver-electron-dev:latest`
|
||||
|
||||
You can then run the following commands to finish setup.
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
# Building
|
||||
## Development
|
||||
|
||||
Run the following commands in the `root` directory.
|
||||
Run the following commands in the `/app/receivers/electron` directory.
|
||||
* Build: `npm run build`
|
||||
* Run: `npm run start`
|
||||
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
## Packaging
|
||||
|
||||
# Packaging
|
||||
Below are the following platforms currently used for packaging:
|
||||
* `npm run make -- --platform="darwin" --arch="arm64"`
|
||||
* `npm run make -- --platform="darwin" --arch="x64"`
|
||||
* `npm run make -- --platform="win32" --arch="x64"`
|
||||
* `npm run make -- --platform="linux" --arch="x64"`
|
||||
* `npm run make -- --platform="linux" --arch="arm64"`
|
||||
|
||||
## Windows
|
||||
Other platforms and architectures supported by [Electron Forge](https://www.electronforge.io/) might work, but are currently untested.
|
||||
|
||||
Run the following commands in the `packaging` directory.
|
||||
Packages that will be built from running the above `make` commands:
|
||||
* Windows: `.msi` and `.zip`
|
||||
* MacOS: `.dmg` and `.zip`
|
||||
* Linux: `.deb`, `.rpm` and `.zip`
|
||||
|
||||
```
|
||||
sh package.sh win32-x64
|
||||
```
|
||||
|
||||
## MacOS ARM64
|
||||
|
||||
Run the following commands in the `packaging` directory.
|
||||
|
||||
```
|
||||
sh package-macos.sh darwin-arm64
|
||||
```
|
||||
|
||||
## MacOS x64
|
||||
|
||||
Run the following commands in the `packaging` directory.
|
||||
|
||||
```
|
||||
sh package-macos.sh darwin-x64
|
||||
```
|
||||
|
||||
## Linux x64
|
||||
|
||||
Run the following commands in the `packaging` directory.
|
||||
|
||||
```
|
||||
sh package.sh linux-x64
|
||||
```
|
||||
Package artifacts will be located in `/app/receivers/electron/out/make`
|
||||
|
|
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 14 KiB |
BIN
receivers/electron/assets/fonts/InterVariable.woff2
Normal file
BIN
receivers/electron/assets/fonts/Outfit-VariableFont_wght.ttf
Normal file
7
receivers/electron/assets/fonts/inter.css
Normal file
|
@ -0,0 +1,7 @@
|
|||
@font-face {
|
||||
font-family: InterVariable;
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-display: swap;
|
||||
src: url("InterVariable.woff2") format("woff2");
|
||||
}
|
7
receivers/electron/assets/fonts/outfit.css
Normal file
|
@ -0,0 +1,7 @@
|
|||
@font-face {
|
||||
font-family: Outfit;
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-display: swap;
|
||||
src: url("Outfit-VariableFont_wght.ttf") format("truetype");
|
||||
}
|
BIN
receivers/electron/assets/icons/app/icon.icns
Normal file
BIN
receivers/electron/assets/icons/app/icon.ico
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
receivers/electron/assets/icons/app/icon.png
Normal file
After Width: | Height: | Size: 24 KiB |
269
receivers/electron/assets/icons/app/icon.svg
Normal file
|
@ -0,0 +1,269 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="111.96011"
|
||||
height="114.46101"
|
||||
viewBox="0 0 111.96011 114.46101"
|
||||
fill="none"
|
||||
version="1.1"
|
||||
id="svg30"
|
||||
sodipodi:docname="logo3.svg"
|
||||
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="true"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="36"
|
||||
inkscape:cy="58.1875"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1128"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg30" />
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="m 84.763099,5.5827991 c 2.06,-2.0602 0.601,-5.58279997600248 -2.312,-5.58279997600248 H 3.2702997 C 1.4641997,-8.7600248e-7 -3.525637e-7,1.4641991 -3.525637e-7,3.2702991 V 82.451 c 0,2.913 3.5226000525637,4.373 5.5828000525637,2.312 L 20.366299,69.98 c 0.6134,-0.613 0.9579,-1.445 0.9579,-2.313 V 24.5965 c 0,-1.8062 1.4642,-3.2703 3.2703,-3.2703 h 43.0706 c 0.868,0 1.699,-0.3446 2.313,-0.9579 z"
|
||||
fill="#ffffff"
|
||||
id="path1"
|
||||
style="fill:url(#linearGradient9);fill-opacity:1" />
|
||||
<defs
|
||||
id="defs30">
|
||||
<linearGradient
|
||||
id="linearGradient8"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop8" />
|
||||
<stop
|
||||
style="stop-color:#d3d3d3;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop9" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint0_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop11" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop12" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint1_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop13" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop14" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint2_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop15" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop16" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint3_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop17" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop18" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint4_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop19" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop20" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint5_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop21" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop22" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint6_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop23" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop24" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint7_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop25" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop26" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint8_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop27" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop28" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint9_linear_659_300"
|
||||
x1="166.964"
|
||||
y1="113.94"
|
||||
x2="81.113297"
|
||||
y2="113.94"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-55.003901,-43.001)">
|
||||
<stop
|
||||
stop-color="#3004A0"
|
||||
id="stop29" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#0567E8"
|
||||
id="stop30" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint0_linear_200_827"
|
||||
x1="29.933599"
|
||||
y1="29.966999"
|
||||
x2="59.579201"
|
||||
y2="62.929798"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.4590919,0,0,2.4590868,-43.987224,-43.02245)">
|
||||
<stop
|
||||
stop-color="#26D1FF"
|
||||
id="stop17-2" />
|
||||
<stop
|
||||
offset="0.545685"
|
||||
stop-color="#0A62F5"
|
||||
id="stop18-9" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#1E05FF"
|
||||
id="stop19-1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint1_linear_200_827"
|
||||
x1="45.967999"
|
||||
y1="28.6367"
|
||||
x2="45.967999"
|
||||
y2="64.033302"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.4590919,0,0,2.4590868,-43.987224,-43.02245)">
|
||||
<stop
|
||||
stop-color="#EDEDED"
|
||||
stop-opacity="0"
|
||||
id="stop20-2" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#303030"
|
||||
id="stop21-7" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient8"
|
||||
id="linearGradient9"
|
||||
x1="85.727425"
|
||||
y1="42.863884"
|
||||
x2="-2.508903e-06"
|
||||
y2="42.863884"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<path
|
||||
d="m 45.678643,73.496213 v 17.17967 c 0,0.67748 -0.549362,1.22662 -1.226841,1.22662 H 27.558578 c -0.67748,0 -1.226841,-0.54914 -1.226841,-1.22662 v -17.17967 c 0,-0.67748 0.549361,-1.22659 1.226841,-1.22659 h 16.893224 c 0.677479,0 1.226841,0.54911 1.226841,1.22659 z m 0,-22.333424 v 17.179674 c 0,0.67748 -0.549362,1.22659 -1.226841,1.22659 H 27.558578 c -0.67748,0 -1.226841,-0.54911 -1.226841,-1.22659 V 51.162789 c 0,-0.677477 0.549361,-1.226592 1.226841,-1.226592 h 16.893224 c 0.677479,0 1.226841,0.549115 1.226841,1.226592 z m 22.046984,0 v 17.179674 c 0,0.67748 -0.54912,1.22659 -1.2266,1.22659 H 49.605813 c -0.677481,0 -1.226841,-0.54911 -1.226841,-1.22659 V 51.162789 c 0,-0.677477 0.54936,-1.226592 1.226841,-1.226592 h 16.893214 c 0.67748,0 1.2266,0.549115 1.2266,1.226592 z m 0,-22.333425 v 17.179672 c 0,0.677477 -0.54912,1.226592 -1.2266,1.226592 H 49.605813 c -0.677481,0 -1.226841,-0.549115 -1.226841,-1.226592 V 28.829364 c 0,-0.67748 0.54936,-1.226593 1.226841,-1.226593 h 16.893214 c 0.67748,0 1.2266,0.549113 1.2266,1.226593 z m 22.04723,22.333425 v 17.179674 c 0,0.67748 -0.54912,1.22659 -1.2266,1.22659 h -16.89346 c -0.67748,0 -1.2266,-0.54911 -1.2266,-1.22659 V 51.162789 c 0,-0.677477 0.54912,-1.226592 1.2266,-1.226592 h 16.89346 c 0.67748,0 1.2266,0.549115 1.2266,1.226592 z m -22.04723,22.333424 v 17.17967 c 0,0.67748 -0.54912,1.22662 -1.2266,1.22662 H 49.605813 c -0.677481,0 -1.226841,-0.54914 -1.226841,-1.22662 v -17.17967 c 0,-0.67748 0.54936,-1.22659 1.226841,-1.22659 h 16.893214 c 0.67748,0 1.2266,0.54911 1.2266,1.22659 z m 22.04723,-44.666849 v 17.179672 c 0,0.677477 -0.54912,1.226592 -1.2266,1.226592 h -16.89346 c -0.67748,0 -1.2266,-0.549115 -1.2266,-1.226592 V 28.829364 c 0,-0.67748 0.54912,-1.226593 1.2266,-1.226593 h 16.89346 c 0.67748,0 1.2266,0.549113 1.2266,1.226593 z m -44.094214,0 v 17.179672 c 0,0.677477 -0.549362,1.226592 -1.226841,1.226592 H 27.558578 c -0.67748,0 -1.226841,-0.549115 -1.226841,-1.226592 V 28.829364 c 0,-0.67748 0.549361,-1.226593 1.226841,-1.226593 h 16.893224 c 0.677479,0 1.226841,0.549113 1.226841,1.226593 z m 0,67.000289 v 17.179677 c 0,0.67748 -0.549362,1.22659 -1.226841,1.22659 H 27.558578 c -0.67748,0 -1.226841,-0.54911 -1.226841,-1.22659 V 95.829653 c 0,-0.67748 0.549361,-1.22659 1.226841,-1.22659 h 16.893224 c 0.677479,0 1.226841,0.54911 1.226841,1.22659 z M 111.77289,28.829364 v 17.179672 c 0,0.677477 -0.54911,1.226592 -1.22659,1.226592 H 93.653067 c -0.67748,0 -1.22684,-0.549115 -1.22684,-1.226592 V 28.829364 c 0,-0.67748 0.54936,-1.226593 1.22684,-1.226593 H 110.5463 c 0.67748,0 1.22659,0.549113 1.22659,1.226593 z"
|
||||
fill="url(#paint0_linear_200_827)"
|
||||
stroke="url(#paint1_linear_200_827)"
|
||||
stroke-width="0.40985"
|
||||
id="path2-9"
|
||||
style="fill:url(#paint0_linear_200_827);stroke:url(#paint1_linear_200_827)" />
|
||||
</svg>
|
After Width: | Height: | Size: 9.9 KiB |
BIN
receivers/electron/assets/icons/app/icon1024.png
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
receivers/electron/assets/icons/app/icon512.png
Normal file
After Width: | Height: | Size: 24 KiB |
3
receivers/electron/assets/icons/player/icon24_cc_off.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20.8 3.75H3.2C1.9867 3.75 1 4.67503 1 5.8125V18.1875C1 19.325 1.9867 20.25 3.2 20.25H20.8C22.0133 20.25 23 19.325 23 18.1875V5.8125C23 4.67503 22.0133 3.75 20.8 3.75ZM10.9 9.9375H7.6V14.0625H10.9V16.125H7.6C6.3867 16.125 5.4 15.2 5.4 14.0625V9.9375C5.4 8.80003 6.3867 7.875 7.6 7.875H10.9V9.9375ZM18.6 9.9375H15.3V14.0625H18.6V16.125H15.3C14.0867 16.125 13.1 15.2 13.1 14.0625V9.9375C13.1 8.80003 14.0867 7.875 15.3 7.875H18.6V9.9375Z" fill="#595959"/>
|
||||
</svg>
|
After Width: | Height: | Size: 566 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20.8 3.75H3.2C1.9867 3.75 1 4.67503 1 5.8125V18.1875C1 19.325 1.9867 20.25 3.2 20.25H20.8C22.0133 20.25 23 19.325 23 18.1875V5.8125C23 4.67503 22.0133 3.75 20.8 3.75ZM10.9 9.9375H7.6V14.0625H10.9V16.125H7.6C6.3867 16.125 5.4 15.2 5.4 14.0625V9.9375C5.4 8.80003 6.3867 7.875 7.6 7.875H10.9V9.9375ZM18.6 9.9375H15.3V14.0625H18.6V16.125H15.3C14.0867 16.125 13.1 15.2 13.1 14.0625V9.9375C13.1 8.80003 14.0867 7.875 15.3 7.875H18.6V9.9375Z" fill="#8f8f8f"/>
|
||||
</svg>
|
After Width: | Height: | Size: 566 B |
3
receivers/electron/assets/icons/player/icon24_cc_on.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20.8 3.75H3.2C1.9867 3.75 1 4.67503 1 5.8125V18.1875C1 19.325 1.9867 20.25 3.2 20.25H20.8C22.0133 20.25 23 19.325 23 18.1875V5.8125C23 4.67503 22.0133 3.75 20.8 3.75ZM10.9 9.9375H7.6V14.0625H10.9V16.125H7.6C6.3867 16.125 5.4 15.2 5.4 14.0625V9.9375C5.4 8.80003 6.3867 7.875 7.6 7.875H10.9V9.9375ZM18.6 9.9375H15.3V14.0625H18.6V16.125H15.3C14.0867 16.125 13.1 15.2 13.1 14.0625V9.9375C13.1 8.80003 14.0867 7.875 15.3 7.875H18.6V9.9375Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 566 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20.8 3.75H3.2C1.9867 3.75 1 4.67503 1 5.8125V18.1875C1 19.325 1.9867 20.25 3.2 20.25H20.8C22.0133 20.25 23 19.325 23 18.1875V5.8125C23 4.67503 22.0133 3.75 20.8 3.75ZM10.9 9.9375H7.6V14.0625H10.9V16.125H7.6C6.3867 16.125 5.4 15.2 5.4 14.0625V9.9375C5.4 8.80003 6.3867 7.875 7.6 7.875H10.9V9.9375ZM18.6 9.9375H15.3V14.0625H18.6V16.125H15.3C14.0867 16.125 13.1 15.2 13.1 14.0625V9.9375C13.1 8.80003 14.0867 7.875 15.3 7.875H18.6V9.9375Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 564 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19.6652 6.35151C20.1116 6.82018 20.1116 7.58132 19.6652 8.04999L10.5234 17.6485C10.077 18.1172 9.35208 18.1172 8.9057 17.6485L4.33478 12.8492C3.88841 12.3806 3.88841 11.6194 4.33478 11.1508C4.78116 10.6821 5.50608 10.6821 5.95246 11.1508L9.71633 15.0989L18.0511 6.35151C18.4975 5.88283 19.2224 5.88283 19.6688 6.35151H19.6652Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 456 B |
|
@ -0,0 +1,6 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.24976 1H2.24976C2.08558 0.999907 1.92299 1.03218 1.77129 1.09496C1.61959 1.15775 1.48176 1.24982 1.36566 1.36591C1.24957 1.482 1.1575 1.61984 1.09472 1.77154C1.03193 1.92323 0.999663 2.08582 0.999756 2.25V7.25C0.999756 7.58152 1.13145 7.89946 1.36587 8.13388C1.60029 8.3683 1.91824 8.5 2.24976 8.5C2.58128 8.5 2.89922 8.3683 3.13364 8.13388C3.36806 7.89946 3.49976 7.58152 3.49976 7.25V3.5H7.24976C7.58128 3.5 7.89922 3.3683 8.13364 3.13388C8.36806 2.89946 8.49976 2.58152 8.49976 2.25C8.49976 1.91848 8.36806 1.60054 8.13364 1.36612C7.89922 1.1317 7.58128 1 7.24976 1Z" fill="#c9c9c9"/>
|
||||
<path d="M19.7498 1H14.7498C14.4182 1 14.1003 1.1317 13.8659 1.36612C13.6315 1.60054 13.4998 1.91848 13.4998 2.25C13.4998 2.58152 13.6315 2.89946 13.8659 3.13388C14.1003 3.3683 14.4182 3.5 14.7498 3.5H18.4998V7.25C18.4998 7.58152 18.6315 7.89946 18.8659 8.13388C19.1003 8.3683 19.4182 8.5 19.7498 8.5C20.0813 8.5 20.3992 8.3683 20.6336 8.13388C20.8681 7.89946 20.9998 7.58152 20.9998 7.25V2.25C20.9998 2.08582 20.9676 1.92323 20.9048 1.77154C20.842 1.61984 20.7499 1.482 20.6338 1.36591C20.5178 1.24982 20.3799 1.15775 20.2282 1.09496C20.0765 1.03218 19.9139 0.999907 19.7498 1Z" fill="#c9c9c9"/>
|
||||
<path d="M7.24976 18.5H3.49976V14.75C3.49976 14.4185 3.36806 14.1005 3.13364 13.8661C2.89922 13.6317 2.58128 13.5 2.24976 13.5C1.91824 13.5 1.60029 13.6317 1.36587 13.8661C1.13145 14.1005 0.999756 14.4185 0.999756 14.75V19.75C0.999663 19.9142 1.03193 20.0768 1.09472 20.2285C1.1575 20.3802 1.24957 20.518 1.36566 20.6341C1.48176 20.7502 1.61959 20.8423 1.77129 20.905C1.92299 20.9678 2.08558 21.0001 2.24976 21H7.24976C7.58128 21 7.89922 20.8683 8.13364 20.6339C8.36806 20.3995 8.49976 20.0815 8.49976 19.75C8.49976 19.4185 8.36806 19.1005 8.13364 18.8661C7.89922 18.6317 7.58128 18.5 7.24976 18.5Z" fill="#c9c9c9"/>
|
||||
<path d="M19.7498 13.5C19.5856 13.4999 19.423 13.5322 19.2713 13.595C19.1196 13.6577 18.9818 13.7498 18.8657 13.8659C18.7496 13.982 18.6575 14.1198 18.5947 14.2715C18.5319 14.4232 18.4997 14.5858 18.4998 14.75V18.5H14.7498C14.4182 18.5 14.1003 18.6317 13.8659 18.8661C13.6315 19.1005 13.4998 19.4185 13.4998 19.75C13.4998 20.0815 13.6315 20.3995 13.8659 20.6339C14.1003 20.8683 14.4182 21 14.7498 21H19.7498C19.9139 21.0001 20.0765 20.9678 20.2282 20.905C20.3799 20.8423 20.5178 20.7502 20.6338 20.6341C20.7499 20.518 20.842 20.3802 20.9048 20.2285C20.9676 20.0768 20.9998 19.9142 20.9998 19.75V14.75C20.9998 14.5858 20.9676 14.4232 20.9048 14.2715C20.842 14.1198 20.7499 13.982 20.6338 13.8659C20.5178 13.7498 20.3799 13.6577 20.2282 13.595C20.0765 13.5322 19.9139 13.4999 19.7498 13.5Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -0,0 +1,6 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.24976 1H2.24976C2.08558 0.999907 1.92299 1.03218 1.77129 1.09496C1.61959 1.15775 1.48176 1.24982 1.36566 1.36591C1.24957 1.482 1.1575 1.61984 1.09472 1.77154C1.03193 1.92323 0.999663 2.08582 0.999756 2.25V7.25C0.999756 7.58152 1.13145 7.89946 1.36587 8.13388C1.60029 8.3683 1.91824 8.5 2.24976 8.5C2.58128 8.5 2.89922 8.3683 3.13364 8.13388C3.36806 7.89946 3.49976 7.58152 3.49976 7.25V3.5H7.24976C7.58128 3.5 7.89922 3.3683 8.13364 3.13388C8.36806 2.89946 8.49976 2.58152 8.49976 2.25C8.49976 1.91848 8.36806 1.60054 8.13364 1.36612C7.89922 1.1317 7.58128 1 7.24976 1Z" fill="white"/>
|
||||
<path d="M19.7498 1H14.7498C14.4182 1 14.1003 1.1317 13.8659 1.36612C13.6315 1.60054 13.4998 1.91848 13.4998 2.25C13.4998 2.58152 13.6315 2.89946 13.8659 3.13388C14.1003 3.3683 14.4182 3.5 14.7498 3.5H18.4998V7.25C18.4998 7.58152 18.6315 7.89946 18.8659 8.13388C19.1003 8.3683 19.4182 8.5 19.7498 8.5C20.0813 8.5 20.3992 8.3683 20.6336 8.13388C20.8681 7.89946 20.9998 7.58152 20.9998 7.25V2.25C20.9998 2.08582 20.9676 1.92323 20.9048 1.77154C20.842 1.61984 20.7499 1.482 20.6338 1.36591C20.5178 1.24982 20.3799 1.15775 20.2282 1.09496C20.0765 1.03218 19.9139 0.999907 19.7498 1Z" fill="white"/>
|
||||
<path d="M7.24976 18.5H3.49976V14.75C3.49976 14.4185 3.36806 14.1005 3.13364 13.8661C2.89922 13.6317 2.58128 13.5 2.24976 13.5C1.91824 13.5 1.60029 13.6317 1.36587 13.8661C1.13145 14.1005 0.999756 14.4185 0.999756 14.75V19.75C0.999663 19.9142 1.03193 20.0768 1.09472 20.2285C1.1575 20.3802 1.24957 20.518 1.36566 20.6341C1.48176 20.7502 1.61959 20.8423 1.77129 20.905C1.92299 20.9678 2.08558 21.0001 2.24976 21H7.24976C7.58128 21 7.89922 20.8683 8.13364 20.6339C8.36806 20.3995 8.49976 20.0815 8.49976 19.75C8.49976 19.4185 8.36806 19.1005 8.13364 18.8661C7.89922 18.6317 7.58128 18.5 7.24976 18.5Z" fill="white"/>
|
||||
<path d="M19.7498 13.5C19.5856 13.4999 19.423 13.5322 19.2713 13.595C19.1196 13.6577 18.9818 13.7498 18.8657 13.8659C18.7496 13.982 18.6575 14.1198 18.5947 14.2715C18.5319 14.4232 18.4997 14.5858 18.4998 14.75V18.5H14.7498C14.4182 18.5 14.1003 18.6317 13.8659 18.8661C13.6315 19.1005 13.4998 19.4185 13.4998 19.75C13.4998 20.0815 13.6315 20.3995 13.8659 20.6339C14.1003 20.8683 14.4182 21 14.7498 21H19.7498C19.9139 21.0001 20.0765 20.9678 20.2282 20.905C20.3799 20.8423 20.5178 20.7502 20.6338 20.6341C20.7499 20.518 20.842 20.3802 20.9048 20.2285C20.9676 20.0768 20.9998 19.9142 20.9998 19.75V14.75C20.9998 14.5858 20.9676 14.4232 20.9048 14.2715C20.842 14.1198 20.7499 13.982 20.6338 13.8659C20.5178 13.7498 20.3799 13.6577 20.2282 13.595C20.0765 13.5322 19.9139 13.4999 19.7498 13.5Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.84351 17.1171V14.5887H9.28498V20.97H6.69635V17.1171H2.84351ZM6.69635 6.88299V3.03015H9.28498V9.41142H2.84351V6.88299H6.69635ZM14.402 20.97V14.5887H20.8435V17.1171H16.9907V20.97H14.402ZM16.9907 6.88299H20.8435V9.41142H14.402V3.03015H16.9907V6.88299Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 382 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.84351 17.1171V14.5887H9.28498V20.97H6.69635V17.1171H2.84351ZM6.69635 6.88299V3.03015H9.28498V9.41142H2.84351V6.88299H6.69635ZM14.402 20.97V14.5887H20.8435V17.1171H16.9907V20.97H14.402ZM16.9907 6.88299H20.8435V9.41142H14.402V3.03015H16.9907V6.88299Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 380 B |
4
receivers/electron/assets/icons/player/icon24_mute.svg
Normal file
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.9924 14.5755V3.85875C14.9924 3.59609 14.9026 3.36832 14.7232 3.17544C14.5437 2.98255 14.3246 2.88611 14.0659 2.88611C13.8071 2.88611 13.5734 2.98871 13.3647 3.19391L8.444 8.03273L14.9924 14.5755ZM14.9924 17.4027V19.9381C14.9924 20.2007 14.9026 20.4244 14.7232 20.6091C14.5437 20.7938 14.3246 20.8861 14.0659 20.8861C13.7988 20.8861 13.565 20.7876 13.3647 20.5906L8.35661 15.6782H4.42524C4.15814 15.6782 3.93277 15.5879 3.74914 15.4073C3.56551 15.2267 3.47369 15.0051 3.47369 14.7425V9.05437C3.47369 8.79172 3.56551 8.5701 3.74914 8.38953C3.93277 8.20895 4.15814 8.11867 4.42524 8.11867H5.72523C5.76007 8.16978 5.80018 8.21839 5.84555 8.26372L14.9924 17.4027Z" fill="#c9c9c9"/>
|
||||
<path d="M2.70729 1.71153C3.09775 1.32108 3.73078 1.321 4.12133 1.71137L22.062 19.6435C22.4527 20.034 22.4527 20.6673 22.0621 21.0579C21.6717 21.4483 21.0386 21.4484 20.6481 21.0581L2.70746 3.12592C2.31677 2.73542 2.3167 2.10212 2.70729 1.71153Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.9924 14.5755V3.85875C14.9924 3.59609 14.9026 3.36832 14.7232 3.17544C14.5437 2.98255 14.3246 2.88611 14.0659 2.88611C13.8071 2.88611 13.5734 2.98871 13.3647 3.19391L8.444 8.03273L14.9924 14.5755ZM14.9924 17.4027V19.9381C14.9924 20.2007 14.9026 20.4244 14.7232 20.6091C14.5437 20.7938 14.3246 20.8861 14.0659 20.8861C13.7988 20.8861 13.565 20.7876 13.3647 20.5906L8.35661 15.6782H4.42524C4.15814 15.6782 3.93277 15.5879 3.74914 15.4073C3.56551 15.2267 3.47369 15.0051 3.47369 14.7425V9.05437C3.47369 8.79172 3.56551 8.5701 3.74914 8.38953C3.93277 8.20895 4.15814 8.11867 4.42524 8.11867H5.72523C5.76007 8.16978 5.80018 8.21839 5.84555 8.26372L14.9924 17.4027Z" fill="white"/>
|
||||
<path d="M2.70729 1.71153C3.09775 1.32108 3.73078 1.321 4.12133 1.71137L22.062 19.6435C22.4527 20.034 22.4527 20.6673 22.0621 21.0579C21.6717 21.4483 21.0386 21.4484 20.6481 21.0581L2.70746 3.12592C2.31677 2.73542 2.3167 2.10212 2.70729 1.71153Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
3
receivers/electron/assets/icons/player/icon24_pause.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 20V4H9.56376V20H5ZM14.1812 4H18.745V20H14.1812V4Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 183 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 20V4H9.56376V20H5ZM14.1812 4H18.745V20H14.1812V4Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 181 B |
3
receivers/electron/assets/icons/player/icon24_play.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.34282 20C5.9769 20 5.67501 19.8658 5.43716 19.5975C5.19931 19.3291 5.08038 18.9693 5.08038 18.518V5.47284C5.08038 5.02154 5.19931 4.66476 5.43716 4.40252C5.67501 4.13417 5.9769 4 6.34282 4C6.53798 4 6.72399 4.03354 6.90085 4.10063C7.08381 4.16771 7.27897 4.2592 7.48633 4.37507L18.2719 10.6232C18.6683 10.8489 18.9519 11.0623 19.1227 11.2636C19.2935 11.4648 19.3788 11.7088 19.3788 11.9954C19.3788 12.2821 19.2935 12.526 19.1227 12.7273C18.9519 12.9285 18.6683 13.145 18.2719 13.3768L7.48633 19.6158C7.27897 19.7378 7.08381 19.8323 6.90085 19.8994C6.72399 19.9665 6.53798 20 6.34282 20Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 720 B |
|
@ -0,0 +1,3 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.34282 20C5.9769 20 5.67501 19.8658 5.43716 19.5975C5.19931 19.3291 5.08038 18.9693 5.08038 18.518V5.47284C5.08038 5.02154 5.19931 4.66476 5.43716 4.40252C5.67501 4.13417 5.9769 4 6.34282 4C6.53798 4 6.72399 4.03354 6.90085 4.10063C7.08381 4.16771 7.27897 4.2592 7.48633 4.37507L18.2719 10.6232C18.6683 10.8489 18.9519 11.0623 19.1227 11.2636C19.2935 11.4648 19.3788 11.7088 19.3788 11.9954C19.3788 12.2821 19.2935 12.526 19.1227 12.7273C18.9519 12.9285 18.6683 13.145 18.2719 13.3768L7.48633 19.6158C7.27897 19.7378 7.08381 19.8323 6.90085 19.8994C6.72399 19.9665 6.53798 20 6.34282 20Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 718 B |
17
receivers/electron/assets/icons/player/icon24_speed.svg
Normal file
|
@ -0,0 +1,17 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M 13.7129,1.20037 C 13.5599,1.1763 13.4038,1.18275 13.2534,1.21936 13.1029,1.25597 12.9611,1.32202 12.8361,1.41374 12.711,1.50546 12.6052,1.62105 12.5245,1.75392 c -0.0806,0.13287 -0.1344,0.28041 -0.1584,0.43419 -0.0239,0.15379 -0.0175,0.31081 0.0189,0.4621 0.0364,0.1513 0.1021,0.2939 0.1933,0.41967 0.0912,0.12576 0.2061,0.23223 0.3383,0.31333 0.1321,0.08109 0.2788,0.13522 0.4317,0.15929 3.389098,0.232344 5.207929,2.038111 6.604054,4.253237 1.118996,1.775427 1.325364,4.141017 0.792011,6.245906 -0.430385,1.678707 -1.358294,3.188482 -2.663099,4.333639 -1.304899,1.145121 -2.926554,1.872712 -4.654699,2.088365 -0.157845,0.01485 -0.311047,0.06109 -0.450441,0.135992 -0.139396,0.07491 -0.262211,0.176936 -0.361116,0.300045 -0.09891,0.123118 -0.171919,0.264807 -0.21471,0.416667 -0.04279,0.151859 -0.05447,0.310816 -0.03436,0.467418 0.0201,0.156603 0.07167,0.307691 0.151516,0.444297 0.07976,0.136572 0.186337,0.25591 0.31331,0.350903 0.126873,0.09498 0.271635,0.163699 0.42563,0.202072 0.153995,0.03837 0.314022,0.0456 0.470684,0.02128 2.551396,-0.319899 4.90852,-1.514905 6.665935,-3.379393 1.757318,-1.864512 2.80501,-4.281972 2.962701,-6.836347 C 23.513427,10.032106 22.806641,7.372284 21.257196,5.427038 19.461266,3.172344 17.377145,1.625939 13.7129,1.20037 Z"
|
||||
fill="#c9c9c9" />
|
||||
<path
|
||||
d="M 8.07143,15.3046 V 9.35604 C 8.07157,9.08675 8.14013,8.82197 8.2706,8.58682 8.40107,8.35166 8.58912,8.15394 8.81691,8.0124 9.04469,7.87086 9.30467,7.79021 9.57215,7.77809 9.83964,7.76598 10.1058,7.8228 10.3453,7.94317 l 5.9148,2.97433 c 0.2607,0.1313 0.4799,0.3331 0.6331,0.5826 0.1531,0.2495 0.2343,0.537 0.2343,0.8302 0,0.2933 -0.0812,0.5807 -0.2343,0.8302 -0.1532,0.2496 -0.3724,0.4513 -0.6331,0.5827 l -5.9148,2.9743 C 10.1058,16.8378 9.83964,16.8947 9.57215,16.8826 9.30467,16.8704 9.04469,16.7898 8.81691,16.6482 8.58912,16.5067 8.40107,16.309 8.2706,16.0738 8.14013,15.8387 8.07157,15.5739 8.07143,15.3046 Z"
|
||||
fill="#c9c9c9" />
|
||||
<path
|
||||
d="M 10.6863,2.31225 C 10.725,2.46314 10.7338,2.62022 10.7121,2.77452 10.6904,2.92881 10.6387,3.07729 10.5598,3.21146 10.481,3.34562 10.3767,3.46284 10.2528,3.55641 10.1289,3.64997 9.98781,3.71804 9.83771,3.75673 9.44403,3.8586 9.05806,3.98852 8.68271,4.1455 8.53981,4.20527 8.38659,4.23615 8.23182,4.23637 8.07705,4.23659 7.92375,4.20616 7.78068,4.14679 7.6376,4.08743 7.50755,4.00031 7.39796,3.8904 7.28836,3.7805 7.20136,3.64996 7.14193,3.50624 7.0825,3.36251 7.05179,3.20843 7.05157,3.05277 7.05135,2.89712 7.08162,2.74295 7.14064,2.59905 7.19967,2.45516 7.28629,2.32437 7.39558,2.21415 7.50486,2.10393 7.63467,2.01644 7.77757,1.95667 8.25214,1.75754 8.744,1.5916 9.25157,1.46043 9.40149,1.42171 9.55753,1.41307 9.71078,1.435 c 0.15324,0.02194 0.30072,0.07402 0.43392,0.15327 0.1332,0.07924 0.2496,0.18411 0.3425,0.3086 0.093,0.1245 0.1606,0.2646 0.1991,0.41538 z M 6.005,4.26087 C 6.2224,4.48645 6.34188,4.78959 6.33716,5.10371 6.33245,5.41782 6.20393,5.71721 5.97986,5.93608 5.39555,6.50882 4.89314,7.16036 4.487,7.87205 4.4123,8.01106 4.31071,8.13365 4.18821,8.2326 4.06572,8.33156 3.92478,8.40488 3.7737,8.44826 3.62261,8.49163 3.46443,8.50419 3.30845,8.48519 3.15247,8.46619 3.00185,8.41602 2.86543,8.33762 2.72901,8.25922 2.60956,8.15419 2.51409,8.02868 2.41862,7.90318 2.34907,7.75975 2.30953,7.60682 2.26999,7.45389 2.26125,7.29455 2.28382,7.13818 2.3064,6.9818 2.35984,6.83155 2.441,6.69625 2.95566,5.7904 3.59471,4.96203 4.33929,4.23558 4.56358,4.01694 4.86501,3.89679 5.17735,3.90153 5.48968,3.90627 5.78737,4.03552 6.005,4.26087 Z"
|
||||
fill="#c9c9c9" />
|
||||
<path
|
||||
d="m 2.5268743,9.5228951 c 0.3098728,0.046129 0.589468,0.2134487 0.7773467,0.4652329 0.1878804,0.25177 0.2686758,0.567403 0.22464,0.877519 -0.1136188,0.810272 -0.1142716,1.633023 -0.00195,2.44471 0.025607,0.155718 0.019891,0.314829 -0.016815,0.467963 -0.036692,0.153135 -0.103645,0.297209 -0.1968964,0.423744 -0.093265,0.126534 -0.2109436,0.232979 -0.3461307,0.313074 -0.1351869,0.08009 -0.285141,0.132222 -0.4410639,0.153317 -0.155923,0.0211 -0.3146436,0.01076 -0.4668564,-0.03047 C 1.9069428,14.596772 1.7643374,14.525546 1.6397164,14.428487 1.5150953,14.331426 1.4109697,14.2105 1.3334655,14.072826 1.2559631,13.935137 1.2066531,13.783482 1.1884279,13.626763 1.043654,12.595027 1.0447093,11.548805 1.1915583,10.518968 1.2359088,10.2089 1.4014648,9.9298163 1.6518506,9.7430394 1.9022287,9.5562686 2.2169594,9.4770886 2.5268743,9.5228951 Z"
|
||||
fill="#c9c9c9" />
|
||||
<path
|
||||
d="m 2.9263167,15.692773 c 0.2757306,-0.148735 0.5998338,-0.182299 0.9011147,-0.09328 0.3012739,0.089 0.5550776,0.293292 0.7056331,0.567965 0.3945227,0.716798 0.886966,1.375904 1.4632309,1.958459 0.1138029,0.10933 0.2045599,0.240142 0.266925,0.384737 0.062378,0.144591 0.095098,0.300056 0.096254,0.457235 0.00115,0.157187 -0.029296,0.312918 -0.089537,0.458044 -0.060243,0.145126 -0.1490677,0.276708 -0.2612635,0.387021 -0.112196,0.110313 -0.2454778,0.197121 -0.3920371,0.255324 -0.1465494,0.05821 -0.3033987,0.08662 -0.4613283,0.08359 -0.1579298,-0.003 -0.3137503,-0.03748 -0.4582919,-0.101261 C 4.5524683,19.986807 4.4221224,19.894932 4.3136299,19.780379 3.5795376,19.04109 2.9535201,18.202827 2.4540459,17.290329 2.3037709,17.015508 2.2691013,16.692871 2.3576556,16.39331 2.4462071,16.093759 2.6507458,15.841788 2.9263167,15.692773 Z m 4.1953049,4.873184 c 0.1254576,-0.286226 0.3601429,-0.510811 0.6524735,-0.624396 0.2923085,-0.113581 0.618309,-0.106861 0.9063581,0.01865 0.3756122,0.163711 0.762213,0.30108 1.156869,0.411084 0.3028188,0.08453 0.5598248,0.285213 0.7145048,0.55787 0.154676,0.272665 0.194271,0.594953 0.110218,0.89602 -0.08406,0.301066 -0.284866,0.556237 -0.55841,0.709339 -0.273548,0.153148 -0.5973332,0.19167 -0.9001528,0.107127 C 8.6966635,22.50016 8.2055345,22.325523 7.7348173,22.119051 7.4469054,21.993382 7.2204524,21.759141 7.1055001,21.467913 6.9904996,21.176672 6.9963029,20.852243 7.1216216,20.565957 Z"
|
||||
fill="#c9c9c9" />
|
||||
</svg>
|
After Width: | Height: | Size: 5.8 KiB |
|
@ -0,0 +1,17 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M 13.7129,1.20037 C 13.5599,1.1763 13.4038,1.18275 13.2534,1.21936 13.1029,1.25597 12.9611,1.32202 12.8361,1.41374 12.711,1.50546 12.6052,1.62105 12.5245,1.75392 c -0.0806,0.13287 -0.1344,0.28041 -0.1584,0.43419 -0.0239,0.15379 -0.0175,0.31081 0.0189,0.4621 0.0364,0.1513 0.1021,0.2939 0.1933,0.41967 0.0912,0.12576 0.2061,0.23223 0.3383,0.31333 0.1321,0.08109 0.2788,0.13522 0.4317,0.15929 3.389098,0.232344 5.207929,2.038111 6.604054,4.253237 1.118996,1.775427 1.325364,4.141017 0.792011,6.245906 -0.430385,1.678707 -1.358294,3.188482 -2.663099,4.333639 -1.304899,1.145121 -2.926554,1.872712 -4.654699,2.088365 -0.157845,0.01485 -0.311047,0.06109 -0.450441,0.135992 -0.139396,0.07491 -0.262211,0.176936 -0.361116,0.300045 -0.09891,0.123118 -0.171919,0.264807 -0.21471,0.416667 -0.04279,0.151859 -0.05447,0.310816 -0.03436,0.467418 0.0201,0.156603 0.07167,0.307691 0.151516,0.444297 0.07976,0.136572 0.186337,0.25591 0.31331,0.350903 0.126873,0.09498 0.271635,0.163699 0.42563,0.202072 0.153995,0.03837 0.314022,0.0456 0.470684,0.02128 2.551396,-0.319899 4.90852,-1.514905 6.665935,-3.379393 1.757318,-1.864512 2.80501,-4.281972 2.962701,-6.836347 C 23.513427,10.032106 22.806641,7.372284 21.257196,5.427038 19.461266,3.172344 17.377145,1.625939 13.7129,1.20037 Z"
|
||||
fill="#ffffff" />
|
||||
<path
|
||||
d="M 8.07143,15.3046 V 9.35604 C 8.07157,9.08675 8.14013,8.82197 8.2706,8.58682 8.40107,8.35166 8.58912,8.15394 8.81691,8.0124 9.04469,7.87086 9.30467,7.79021 9.57215,7.77809 9.83964,7.76598 10.1058,7.8228 10.3453,7.94317 l 5.9148,2.97433 c 0.2607,0.1313 0.4799,0.3331 0.6331,0.5826 0.1531,0.2495 0.2343,0.537 0.2343,0.8302 0,0.2933 -0.0812,0.5807 -0.2343,0.8302 -0.1532,0.2496 -0.3724,0.4513 -0.6331,0.5827 l -5.9148,2.9743 C 10.1058,16.8378 9.83964,16.8947 9.57215,16.8826 9.30467,16.8704 9.04469,16.7898 8.81691,16.6482 8.58912,16.5067 8.40107,16.309 8.2706,16.0738 8.14013,15.8387 8.07157,15.5739 8.07143,15.3046 Z"
|
||||
fill="#ffffff" />
|
||||
<path
|
||||
d="M 10.6863,2.31225 C 10.725,2.46314 10.7338,2.62022 10.7121,2.77452 10.6904,2.92881 10.6387,3.07729 10.5598,3.21146 10.481,3.34562 10.3767,3.46284 10.2528,3.55641 10.1289,3.64997 9.98781,3.71804 9.83771,3.75673 9.44403,3.8586 9.05806,3.98852 8.68271,4.1455 8.53981,4.20527 8.38659,4.23615 8.23182,4.23637 8.07705,4.23659 7.92375,4.20616 7.78068,4.14679 7.6376,4.08743 7.50755,4.00031 7.39796,3.8904 7.28836,3.7805 7.20136,3.64996 7.14193,3.50624 7.0825,3.36251 7.05179,3.20843 7.05157,3.05277 7.05135,2.89712 7.08162,2.74295 7.14064,2.59905 7.19967,2.45516 7.28629,2.32437 7.39558,2.21415 7.50486,2.10393 7.63467,2.01644 7.77757,1.95667 8.25214,1.75754 8.744,1.5916 9.25157,1.46043 9.40149,1.42171 9.55753,1.41307 9.71078,1.435 c 0.15324,0.02194 0.30072,0.07402 0.43392,0.15327 0.1332,0.07924 0.2496,0.18411 0.3425,0.3086 0.093,0.1245 0.1606,0.2646 0.1991,0.41538 z M 6.005,4.26087 C 6.2224,4.48645 6.34188,4.78959 6.33716,5.10371 6.33245,5.41782 6.20393,5.71721 5.97986,5.93608 5.39555,6.50882 4.89314,7.16036 4.487,7.87205 4.4123,8.01106 4.31071,8.13365 4.18821,8.2326 4.06572,8.33156 3.92478,8.40488 3.7737,8.44826 3.62261,8.49163 3.46443,8.50419 3.30845,8.48519 3.15247,8.46619 3.00185,8.41602 2.86543,8.33762 2.72901,8.25922 2.60956,8.15419 2.51409,8.02868 2.41862,7.90318 2.34907,7.75975 2.30953,7.60682 2.26999,7.45389 2.26125,7.29455 2.28382,7.13818 2.3064,6.9818 2.35984,6.83155 2.441,6.69625 2.95566,5.7904 3.59471,4.96203 4.33929,4.23558 4.56358,4.01694 4.86501,3.89679 5.17735,3.90153 5.48968,3.90627 5.78737,4.03552 6.005,4.26087 Z"
|
||||
fill="#ffffff" />
|
||||
<path
|
||||
d="m 2.5268743,9.5228951 c 0.3098728,0.046129 0.589468,0.2134487 0.7773467,0.4652329 0.1878804,0.25177 0.2686758,0.567403 0.22464,0.877519 -0.1136188,0.810272 -0.1142716,1.633023 -0.00195,2.44471 0.025607,0.155718 0.019891,0.314829 -0.016815,0.467963 -0.036692,0.153135 -0.103645,0.297209 -0.1968964,0.423744 -0.093265,0.126534 -0.2109436,0.232979 -0.3461307,0.313074 -0.1351869,0.08009 -0.285141,0.132222 -0.4410639,0.153317 -0.155923,0.0211 -0.3146436,0.01076 -0.4668564,-0.03047 C 1.9069428,14.596772 1.7643374,14.525546 1.6397164,14.428487 1.5150953,14.331426 1.4109697,14.2105 1.3334655,14.072826 1.2559631,13.935137 1.2066531,13.783482 1.1884279,13.626763 1.043654,12.595027 1.0447093,11.548805 1.1915583,10.518968 1.2359088,10.2089 1.4014648,9.9298163 1.6518506,9.7430394 1.9022287,9.5562686 2.2169594,9.4770886 2.5268743,9.5228951 Z"
|
||||
fill="#ffffff" />
|
||||
<path
|
||||
d="m 2.9263167,15.692773 c 0.2757306,-0.148735 0.5998338,-0.182299 0.9011147,-0.09328 0.3012739,0.089 0.5550776,0.293292 0.7056331,0.567965 0.3945227,0.716798 0.886966,1.375904 1.4632309,1.958459 0.1138029,0.10933 0.2045599,0.240142 0.266925,0.384737 0.062378,0.144591 0.095098,0.300056 0.096254,0.457235 0.00115,0.157187 -0.029296,0.312918 -0.089537,0.458044 -0.060243,0.145126 -0.1490677,0.276708 -0.2612635,0.387021 -0.112196,0.110313 -0.2454778,0.197121 -0.3920371,0.255324 -0.1465494,0.05821 -0.3033987,0.08662 -0.4613283,0.08359 -0.1579298,-0.003 -0.3137503,-0.03748 -0.4582919,-0.101261 C 4.5524683,19.986807 4.4221224,19.894932 4.3136299,19.780379 3.5795376,19.04109 2.9535201,18.202827 2.4540459,17.290329 2.3037709,17.015508 2.2691013,16.692871 2.3576556,16.39331 2.4462071,16.093759 2.6507458,15.841788 2.9263167,15.692773 Z m 4.1953049,4.873184 c 0.1254576,-0.286226 0.3601429,-0.510811 0.6524735,-0.624396 0.2923085,-0.113581 0.618309,-0.106861 0.9063581,0.01865 0.3756122,0.163711 0.762213,0.30108 1.156869,0.411084 0.3028188,0.08453 0.5598248,0.285213 0.7145048,0.55787 0.154676,0.272665 0.194271,0.594953 0.110218,0.89602 -0.08406,0.301066 -0.284866,0.556237 -0.55841,0.709339 -0.273548,0.153148 -0.5973332,0.19167 -0.9001528,0.107127 C 8.6966635,22.50016 8.2055345,22.325523 7.7348173,22.119051 7.4469054,21.993382 7.2204524,21.759141 7.1055001,21.467913 6.9904996,21.176672 6.9963029,20.852243 7.1216216,20.565957 Z"
|
||||
fill="#ffffff" />
|
||||
</svg>
|
After Width: | Height: | Size: 5.8 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.0983 5.42385V18.2487C11.0983 18.4582 11.028 18.6366 10.8872 18.7839C10.7464 18.9312 10.5746 19.0049 10.3717 19.0049C10.1622 19.0049 9.97886 18.9263 9.82174 18.7692L5.89375 14.851H2.81028C2.60079 14.851 2.42403 14.779 2.28 14.635C2.13598 14.4909 2.06396 14.3142 2.06396 14.1047V9.56787C2.06396 9.35838 2.13598 9.18162 2.28 9.0376C2.42403 8.89357 2.60079 8.82156 2.81028 8.82156H5.89375L9.82174 4.89357C9.9854 4.7299 10.1687 4.64807 10.3717 4.64807C10.5746 4.64807 10.7464 4.72499 10.8872 4.87884C11.028 5.03269 11.0983 5.21436 11.0983 5.42385Z" fill="#c9c9c9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 7.40483C15.6876 8.24862 16.8506 9.9818 16.8506 12C16.8506 14.0183 15.6876 15.7515 14 16.5839V7.40483Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 850 B |
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.0983 5.42385V18.2487C11.0983 18.4582 11.028 18.6366 10.8872 18.7839C10.7464 18.9312 10.5746 19.0049 10.3717 19.0049C10.1622 19.0049 9.97886 18.9263 9.82174 18.7692L5.89375 14.851H2.81028C2.60079 14.851 2.42403 14.779 2.28 14.635C2.13598 14.4909 2.06396 14.3142 2.06396 14.1047V9.56787C2.06396 9.35838 2.13598 9.18162 2.28 9.0376C2.42403 8.89357 2.60079 8.82156 2.81028 8.82156H5.89375L9.82174 4.89357C9.9854 4.7299 10.1687 4.64807 10.3717 4.64807C10.5746 4.64807 10.7464 4.72499 10.8872 4.87884C11.028 5.03269 11.0983 5.21436 11.0983 5.42385Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 7.40483C15.6876 8.24862 16.8506 9.9818 16.8506 12C16.8506 14.0183 15.6876 15.7515 14 16.5839V7.40483Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 846 B |
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.0983 5.42381V18.2487C11.0983 18.4582 11.028 18.6366 10.8872 18.7839C10.7464 18.9312 10.5746 19.0048 10.3717 19.0048C10.1622 19.0048 9.97886 18.9263 9.82174 18.7691L5.89375 14.851H2.81028C2.60079 14.851 2.42403 14.779 2.28 14.6349C2.13598 14.4909 2.06396 14.3142 2.06396 14.1047V9.56784C2.06396 9.35834 2.13598 9.18158 2.28 9.03756C2.42403 8.89353 2.60079 8.82152 2.81028 8.82152H5.89375L9.82174 4.89353C9.9854 4.72987 10.1687 4.64803 10.3717 4.64803C10.5746 4.64803 10.7464 4.72496 10.8872 4.8788C11.028 5.03265 11.0983 5.21432 11.0983 5.42381Z" fill="#c9c9c9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 4.34892V2C18.5724 3.03763 21.9818 7.11973 21.9818 12C21.9818 16.8803 18.5724 20.9624 14 22V19.6511C17.2953 18.6705 19.7013 15.6146 19.7013 12C19.7013 8.38541 17.2953 5.32953 14 4.34892ZM14 7.4048C15.6876 8.24858 16.8506 9.98176 16.8506 12C16.8506 14.0183 15.6876 15.7514 14 16.5838V7.4048Z" fill="#c9c9c9"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.0983 5.42381V18.2487C11.0983 18.4582 11.028 18.6366 10.8872 18.7839C10.7464 18.9312 10.5746 19.0048 10.3717 19.0048C10.1622 19.0048 9.97886 18.9263 9.82174 18.7691L5.89375 14.851H2.81028C2.60079 14.851 2.42403 14.779 2.28 14.6349C2.13598 14.4909 2.06396 14.3142 2.06396 14.1047V9.56784C2.06396 9.35834 2.13598 9.18158 2.28 9.03756C2.42403 8.89353 2.60079 8.82152 2.81028 8.82152H5.89375L9.82174 4.89353C9.9854 4.72987 10.1687 4.64803 10.3717 4.64803C10.5746 4.64803 10.7464 4.72496 10.8872 4.8788C11.028 5.03265 11.0983 5.21432 11.0983 5.42381Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 4.34892V2C18.5724 3.03763 21.9818 7.11973 21.9818 12C21.9818 16.8803 18.5724 20.9624 14 22V19.6511C17.2953 18.6705 19.7013 15.6146 19.7013 12C19.7013 8.38541 17.2953 5.32953 14 4.34892ZM14 7.4048C15.6876 8.24858 16.8506 9.98176 16.8506 12C16.8506 14.0183 15.6876 15.7514 14 16.5838V7.4048Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1 KiB |
BIN
receivers/electron/assets/images/background.png
Normal file
After Width: | Height: | Size: 45 KiB |
|
@ -1,32 +0,0 @@
|
|||
#!/bin/sh
|
||||
DOCUMENT_ROOT=/var/www/html
|
||||
|
||||
# Build content
|
||||
echo "Building content..."
|
||||
npm install
|
||||
cd packaging
|
||||
sh package-all.sh
|
||||
|
||||
# Take site offline
|
||||
echo "Taking site offline..."
|
||||
touch $DOCUMENT_ROOT/maintenance.file
|
||||
|
||||
# Swap over the content
|
||||
echo "Deploying content..."
|
||||
cp fcast-receiver-*.zip $DOCUMENT_ROOT/fcastreceiver/
|
||||
cd ..
|
||||
cp package.json $DOCUMENT_ROOT/fcastreceiver/
|
||||
cp -r dist $DOCUMENT_ROOT/fcastreceiver/
|
||||
|
||||
# Notify Cloudflare to wipe the CDN cache
|
||||
echo "Purging Cloudflare cache..."
|
||||
curl -X POST "https://api.cloudflare.com/client/v4/zones/ff904f7348b9513064b23e852e328abb/purge_cache" \
|
||||
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data '{"purge_everything":true}'
|
||||
|
||||
sleep 30
|
||||
|
||||
# Take site back online
|
||||
echo "Bringing site back online..."
|
||||
rm $DOCUMENT_ROOT/maintenance.file
|
11
receivers/electron/eslint.config.mjs
Normal file
|
@ -0,0 +1,11 @@
|
|||
import globals from "globals";
|
||||
import pluginJs from "@eslint/js";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
|
||||
export default [
|
||||
{files: ["**/*.{js,mjs,cjs,ts}"]},
|
||||
{languageOptions: { globals: globals.node }},
|
||||
pluginJs.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
];
|
262
receivers/electron/forge.config.js
Normal file
|
@ -0,0 +1,262 @@
|
|||
const fs = require('fs');
|
||||
const yargs = require('yargs/yargs');
|
||||
const { hideBin } = require('yargs/helpers');
|
||||
const cp = require('child_process');
|
||||
const path = require('path');
|
||||
// const extract = require('extract-zip')
|
||||
|
||||
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
|
||||
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
|
||||
|
||||
const argv = yargs(hideBin(process.argv)).argv;
|
||||
const APPLICATION_NAME = 'fcast-receiver';
|
||||
const APPLICATION_TITLE = 'FCast Receiver';
|
||||
const CI_SIGNING_DIR = '/deploy/signing';
|
||||
|
||||
module.exports = {
|
||||
packagerConfig: {
|
||||
asar: true,
|
||||
icon: './assets/icons/app/icon',
|
||||
osxSign: {},
|
||||
osxNotarize: {
|
||||
appleApiKey: process.env.FCAST_APPLE_API_KEY,
|
||||
appleApiKeyId: process.env.FCAST_APPLE_API_KEY_ID,
|
||||
appleApiIssuer: process.env.FCAST_APPLE_API_ISSUER
|
||||
}
|
||||
},
|
||||
rebuildConfig: {},
|
||||
makers: [
|
||||
{
|
||||
name: '@electron-forge/maker-deb',
|
||||
config: {
|
||||
options: {
|
||||
categories: ['AudioVideo', 'Audio', 'Video', 'Network', 'Utility'],
|
||||
homepage: 'https://fcast.org/',
|
||||
icon: './assets/icons/app/icon.png',
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '@electron-forge/maker-dmg',
|
||||
config: {
|
||||
additionalDMGOptions: {
|
||||
window: {
|
||||
position: {
|
||||
x: 425,
|
||||
y: 275
|
||||
},
|
||||
size: {
|
||||
width: 640,
|
||||
height: 480
|
||||
}
|
||||
}
|
||||
},
|
||||
background: './assets/images/background.png',
|
||||
contents: [
|
||||
{ 'x': 90, 'y': 350, 'type': 'file', 'path': `out/${APPLICATION_NAME}-darwin-${argv.arch}/${APPLICATION_TITLE}.app` },
|
||||
{ 'x': 360, 'y': 350, 'type': 'link', 'path': '/Applications' },
|
||||
{ 'x': 0, 'y': 540, 'type': 'position', 'path': '.background' },
|
||||
{ 'x': 120, 'y': 540, 'type': 'position', 'path': '.VolumeIcon.icns' }
|
||||
],
|
||||
format: 'ULFO',
|
||||
icon: './assets/icons/app/icon.icns',
|
||||
name: APPLICATION_TITLE
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '@electron-forge/maker-rpm',
|
||||
config: {
|
||||
options: {
|
||||
categories: ['AudioVideo', 'Audio', 'Video', 'Network', 'Utility'],
|
||||
homepage: 'https://fcast.org/',
|
||||
icon: './assets/icons/app/icon.png',
|
||||
license: 'MIT',
|
||||
}
|
||||
},
|
||||
},
|
||||
// Same as '@electron-forge/maker-wix', except linux compatible
|
||||
{
|
||||
name: '@futo/forge-maker-wix-linux',
|
||||
config: {
|
||||
arch: 'x64',
|
||||
appUserModelId: `org.futo.${APPLICATION_NAME}`,
|
||||
icon: './assets/icons/app/icon.ico',
|
||||
name: APPLICATION_TITLE,
|
||||
programFilesFolderName: APPLICATION_TITLE,
|
||||
shortcutName: APPLICATION_TITLE,
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '@electron-forge/maker-zip',
|
||||
// Manually creating zip for mac targets due to .app renaming
|
||||
platforms: ["win32", "linux"],
|
||||
config: {}
|
||||
},
|
||||
],
|
||||
hooks: {
|
||||
readPackageJson: async (forgeConfig, packageJson) => {
|
||||
packageJson.channel = process.env.FCAST_CHANNEL ? process.env.FCAST_CHANNEL : 'stable';
|
||||
if (packageJson.channel !== 'stable') {
|
||||
packageJson.channelVersion = process.env.FCAST_CHANNEL_VERSION ? process.env.FCAST_CHANNEL_VERSION : '1';
|
||||
}
|
||||
|
||||
return packageJson;
|
||||
},
|
||||
|
||||
postPackage: async (config, packageResults) => {
|
||||
switch (packageResults.platform) {
|
||||
case "win32": {
|
||||
const exePath = `./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_NAME}.exe`;
|
||||
|
||||
if (fs.existsSync(CI_SIGNING_DIR)) {
|
||||
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${exePath}`)));
|
||||
}
|
||||
else {
|
||||
console.warn('Windows signing script not found, skipping...');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "darwin": {
|
||||
let artifactName = `${APPLICATION_NAME}.app`;
|
||||
if (fs.existsSync(`./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${artifactName}`)) {
|
||||
fs.renameSync(`./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${artifactName}`, `./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_TITLE}.app`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "linux": {
|
||||
// Workaround for broken Ubuntu builds due to sandboxing permissions:
|
||||
// * https://github.com/electron/electron/issues/17972c
|
||||
// * https://github.com/electron/electron/issues/41066
|
||||
fs.renameSync(`./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_NAME}`, `./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_NAME}.app`);
|
||||
fs.writeFileSync(`./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_NAME}`,
|
||||
'#!/bin/sh\n' +
|
||||
'if [ "$0" = "/usr/bin/fcast-receiver" ]; then\n' +
|
||||
'\tbin="/usr/lib/fcast-receiver/fcast-receiver.app"\n' +
|
||||
'else\n' +
|
||||
'\tbin="$0.app"\n' +
|
||||
'fi\n' +
|
||||
'"$bin" --no-sandbox $*'
|
||||
);
|
||||
fs.chmodSync(`./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_NAME}`, 0o755);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
postMake: async (forgeConfig, makeResults) => {
|
||||
for (const e of makeResults) {
|
||||
// Standardize artifact output naming
|
||||
switch (e.platform) {
|
||||
case "win32": {
|
||||
let artifactName = `${APPLICATION_NAME}-win32-${e.arch}-${e.packageJSON.version}.zip`;
|
||||
if (fs.existsSync(`./out/make/zip/win32/${e.arch}/${artifactName}`)) {
|
||||
fs.renameSync(`./out/make/zip/win32/${e.arch}/${artifactName}`, path.join(`./out/make/zip/win32/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'zip')));
|
||||
}
|
||||
|
||||
artifactName = `${APPLICATION_NAME}.msi`;
|
||||
if (fs.existsSync(`./out/make/wix/${e.arch}/${artifactName}`)) {
|
||||
const artifactPath = path.join(`./out/make/wix/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'msi'));
|
||||
fs.renameSync(`./out/make/wix/${e.arch}/${artifactName}`, artifactPath);
|
||||
|
||||
if (fs.existsSync(CI_SIGNING_DIR)) {
|
||||
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${artifactPath}`)));
|
||||
}
|
||||
else {
|
||||
console.warn('Windows signing script not found, skipping...');
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "darwin": {
|
||||
let artifactName = `${APPLICATION_TITLE}.dmg`;
|
||||
if (fs.existsSync(`./out/make/${artifactName}`)) {
|
||||
fs.mkdirSync(`./out/make/dmg/${e.arch}`, { recursive: true });
|
||||
fs.renameSync(`./out/make/${artifactName}`, path.join(`./out/make/dmg/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'dmg')));
|
||||
}
|
||||
|
||||
console.log(`Making a zip distributable for ${e.platform}/${e.arch}`);
|
||||
const zipPath = path.resolve(process.cwd(), 'out', 'make', 'zip', e.platform, e.arch, generateArtifactName(e.packageJSON, e.platform, e.arch, 'zip'));
|
||||
|
||||
console.log(cp.execSync(`mkdir -p ${path.dirname(zipPath)}`));
|
||||
console.log(cp.execSync(`cd out/${APPLICATION_NAME}-${e.platform}-${e.arch}; zip -r -y "${zipPath}" "${APPLICATION_TITLE}.app"`));
|
||||
break;
|
||||
}
|
||||
case "linux": {
|
||||
let artifactName = `${APPLICATION_NAME}-linux-${e.arch}-${e.packageJSON.version}.zip`;
|
||||
if (fs.existsSync(`./out/make/zip/linux/${e.arch}/${artifactName}`)) {
|
||||
fs.renameSync(`./out/make/zip/linux/${e.arch}/${artifactName}`, path.join(`./out/make/zip/linux/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'zip')));
|
||||
}
|
||||
|
||||
artifactName = `${APPLICATION_NAME}_${e.packageJSON.version}_amd64.deb`
|
||||
if (fs.existsSync(`./out/make/deb/${e.arch}/${artifactName}`)) {
|
||||
fs.renameSync(`./out/make/deb/${e.arch}/${artifactName}`, path.join(`./out/make/deb/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'deb')));
|
||||
}
|
||||
|
||||
artifactName = `${APPLICATION_NAME}_${e.packageJSON.version}_arm64.deb`
|
||||
if (fs.existsSync(`./out/make/deb/${e.arch}/${artifactName}`)) {
|
||||
fs.renameSync(`./out/make/deb/${e.arch}/${artifactName}`, path.join(`./out/make/deb/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'deb')));
|
||||
}
|
||||
|
||||
artifactName = `${APPLICATION_NAME}-${e.packageJSON.version}-1.x86_64.rpm`
|
||||
if (fs.existsSync(`./out/make/rpm/${e.arch}/${artifactName}`)) {
|
||||
fs.renameSync(`./out/make/rpm/${e.arch}/${artifactName}`, path.join(`./out/make/rpm/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'rpm')));
|
||||
}
|
||||
|
||||
artifactName = `${APPLICATION_NAME}-${e.packageJSON.version}-1.arm64.rpm`
|
||||
if (fs.existsSync(`./out/make/rpm/${e.arch}/${artifactName}`)) {
|
||||
fs.renameSync(`./out/make/rpm/${e.arch}/${artifactName}`, path.join(`./out/make/rpm/${e.arch}`, generateArtifactName(e.packageJSON, e.platform, e.arch, 'rpm')));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
name: '@electron-forge/plugin-auto-unpack-natives',
|
||||
config: {},
|
||||
},
|
||||
// Fuses are used to enable/disable various Electron functionality
|
||||
// at package time, before code signing the application
|
||||
new FusesPlugin({
|
||||
version: FuseVersion.V1,
|
||||
[FuseV1Options.RunAsNode]: false,
|
||||
[FuseV1Options.EnableCookieEncryption]: true,
|
||||
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
||||
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
||||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: false,
|
||||
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
function getArtifactOS(platform) {
|
||||
switch (platform) {
|
||||
case 'win32':
|
||||
return 'windows';
|
||||
case 'darwin':
|
||||
return 'macOS';
|
||||
default:
|
||||
return platform;
|
||||
}
|
||||
}
|
||||
|
||||
function generateArtifactName(packageJSON, platform, arch, extension) {
|
||||
let artifactName = `${APPLICATION_NAME}-${packageJSON.version}-${getArtifactOS(platform)}-${arch}`;
|
||||
if (extension === 'msi') {
|
||||
artifactName += '-setup';
|
||||
}
|
||||
if (packageJSON.channel !== 'stable') {
|
||||
artifactName += `-${packageJSON.channel}-${packageJSON.channelVersion}`;
|
||||
}
|
||||
artifactName += `.${extension}`
|
||||
return artifactName;
|
||||
}
|
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 715 KiB |
BIN
receivers/electron/images/main-window.png
Normal file
After Width: | Height: | Size: 226 KiB |
BIN
receivers/electron/images/player-window.png
Normal file
After Width: | Height: | Size: 1 MiB |
9143
receivers/electron/package-lock.json
generated
|
@ -1,37 +1,64 @@
|
|||
{
|
||||
"name": "fcast-receiver",
|
||||
"version": "1.0.14",
|
||||
"version": "2.0.0",
|
||||
"description": "An application implementing a FCast receiver.",
|
||||
"main": "dist/bundle.js",
|
||||
"author": "Koen Jeukendrup",
|
||||
"author": "FUTO",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "rm -rf dist/ && webpack --config ./webpack.config.js && cp -r src/player dist/player && cp -r src/main dist/main && cp app.ico dist/ && cp app.png dist/",
|
||||
"start": "npm run build && electron .",
|
||||
"test": "jest"
|
||||
"build": "rm -rf dist/ && webpack --config ./webpack.config.js && rsync -r src/player/* dist/player --exclude *.ts && rsync -r src/main/* dist/main --exclude *.ts && cp assets/icons/app/icon.ico dist/ && cp assets/icons/app/icon.png dist/ && cp assets/icons/app/icon512.png dist/",
|
||||
"start": "electron-forge start",
|
||||
"test": "jest",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "^7.4.0",
|
||||
"@electron-forge/maker-deb": "^7.5.0",
|
||||
"@electron-forge/maker-dmg": "^7.5.0",
|
||||
"@electron-forge/maker-rpm": "^7.5.0",
|
||||
"@electron-forge/maker-wix": "^7.5.0",
|
||||
"@electron-forge/maker-zip": "^7.4.0",
|
||||
"@electron-forge/plugin-auto-unpack-natives": "^7.4.0",
|
||||
"@electron-forge/plugin-fuses": "^7.4.0",
|
||||
"@electron/fuses": "^1.8.0",
|
||||
"@eslint/js": "^9.10.0",
|
||||
"@futo/forge-maker-wix-linux": "^7.5.0",
|
||||
"@types/electron-json-storage": "^4.5.4",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/mdns": "^0.0.38",
|
||||
"@types/node-forge": "^1.3.10",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/workerpool": "^6.1.1",
|
||||
"@types/ws": "^8.5.10",
|
||||
"electron": "^22.2.0",
|
||||
"@types/yargs": "^17.0.33",
|
||||
"electron": "^32.2.1",
|
||||
"eslint": "^9.10.0",
|
||||
"globals": "^15.9.0",
|
||||
"jest": "^29.7.0",
|
||||
"mdns-js": "github:mdns-js/node-mdns-js",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-loader": "^9.4.2",
|
||||
"typescript": "^4.9.5",
|
||||
"typescript": "^5.5.4",
|
||||
"typescript-eslint": "^8.4.0",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vscode/sudo-prompt": "^9.3.1",
|
||||
"bufferutil": "^4.0.8",
|
||||
"dashjs": "^4.7.4",
|
||||
"electron-json-storage": "^4.6.0",
|
||||
"extract-zip": "^2.0.1",
|
||||
"hls.js": "^1.5.15",
|
||||
"http": "^0.0.1-security",
|
||||
"https": "^1.0.0",
|
||||
"log4js": "^6.9.1",
|
||||
"qrcode": "^1.5.3",
|
||||
"update-electron-app": "^3.0.0",
|
||||
"url": "^0.11.3",
|
||||
"uuid": "^9.0.1",
|
||||
"ws": "^8.14.2"
|
||||
"ws": "^8.14.2",
|
||||
"yargs": "^17.7.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
npm run build
|
||||
sh package.sh linux-x64
|
||||
sh package.sh linux-arm64
|
||||
sh package.sh win32-x64
|
||||
sh package-macos.sh darwin-x64
|
||||
sh package-macos.sh darwin-arm64
|
|
@ -1,20 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
filename="electron-v23.0.0-$1.zip"
|
||||
url="https://github.com/electron/electron/releases/download/v23.0.0/electron-v23.0.0-$1.zip"
|
||||
if [ ! -f $filename ]; then
|
||||
wget $url
|
||||
fi
|
||||
|
||||
rm fcast-receiver-$1.zip
|
||||
rm -rf $1
|
||||
unzip electron-v23.0.0-$1.zip -d $1
|
||||
mkdir -p $1/Electron.app/Contents/Resources/app
|
||||
mkdir -p $1/Electron.app/Contents/Resources/app
|
||||
cp -r ../dist $1/Electron.app/Contents/Resources/app/
|
||||
cp ../package.json $1/Electron.app/Contents/Resources/app
|
||||
mv $1/Electron.app $1/FCastReceiver.app
|
||||
cd $1
|
||||
zip -r ../fcast-receiver-$1.zip FCastReceiver.app
|
||||
cd ..
|
||||
rm -rf $1
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
filename="electron-v23.0.0-$1.zip"
|
||||
url="https://github.com/electron/electron/releases/download/v23.0.0/electron-v23.0.0-$1.zip"
|
||||
if [ ! -f $filename ]; then
|
||||
wget $url
|
||||
fi
|
||||
|
||||
rm fcast-receiver-$1.zip
|
||||
rm -rf $1
|
||||
unzip electron-v23.0.0-$1.zip -d $1
|
||||
mkdir -p $1/resources
|
||||
mkdir -p $1/resources/app
|
||||
cp -r ../dist $1/resources/app/
|
||||
cp ../package.json $1/resources/app
|
||||
|
||||
if [ -f "$1/electron" ]; then
|
||||
mv $1/electron $1/fcast-receiver
|
||||
fi
|
||||
|
||||
if [ -f "$1/electron.exe" ]; then
|
||||
mv $1/electron.exe $1/fcast-receiver.exe
|
||||
fi
|
||||
|
||||
cd $1
|
||||
zip -r ../fcast-receiver-$1.zip .
|
||||
cd ..
|
||||
rm -rf $1
|
15
receivers/electron/scripts/create-iconset.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/zsh
|
||||
mkdir icon.iconset
|
||||
sips -z 16 16 ./assets/icons/app/icon1024.png --out icon.iconset/icon_16x16.png
|
||||
sips -z 32 32 ./assets/icons/app/icon1024.png --out icon.iconset/icon_16x16@2x.png
|
||||
sips -z 32 32 ./assets/icons/app/icon1024.png --out icon.iconset/icon_32x32.png
|
||||
sips -z 64 64 ./assets/icons/app/icon1024.png --out icon.iconset/icon_32x32@2x.png
|
||||
sips -z 128 128 ./assets/icons/app/icon1024.png --out icon.iconset/icon_128x128.png
|
||||
sips -z 256 256 ./assets/icons/app/icon1024.png --out icon.iconset/icon_128x128@2x.png
|
||||
sips -z 256 256 ./assets/icons/app/icon1024.png --out icon.iconset/icon_256x256.png
|
||||
sips -z 512 512 ./assets/icons/app/icon1024.png --out icon.iconset/icon_256x256@2x.png
|
||||
sips -z 512 512 ./assets/icons/app/icon1024.png --out icon.iconset/icon_512x512.png
|
||||
cp ./assets/icons/app/icon1024.png icon.iconset/icon_512x512@2x.png
|
||||
iconutil -c icns icon.iconset
|
||||
rm -R icon.iconset
|
||||
mv icon.icns ./assets/icons/app/icon.icns
|
1
receivers/electron/scripts/deploy/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from .util import *
|
259
receivers/electron/scripts/deploy/deploy.py
Normal file
|
@ -0,0 +1,259 @@
|
|||
import os
|
||||
import hashlib
|
||||
import json
|
||||
import shutil
|
||||
from functools import cmp_to_key
|
||||
from util import BUCKET_NAME, S3Client, PackageFormat, ArtifactVersion, compare_versions, generate_update_tarball
|
||||
|
||||
DEPLOY_DIR = os.environ.get('FCAST_DO_RUNNER_DEPLOY_DIR')
|
||||
TEMP_DIR = os.path.join(DEPLOY_DIR, 'temp')
|
||||
LOCAL_CACHE_DIR = os.path.join(DEPLOY_DIR, 'cache')
|
||||
BASE_DOWNLOAD_URL = BUCKET_NAME.replace('-', '.')
|
||||
EXCLUDED_DELTA_VERSIONS = ["1.0.14"]
|
||||
|
||||
# Version tracking for migration support
|
||||
RELEASES_JSON_FILE_VERSION = 1
|
||||
RELEASES_JSON_MAJOR_VERSION = '1'
|
||||
RELEASES_JSON = f'releases_v{RELEASES_JSON_MAJOR_VERSION}.json'
|
||||
|
||||
# Customizable CI parameters
|
||||
CACHE_VERSION_AMOUNT = int(os.environ.get('CACHE_VERSION_AMOUNT', default="-1"))
|
||||
|
||||
s3 = S3Client(CACHE_VERSION_AMOUNT, EXCLUDED_DELTA_VERSIONS)
|
||||
|
||||
# CI functions
|
||||
def ensure_files_exist(dirs, files):
|
||||
for d in dirs:
|
||||
os.makedirs(d, exist_ok=True)
|
||||
|
||||
for f in files:
|
||||
if not os.path.exists(os.path.join(LOCAL_CACHE_DIR, f)):
|
||||
s3.download_file(os.path.join(LOCAL_CACHE_DIR, f), f)
|
||||
|
||||
def copy_artifacts_to_local_cache():
|
||||
version = None
|
||||
with open(os.path.join(LOCAL_CACHE_DIR, 'electron', RELEASES_JSON) , 'r') as file:
|
||||
releases = json.load(file)
|
||||
version = ArtifactVersion(releases['currentVersion'], 'stable', None)
|
||||
|
||||
if len(os.listdir('/artifacts')) == 0:
|
||||
print('No artifacts were built...')
|
||||
return version
|
||||
|
||||
print('Copying artifacts to cache...')
|
||||
# Picking a random package that exists from the build pipeline
|
||||
artifact = PackageFormat(os.listdir('/artifacts/zip/linux/x64')[0])
|
||||
version = ArtifactVersion(artifact.version, artifact.channel, artifact.channel_version)
|
||||
dst = os.path.join(TEMP_DIR, version.version)
|
||||
|
||||
shutil.copytree('/artifacts', dst, dirs_exist_ok=True, ignore=shutil.ignore_patterns('*.w*'))
|
||||
for dir in os.listdir('/artifacts'):
|
||||
shutil.rmtree(os.path.join('/artifacts', dir))
|
||||
|
||||
print(f'Current app version: {version}')
|
||||
return version
|
||||
|
||||
def sync_local_cache():
|
||||
print('Syncing local cache with s3...')
|
||||
local_files = []
|
||||
for root, _, files in os.walk(LOCAL_CACHE_DIR):
|
||||
for filename in files:
|
||||
rel_path = os.path.relpath(os.path.join(root, filename), LOCAL_CACHE_DIR)
|
||||
version = os.path.relpath(rel_path, 'electron/').split('/')[0]
|
||||
|
||||
if version in s3.get_versions() or filename == RELEASES_JSON:
|
||||
local_files.append(rel_path)
|
||||
elif filename != RELEASES_JSON:
|
||||
print(f'Purging file from local cache: {rel_path}')
|
||||
os.remove(os.path.join(root, filename))
|
||||
|
||||
for obj in s3.get_bucket_files():
|
||||
filename = obj['Key']
|
||||
path = os.path.join(LOCAL_CACHE_DIR, filename)
|
||||
|
||||
if filename not in local_files:
|
||||
s3.download_file(path, filename)
|
||||
|
||||
def upload_local_cache():
|
||||
print('Uploading local cache to s3...')
|
||||
shutil.copytree(TEMP_DIR, os.path.join(LOCAL_CACHE_DIR, 'electron'), dirs_exist_ok=True)
|
||||
|
||||
local_files = []
|
||||
for root, _, files in os.walk(LOCAL_CACHE_DIR):
|
||||
for filename in files:
|
||||
full_path = os.path.join(root, filename)
|
||||
rel_path = os.path.relpath(full_path, LOCAL_CACHE_DIR)
|
||||
local_files.append(rel_path)
|
||||
|
||||
for file_path in local_files:
|
||||
if file_path not in map(lambda x: x['Key'], s3.get_bucket_files()) or os.path.basename(file_path) == RELEASES_JSON:
|
||||
s3.upload_file(os.path.join(LOCAL_CACHE_DIR, file_path), file_path)
|
||||
|
||||
# TODO: WIP
|
||||
def generate_delta_updates(artifact_version):
|
||||
delta_info = {}
|
||||
|
||||
releases = None
|
||||
with open(os.path.join(LOCAL_CACHE_DIR, 'electron', RELEASES_JSON) , 'r') as file:
|
||||
releases = json.load(file)
|
||||
|
||||
# Get sha digest from base version for integrity validation
|
||||
print('Generating sha digests from previous updates...')
|
||||
for root, _, files in os.walk(LOCAL_CACHE_DIR):
|
||||
for filename in filter(lambda f: f.endswith('.zip'), files):
|
||||
full_path = os.path.join(root, filename)
|
||||
rel_path = os.path.relpath(full_path, os.path.join(LOCAL_CACHE_DIR, 'electron'))
|
||||
package = PackageFormat(rel_path)
|
||||
|
||||
if package.channel != artifact_version.channel or package.version in EXCLUDED_DELTA_VERSIONS:
|
||||
continue
|
||||
|
||||
print(f'Generating sha digests from: {full_path}')
|
||||
artifact_name, digest = generate_update_tarball(full_path, rel_path, TEMP_DIR, package)
|
||||
print(f'Digest Info: {artifact_name} {digest}')
|
||||
|
||||
os_dict = delta_info.get(package.channel, {})
|
||||
arch_dict = os_dict.get(package.os, {})
|
||||
version_dict = arch_dict.get(package.arch, {})
|
||||
|
||||
delta_entry = {
|
||||
'path': os.path.join(TEMP_DIR, os.path.dirname(rel_path), artifact_name),
|
||||
'digest': digest,
|
||||
}
|
||||
|
||||
version_dict[package.version] = delta_entry
|
||||
arch_dict[package.arch] = version_dict
|
||||
os_dict[package.os] = arch_dict
|
||||
delta_info[package.channel] = os_dict
|
||||
|
||||
|
||||
# TODO: Add limit on amount of delta patches to create (either fixed number or by memory savings)
|
||||
# TODO: Parallelize bsdiff invocation since its single-threaded, provided enough RAM available
|
||||
print('Generating delta updates...')
|
||||
previous_versions = filter(lambda v: v not in EXCLUDED_DELTA_VERSIONS, releases['previousVersions'])
|
||||
for delta_version in previous_versions:
|
||||
# Create delta patches
|
||||
for root, _, files in os.walk(TEMP_DIR):
|
||||
for filename in filter(lambda f: f.endswith('.zip'), files):
|
||||
full_path = os.path.join(root, filename)
|
||||
rel_path = os.path.relpath(full_path, TEMP_DIR)
|
||||
package = PackageFormat(rel_path)
|
||||
|
||||
if package.version in EXCLUDED_DELTA_VERSIONS:
|
||||
continue
|
||||
|
||||
artifact_name, digest = generate_update_tarball(full_path, rel_path, TEMP_DIR, package)
|
||||
base_file = delta_info[package.channel][package.os][package.arch][delta_version]['path']
|
||||
new_file = os.path.join(os.path.dirname(full_path), artifact_name)
|
||||
delta_file = os.path.join(os.path.dirname(full_path), f'{package.name}-{package.version}-{package.os_pretty}-{package.arch}-delta-{delta_version}.delta')
|
||||
command = f'bsdiff {base_file} {new_file} {delta_file}'
|
||||
|
||||
print(f'temp skipping delta generation: {command}')
|
||||
# print(f'Generating delta update: {command}')
|
||||
# os.system(command)
|
||||
# os.remove(base_file)
|
||||
# os.remove(new_file)
|
||||
|
||||
return delta_info
|
||||
|
||||
def generate_releases_json(artifact_version, delta_info):
|
||||
print(f'Generating {RELEASES_JSON}...')
|
||||
releases = None
|
||||
with open(os.path.join(LOCAL_CACHE_DIR, 'electron', RELEASES_JSON) , 'r') as file:
|
||||
releases = json.load(file)
|
||||
|
||||
current_version = releases.get('currentVersion', '0.0.0')
|
||||
current_releases = releases.get('currentReleases', {})
|
||||
channel_current_versions = releases.get('channelCurrentVersions', {})
|
||||
|
||||
all_versions = releases.get('allVersions', [])
|
||||
if current_version not in all_versions:
|
||||
all_versions.append(current_version)
|
||||
|
||||
if compare_versions(artifact_version.version, current_version) < 0 or \
|
||||
(artifact_version.channel != 'stable' and int(artifact_version.channel_version) < int(channel_current_versions[artifact_version.channel])):
|
||||
print('Uploading older release, skipping release json generation...')
|
||||
return
|
||||
|
||||
for root, _, files in os.walk(TEMP_DIR):
|
||||
# Only offer zip and delta updates. Other packages will update from zip packages
|
||||
for filename in filter(lambda f: f.endswith('.zip') or f.endswith('.delta'), files):
|
||||
full_path = os.path.join(root, filename)
|
||||
rel_path = os.path.relpath(full_path, TEMP_DIR)
|
||||
package = PackageFormat(rel_path)
|
||||
url = f'https://{BASE_DOWNLOAD_URL}/electron/{rel_path}'
|
||||
|
||||
digest = ''
|
||||
with open(full_path, 'rb') as file:
|
||||
digest = hashlib.sha256(file.read()).hexdigest()
|
||||
|
||||
os_dict = current_releases.get(package.channel, {})
|
||||
arch_dict = os_dict.get(package.os, {})
|
||||
entry_dict = arch_dict.get(package.arch, {})
|
||||
|
||||
if package.is_delta:
|
||||
delta_dict = entry_dict.get('deltas', {})
|
||||
delta_entry = {
|
||||
'deltaUrl': url,
|
||||
'sha256Digest': digest,
|
||||
'baseVersion': package.delta_base_version,
|
||||
'baseSha256Digest': delta_info[package.channel][package.os][package.arch][package.delta_base_version]['digest'],
|
||||
}
|
||||
delta_dict[package.delta_base_version] = delta_entry
|
||||
entry_dict['deltas'] = delta_dict
|
||||
else:
|
||||
entry_dict['url'] = url
|
||||
entry_dict['sha256Digest'] = digest
|
||||
|
||||
arch_dict[package.arch] = entry_dict
|
||||
os_dict[package.os] = arch_dict
|
||||
current_releases[package.channel] = os_dict
|
||||
|
||||
if package.channel != 'stable':
|
||||
channel_current_versions[package.channel] = max(int(package.channel_version), channel_current_versions.get(package.channel, 0))
|
||||
|
||||
if artifact_version.channel == 'stable' and max([artifact_version.version, current_version], key=cmp_to_key(compare_versions)):
|
||||
releases['currentVersion'] = artifact_version.version
|
||||
else:
|
||||
releases['currentVersion'] = current_version
|
||||
|
||||
releases['previousVersions'] = s3.get_versions(full=True)
|
||||
releases['fileVersion'] = RELEASES_JSON_FILE_VERSION
|
||||
releases['allVersions'] = all_versions
|
||||
releases['channelCurrentVersions'] = channel_current_versions
|
||||
releases['currentReleases'] = current_releases
|
||||
|
||||
with open(os.path.join(LOCAL_CACHE_DIR, 'electron', RELEASES_JSON) , 'w') as file:
|
||||
json.dump(releases, file, indent=4)
|
||||
|
||||
def generate_previous_releases_page():
|
||||
pass
|
||||
|
||||
def update_website():
|
||||
pass
|
||||
|
||||
# CI Operations
|
||||
ensure_files_exist(dirs=[
|
||||
'/artifacts',
|
||||
DEPLOY_DIR,
|
||||
TEMP_DIR,
|
||||
LOCAL_CACHE_DIR,
|
||||
os.path.join(LOCAL_CACHE_DIR, 'electron')
|
||||
],
|
||||
files=[
|
||||
os.path.join('electron', RELEASES_JSON)
|
||||
])
|
||||
artifact_version = copy_artifacts_to_local_cache()
|
||||
sync_local_cache()
|
||||
|
||||
# Disabling delta update generation for now...
|
||||
# delta_info = generate_delta_updates(artifact_version)
|
||||
delta_info = {}
|
||||
|
||||
generate_releases_json(artifact_version, delta_info)
|
||||
upload_local_cache()
|
||||
# generate_previous_releases_page()
|
||||
# update_website()
|
||||
|
||||
print('Cleaning up...')
|
||||
shutil.rmtree(TEMP_DIR)
|
212
receivers/electron/scripts/deploy/util.py
Normal file
|
@ -0,0 +1,212 @@
|
|||
import boto3
|
||||
import hashlib
|
||||
import os
|
||||
import requests
|
||||
import shutil
|
||||
from botocore.client import Config
|
||||
from collections import namedtuple
|
||||
from functools import cmp_to_key
|
||||
|
||||
CLOUDFLARE_CACHE_TOKEN = os.environ.get('CLOUDFLARE_CACHE_TOKEN')
|
||||
ZONE_ID = os.environ.get('CLOUDFLARE_ZONE_ID')
|
||||
ACCOUNT_ID = os.environ.get('R2_ACCOUNT_ID')
|
||||
ACCESS_KEY_ID = os.environ.get('R2_ACCESS_KEY_ID')
|
||||
SECRET_ACCESS_KEY = os.environ.get('R2_SECRET_ACCESS_KEY')
|
||||
BUCKET_NAME = os.environ.get('R2_BUCKET_NAME')
|
||||
|
||||
EXCLUDED_BUCKET_FILES = ['electron/releases_v1.json']
|
||||
class S3Client:
|
||||
def __init__(self, cache_version_amount, excluded_delta_versions):
|
||||
# Note: Cloudflare R2 docs outdated, secret is not supposed to be hashed...
|
||||
|
||||
# Hash the secret access key using SHA-256
|
||||
#hashed_secret_key = hashlib.sha256(SECRET_ACCESS_KEY.encode()).hexdigest()
|
||||
|
||||
# Configure the S3 client for Cloudflare R2
|
||||
self.s3 = boto3.client('s3',
|
||||
endpoint_url=f'https://{ACCOUNT_ID}.r2.cloudflarestorage.com',
|
||||
aws_access_key_id=ACCESS_KEY_ID,
|
||||
# aws_secret_access_key=hashed_secret_key,
|
||||
aws_secret_access_key=SECRET_ACCESS_KEY,
|
||||
config=Config(
|
||||
signature_version='s3v4'
|
||||
)
|
||||
)
|
||||
list_response = self.s3.list_objects_v2(Bucket=BUCKET_NAME, Prefix='electron/')
|
||||
self.bucket_files = list_response.get('Contents', [])
|
||||
|
||||
bucket_files_versions = filter(lambda x: x['Key'] not in EXCLUDED_BUCKET_FILES, self.bucket_files)
|
||||
self.bucket_versions_full = sorted(set(map(lambda x: x['Key'].split('/')[1], bucket_files_versions)), key=cmp_to_key(compare_versions), reverse=True)
|
||||
self.bucket_versions = self.bucket_versions_full if cache_version_amount < 0 else self.bucket_versions_full[:cache_version_amount]
|
||||
self.bucket_delta_versions = [v for v in self.bucket_versions if v not in excluded_delta_versions]
|
||||
|
||||
def get_bucket_files(self):
|
||||
return self.bucket_files
|
||||
|
||||
def get_versions(self, full=False):
|
||||
return self.bucket_versions_full if full else self.bucket_versions
|
||||
|
||||
def download_file(self, full_path, s3_path):
|
||||
print(f'Downloading file: {s3_path}')
|
||||
get_response = self.s3.get_object(Bucket=BUCKET_NAME, Key=s3_path)
|
||||
|
||||
os.makedirs(os.path.dirname(full_path), exist_ok=True)
|
||||
with open(full_path, 'wb') as file:
|
||||
file.write(get_response['Body'].read())
|
||||
|
||||
def upload_file(self, full_path, s3_path):
|
||||
print(f'Uploading file: {s3_path}')
|
||||
|
||||
domain = BUCKET_NAME.replace('-', '.')
|
||||
purge_response = requests.post(
|
||||
f'https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/purge_cache',
|
||||
headers={
|
||||
'Authorization': f'Bearer {CLOUDFLARE_CACHE_TOKEN}',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
json={
|
||||
'files': [f'https://{domain}/{s3_path}']
|
||||
}
|
||||
)
|
||||
|
||||
if purge_response.status_code != 200:
|
||||
print(f'Error while purging cache: {purge_response}')
|
||||
|
||||
with open(full_path, 'rb') as file:
|
||||
put_response = self.s3.put_object(
|
||||
Body=file,
|
||||
Bucket=BUCKET_NAME,
|
||||
Key=s3_path,
|
||||
)
|
||||
|
||||
# Utility types
|
||||
class PackageFormat:
|
||||
"""Parses an artifact path to extract package information
|
||||
|
||||
Artifact format: ((VERSION)?/PKG/(OS/ARCH|ARCH)/)?fcast-receiver-VERSION-OS-ARCH(-setup|-delta-DELTA_BASE_VERSION)?(-CHANNEL-CHANNEL_VERSION)?.PKG
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
self.version = None
|
||||
self.type = None
|
||||
self.os = None
|
||||
self.os_pretty = None
|
||||
self.arch = None
|
||||
self.name = None
|
||||
self.is_delta = False
|
||||
self.delta_base_version = None
|
||||
self.channel = None
|
||||
self.channel_version = None
|
||||
|
||||
dirs = path.split('/')
|
||||
file = path.split('-')
|
||||
self.name = 'fcast-receiver'
|
||||
|
||||
if len(dirs) > 1:
|
||||
parse_index = 0
|
||||
|
||||
if dirs[parse_index].count('.') > 0:
|
||||
self.version = dirs[parse_index]
|
||||
self.type = dirs[parse_index + 1]
|
||||
parse_index += 2
|
||||
else:
|
||||
self.type = dirs[parse_index]
|
||||
parse_index += 1
|
||||
|
||||
if self.type == 'zip':
|
||||
self.os = dirs[parse_index]
|
||||
self.os_pretty = 'windows' if self.os == 'win32' else 'macOS' if self.os == 'darwin' else 'linux'
|
||||
self.arch = dirs[parse_index + 1]
|
||||
parse_index += 2
|
||||
else:
|
||||
if self.type == 'wix':
|
||||
self.os = 'win32'
|
||||
self.os_pretty = 'windows'
|
||||
self.arch = dirs[parse_index]
|
||||
elif self.type == 'dmg':
|
||||
self.os = 'darwin'
|
||||
self.os_pretty = 'macOS'
|
||||
self.arch = dirs[parse_index]
|
||||
elif self.type == 'deb' or self.type == 'rpm':
|
||||
self.os = 'linux'
|
||||
self.os_pretty = 'linux'
|
||||
self.arch = dirs[parse_index]
|
||||
parse_index += 1
|
||||
|
||||
# Unsupported package format (e.g. 1.0.14)
|
||||
if self.version == '1.0.14':
|
||||
return
|
||||
|
||||
file = dirs[parse_index].split('-')
|
||||
|
||||
self.version = file[2]
|
||||
channel_index = 5
|
||||
if len(file) == channel_index:
|
||||
self.channel = 'stable'
|
||||
return
|
||||
|
||||
if file[channel_index] == 'delta':
|
||||
self.is_delta = True
|
||||
self.delta_base_version = file[channel_index + 1].replace('.delta', '')
|
||||
channel_index += 2
|
||||
elif file[channel_index] == 'setup':
|
||||
channel_index += 1
|
||||
|
||||
if len(file) > channel_index:
|
||||
self.channel = file[channel_index]
|
||||
version = file[channel_index + 1]
|
||||
self.channel_version = version[:version.rfind('.')]
|
||||
else:
|
||||
self.channel = 'stable'
|
||||
|
||||
def packageNamePretty(self):
|
||||
if self.channel != 'stable':
|
||||
return f'{self.name}-{self.version}-{self.os_pretty}-{self.arch}-{self.channel}-{self.channel_version}'
|
||||
else:
|
||||
return f'{self.name}-{self.version}-{self.os_pretty}-{self.arch}'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f'''PackageFormat(type={self.type}, version={self.version}, os={self.os}, arch={self.arch},
|
||||
is_delta={self.is_delta}, delta_base_version={self.delta_base_version}, channel={self.channel},
|
||||
channel_version={self.channel_version})'''
|
||||
|
||||
ArtifactVersion = namedtuple('ArtifactVersion', ['version', 'channel', 'channel_version'])
|
||||
|
||||
# Utility functions
|
||||
def compare_versions(x, y):
|
||||
x_parts = x.split('.')
|
||||
y_parts = y.split('.')
|
||||
|
||||
for i in range(len(x_parts)):
|
||||
if x_parts[i] < y_parts[i]:
|
||||
return -1
|
||||
elif x_parts[i] > y_parts[i]:
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
def generate_update_tarball(full_path, rel_path, working_dir, package):
|
||||
if package.os == 'darwin':
|
||||
temp_working_dir = os.path.join(working_dir, os.path.dirname(rel_path), f'{package.name}-{package.os}-{package.arch}')
|
||||
extract_dir = temp_working_dir
|
||||
else:
|
||||
temp_working_dir = os.path.join(working_dir, os.path.dirname(rel_path))
|
||||
extract_dir = os.path.join(temp_working_dir, f'{package.name}-{package.os}-{package.arch}')
|
||||
|
||||
shutil.unpack_archive(full_path, temp_working_dir)
|
||||
|
||||
if package.os == 'darwin':
|
||||
shutil.make_archive(os.path.join(working_dir, os.path.dirname(rel_path), package.packageNamePretty()), 'tar', extract_dir)
|
||||
shutil.rmtree(temp_working_dir)
|
||||
|
||||
temp_working_dir = os.path.join(working_dir, os.path.dirname(rel_path))
|
||||
else:
|
||||
shutil.make_archive(os.path.join(temp_working_dir, package.packageNamePretty()), 'tar', extract_dir)
|
||||
shutil.rmtree(extract_dir)
|
||||
|
||||
digest = ''
|
||||
artifact_name = f'{package.packageNamePretty()}.tar'
|
||||
with open(os.path.join(temp_working_dir, artifact_name), 'rb') as file:
|
||||
digest = hashlib.sha256(file.read()).hexdigest()
|
||||
|
||||
return artifact_name, digest
|
|
@ -1,4 +1,4 @@
|
|||
import { app } from 'electron';
|
||||
import Main from './Main';
|
||||
|
||||
Main.main(app);
|
||||
await Main.main(app);
|
|
@ -1,9 +1,13 @@
|
|||
import mdns = require('mdns-js');
|
||||
import mdns from 'mdns-js';
|
||||
import * as log4js from "log4js";
|
||||
const cp = require('child_process');
|
||||
const os = require('os');
|
||||
const logger = log4js.getLogger();
|
||||
|
||||
export class DiscoveryService {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private serviceTcp: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private serviceWs: any;
|
||||
|
||||
private static getComputerName() {
|
||||
|
@ -12,9 +16,31 @@ export class DiscoveryService {
|
|||
return process.env.COMPUTERNAME;
|
||||
case "darwin":
|
||||
return cp.execSync("scutil --get ComputerName").toString().trim();
|
||||
case "linux":
|
||||
const prettyname = cp.execSync("hostnamectl --pretty").toString().trim();
|
||||
return prettyname === "" ? os.hostname() : prettyname;
|
||||
case "linux": {
|
||||
let hostname: string;
|
||||
|
||||
// Some distro's don't work with `os.hostname()`, but work with `hostnamectl` and vice versa...
|
||||
try {
|
||||
hostname = os.hostname();
|
||||
}
|
||||
catch (err) {
|
||||
logger.warn('Error fetching hostname, trying different method...');
|
||||
logger.warn(err);
|
||||
|
||||
try {
|
||||
hostname = cp.execSync("hostnamectl hostname").toString().trim();
|
||||
}
|
||||
catch (err2) {
|
||||
logger.warn('Error fetching hostname again, using generic name...');
|
||||
logger.warn(err2);
|
||||
|
||||
hostname = 'linux device';
|
||||
}
|
||||
}
|
||||
|
||||
return hostname;
|
||||
}
|
||||
|
||||
default:
|
||||
return os.hostname();
|
||||
}
|
||||
|
@ -26,7 +52,7 @@ export class DiscoveryService {
|
|||
}
|
||||
|
||||
const name = `FCast-${DiscoveryService.getComputerName()}`;
|
||||
console.log("Discovery service started.", name);
|
||||
logger.info("Discovery service started.", name);
|
||||
|
||||
this.serviceTcp = mdns.createAdvertisement(mdns.tcp('_fcast'), 46899, { name: name });
|
||||
this.serviceTcp.start();
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import net = require('net');
|
||||
import * as net from 'net';
|
||||
import * as log4js from "log4js";
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { PlaybackErrorMessage, PlaybackUpdateMessage, PlayMessage, SeekMessage, SetSpeedMessage, SetVolumeMessage, VersionMessage, VolumeUpdateMessage } from './Packets';
|
||||
import { WebSocket } from 'ws';
|
||||
const logger = log4js.getLogger();
|
||||
|
||||
enum SessionState {
|
||||
Idle = 0,
|
||||
|
@ -47,7 +49,7 @@ export class FCastSession {
|
|||
|
||||
send(opcode: number, message = null) {
|
||||
const json = message ? JSON.stringify(message) : null;
|
||||
console.log(`send (opcode: ${opcode}, body: ${json})`);
|
||||
logger.info(`send (opcode: ${opcode}, body: ${json})`);
|
||||
|
||||
let data: Uint8Array;
|
||||
if (json) {
|
||||
|
@ -56,7 +58,7 @@ export class FCastSession {
|
|||
} else {
|
||||
data = new Uint8Array(0);
|
||||
}
|
||||
|
||||
|
||||
const size = 1 + data.length;
|
||||
const header = Buffer.alloc(4 + 1);
|
||||
header.writeUint32LE(size, 0);
|
||||
|
@ -87,7 +89,7 @@ export class FCastSession {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log(`${receivedBytes.length} bytes received`);
|
||||
logger.info(`${receivedBytes.length} bytes received`);
|
||||
|
||||
switch (this.state) {
|
||||
case SessionState.WaitingForLength:
|
||||
|
@ -97,7 +99,7 @@ export class FCastSession {
|
|||
this.handlePacketBytes(receivedBytes);
|
||||
break;
|
||||
default:
|
||||
console.log(`Data received is unhandled in current session state ${this.state}.`);
|
||||
logger.info(`Data received is unhandled in current session state ${this.state}.`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -108,20 +110,20 @@ export class FCastSession {
|
|||
receivedBytes.copy(this.buffer, this.bytesRead, 0, bytesToRead);
|
||||
this.bytesRead += bytesToRead;
|
||||
|
||||
console.log(`handleLengthBytes: Read ${bytesToRead} bytes from packet`);
|
||||
logger.info(`handleLengthBytes: Read ${bytesToRead} bytes from packet`);
|
||||
|
||||
if (this.bytesRead >= LENGTH_BYTES) {
|
||||
this.state = SessionState.WaitingForData;
|
||||
this.packetLength = this.buffer.readUInt32LE(0);
|
||||
this.bytesRead = 0;
|
||||
console.log(`Packet length header received from: ${this.packetLength}`);
|
||||
logger.info(`Packet length header received from: ${this.packetLength}`);
|
||||
|
||||
if (this.packetLength > MAXIMUM_PACKET_LENGTH) {
|
||||
throw new Error(`Maximum packet length is 32kB: ${this.packetLength}`);
|
||||
}
|
||||
|
||||
if (bytesRemaining > 0) {
|
||||
console.log(`${bytesRemaining} remaining bytes pushed to handlePacketBytes`);
|
||||
logger.info(`${bytesRemaining} remaining bytes pushed to handlePacketBytes`);
|
||||
this.handlePacketBytes(receivedBytes.slice(bytesToRead));
|
||||
}
|
||||
}
|
||||
|
@ -133,10 +135,10 @@ export class FCastSession {
|
|||
receivedBytes.copy(this.buffer, this.bytesRead, 0, bytesToRead);
|
||||
this.bytesRead += bytesToRead;
|
||||
|
||||
console.log(`handlePacketBytes: Read ${bytesToRead} bytes from packet`);
|
||||
logger.info(`handlePacketBytes: Read ${bytesToRead} bytes from packet`);
|
||||
|
||||
if (this.bytesRead >= this.packetLength) {
|
||||
console.log(`Packet finished receiving from of ${this.packetLength} bytes.`);
|
||||
logger.info(`Packet finished receiving from of ${this.packetLength} bytes.`);
|
||||
this.handleNextPacket();
|
||||
|
||||
this.state = SessionState.WaitingForLength;
|
||||
|
@ -144,14 +146,14 @@ export class FCastSession {
|
|||
this.bytesRead = 0;
|
||||
|
||||
if (bytesRemaining > 0) {
|
||||
console.log(`${bytesRemaining} remaining bytes pushed to handleLengthBytes`);
|
||||
logger.info(`${bytesRemaining} remaining bytes pushed to handleLengthBytes`);
|
||||
this.handleLengthBytes(receivedBytes.slice(bytesToRead));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private handlePacket(opcode: number, body: string | undefined) {
|
||||
console.log(`handlePacket (opcode: ${opcode}, body: ${body})`);
|
||||
logger.info(`handlePacket (opcode: ${opcode}, body: ${body})`);
|
||||
|
||||
try {
|
||||
switch (opcode) {
|
||||
|
@ -181,16 +183,16 @@ export class FCastSession {
|
|||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`Error handling packet from.`, e);
|
||||
logger.warn(`Error handling packet from.`, e);
|
||||
}
|
||||
}
|
||||
|
||||
private handleNextPacket() {
|
||||
console.log(`Processing packet of ${this.bytesRead} bytes from`);
|
||||
logger.info(`Processing packet of ${this.bytesRead} bytes from`);
|
||||
|
||||
const opcode = this.buffer[0];
|
||||
const body = this.packetLength > 1 ? this.buffer.toString('utf8', 1, this.packetLength) : null;
|
||||
console.log('body', body);
|
||||
logger.info('body', body);
|
||||
this.handlePacket(opcode, body);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,11 +9,15 @@ import * as os from 'os';
|
|||
import * as path from 'path';
|
||||
import * as http from 'http';
|
||||
import * as url from 'url';
|
||||
import * as log4js from "log4js";
|
||||
import { AddressInfo } from 'ws';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import yargs from 'yargs';
|
||||
import { hideBin } from 'yargs/helpers';
|
||||
|
||||
export default class Main {
|
||||
static shouldOpenMainWindow = true;
|
||||
static shouldOpenMainWindow = true;
|
||||
static startFullscreen = false;
|
||||
static playerWindow: Electron.BrowserWindow;
|
||||
static mainWindow: Electron.BrowserWindow;
|
||||
static application: Electron.App;
|
||||
|
@ -26,57 +30,86 @@ export default class Main {
|
|||
static proxyServer: http.Server;
|
||||
static proxyServerAddress: AddressInfo;
|
||||
static proxiedFiles: Map<string, { url: string, headers: { [key: string]: string } }> = new Map();
|
||||
static logger: log4js.Logger;
|
||||
|
||||
private static toggleMainWindow() {
|
||||
if (Main.mainWindow) {
|
||||
Main.mainWindow.close();
|
||||
}
|
||||
else {
|
||||
Main.openMainWindow();
|
||||
}
|
||||
}
|
||||
|
||||
private static async checkForUpdates(silent: boolean) {
|
||||
if (Updater.updateDownloaded) {
|
||||
Main.mainWindow.webContents.send("download-complete");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const updateAvailable = await Updater.checkForUpdates();
|
||||
|
||||
if (updateAvailable) {
|
||||
Main.mainWindow.webContents.send("update-available");
|
||||
}
|
||||
else {
|
||||
if (!silent) {
|
||||
await dialog.showMessageBox({
|
||||
type: 'info',
|
||||
title: 'Already up-to-date',
|
||||
message: 'The application is already on the latest version.',
|
||||
buttons: ['OK'],
|
||||
defaultId: 0
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (!silent) {
|
||||
await dialog.showMessageBox({
|
||||
type: 'error',
|
||||
title: 'Failed to check for updates',
|
||||
message: err,
|
||||
buttons: ['OK'],
|
||||
defaultId: 0
|
||||
});
|
||||
}
|
||||
|
||||
Main.logger.error('Failed to check for updates:', err);
|
||||
}
|
||||
}
|
||||
|
||||
private static createTray() {
|
||||
const icon = (process.platform === 'win32') ? path.join(__dirname, 'app.ico') : path.join(__dirname, 'app.png');
|
||||
const icon = (process.platform === 'win32') ? path.join(__dirname, 'icon.ico') : path.join(__dirname, 'icon.png');
|
||||
const trayicon = nativeImage.createFromPath(icon)
|
||||
const tray = new Tray(trayicon.resize({ width: 16 }));
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: 'Open window',
|
||||
click: () => Main.openMainWindow()
|
||||
label: 'Toggle window',
|
||||
click: () => { Main.toggleMainWindow(); }
|
||||
},
|
||||
{
|
||||
label: 'Check for updates',
|
||||
click: async () => { await Main.checkForUpdates(false); },
|
||||
},
|
||||
{
|
||||
label: 'About',
|
||||
click: async () => {
|
||||
try {
|
||||
const updater = new Updater(path.join(__dirname, '../'), 'https://releases.grayjay.app/fcastreceiver');
|
||||
if (await updater.update()) {
|
||||
const restartPrompt = await dialog.showMessageBox({
|
||||
type: 'info',
|
||||
title: 'Update completed',
|
||||
message: 'The application has been updated. Restart now to apply the changes.',
|
||||
buttons: ['Restart'],
|
||||
defaultId: 0
|
||||
});
|
||||
let aboutMessage = `Version: ${Main.application.getVersion()}\nRelease channel: ${Updater.releaseChannel}\n`;
|
||||
|
||||
console.log('Update completed');
|
||||
|
||||
// Restart the app if the user clicks the 'Restart' button
|
||||
if (restartPrompt.response === 0) {
|
||||
Main.application.relaunch();
|
||||
Main.application.exit(0);
|
||||
}
|
||||
} else {
|
||||
await dialog.showMessageBox({
|
||||
type: 'info',
|
||||
title: 'Already up-to-date',
|
||||
message: 'The application is already on the latest version.',
|
||||
buttons: ['OK'],
|
||||
defaultId: 0
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
await dialog.showMessageBox({
|
||||
type: 'error',
|
||||
title: 'Failed to update',
|
||||
message: 'The application failed to update.',
|
||||
buttons: ['OK'],
|
||||
defaultId: 0
|
||||
});
|
||||
|
||||
console.error('Failed to update:', err);
|
||||
if (Updater.releaseChannel !== 'stable') {
|
||||
aboutMessage += `Release channel version: ${Updater.getChannelVersion()}\n`;
|
||||
}
|
||||
|
||||
aboutMessage += `OS: ${process.platform} ${process.arch}\n`;
|
||||
|
||||
await dialog.showMessageBox({
|
||||
type: 'info',
|
||||
title: 'Fcast Receiver',
|
||||
message: aboutMessage,
|
||||
buttons: ['OK'],
|
||||
defaultId: 0
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -86,7 +119,7 @@ export default class Main {
|
|||
label: 'Restart',
|
||||
click: () => {
|
||||
this.application.relaunch();
|
||||
this.application.exit(0);
|
||||
this.application.exit();
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -96,8 +129,14 @@ export default class Main {
|
|||
}
|
||||
}
|
||||
])
|
||||
|
||||
|
||||
tray.setContextMenu(contextMenu);
|
||||
|
||||
// Left-click opens up tray menu, unlike in Windows/Linux
|
||||
if (process.platform !== 'darwin') {
|
||||
tray.on('click', () => { Main.toggleMainWindow(); } );
|
||||
}
|
||||
|
||||
this.tray = tray;
|
||||
}
|
||||
|
||||
|
@ -106,7 +145,7 @@ export default class Main {
|
|||
|
||||
Main.discoveryService = new DiscoveryService();
|
||||
Main.discoveryService.start();
|
||||
|
||||
|
||||
Main.tcpListenerService = new TcpListenerService();
|
||||
Main.webSocketListenerService = new WebSocketListenerService();
|
||||
|
||||
|
@ -117,14 +156,17 @@ export default class Main {
|
|||
Main.playerWindow = new BrowserWindow({
|
||||
fullscreen: true,
|
||||
autoHideMenuBar: true,
|
||||
minWidth: 515,
|
||||
minHeight: 290,
|
||||
icon: path.join(__dirname, 'icon512.png'),
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'player/preload.js')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Main.playerWindow.setAlwaysOnTop(false, 'pop-up-menu');
|
||||
Main.playerWindow.show();
|
||||
|
||||
|
||||
Main.playerWindow.loadFile(path.join(__dirname, 'player/index.html'));
|
||||
Main.playerWindow.on('ready-to-show', async () => {
|
||||
Main.playerWindow?.webContents?.send("play", await Main.proxyPlayIfRequired(message));
|
||||
|
@ -134,17 +176,17 @@ export default class Main {
|
|||
});
|
||||
} else {
|
||||
Main.playerWindow?.webContents?.send("play", await Main.proxyPlayIfRequired(message));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
l.emitter.on("pause", () => Main.playerWindow?.webContents?.send("pause"));
|
||||
l.emitter.on("resume", () => Main.playerWindow?.webContents?.send("resume"));
|
||||
|
||||
|
||||
l.emitter.on("stop", () => {
|
||||
Main.playerWindow.close();
|
||||
Main.playerWindow = null;
|
||||
});
|
||||
|
||||
|
||||
l.emitter.on("seek", (message) => Main.playerWindow?.webContents?.send("seek", message));
|
||||
l.emitter.on("setvolume", (message) => Main.playerWindow?.webContents?.send("setvolume", message));
|
||||
l.emitter.on("setspeed", (message) => Main.playerWindow?.webContents?.send("setspeed", message));
|
||||
|
@ -157,10 +199,45 @@ export default class Main {
|
|||
ipcMain.on('send-playback-update', (event: IpcMainEvent, value: PlaybackUpdateMessage) => {
|
||||
l.send(Opcode.PlaybackUpdate, value);
|
||||
});
|
||||
|
||||
|
||||
ipcMain.on('send-volume-update', (event: IpcMainEvent, value: VolumeUpdateMessage) => {
|
||||
l.send(Opcode.VolumeUpdate, value);
|
||||
});
|
||||
|
||||
ipcMain.on('send-download-request', async () => {
|
||||
if (!Updater.isDownloading) {
|
||||
try {
|
||||
await Updater.downloadUpdate();
|
||||
Main.mainWindow.webContents.send("download-complete");
|
||||
} catch (err) {
|
||||
await dialog.showMessageBox({
|
||||
type: 'error',
|
||||
title: 'Failed to download update',
|
||||
message: err,
|
||||
buttons: ['OK'],
|
||||
defaultId: 0
|
||||
});
|
||||
|
||||
Main.logger.error('Failed to download update:', err);
|
||||
Main.mainWindow.webContents.send("download-failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('send-restart-request', async () => {
|
||||
Updater.restart();
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.handle('updater-progress', async () => { return Updater.updateProgress; });
|
||||
|
||||
ipcMain.handle('is-full-screen', async () => {
|
||||
const window = Main.playerWindow;
|
||||
if (!window) {
|
||||
return;
|
||||
}
|
||||
|
||||
return window.isFullScreen();
|
||||
});
|
||||
|
||||
ipcMain.on('toggle-full-screen', () => {
|
||||
|
@ -184,21 +261,35 @@ export default class Main {
|
|||
if (Main.shouldOpenMainWindow) {
|
||||
Main.openMainWindow();
|
||||
}
|
||||
|
||||
if (Updater.updateError) {
|
||||
dialog.showMessageBox({
|
||||
type: 'error',
|
||||
title: 'Error applying update',
|
||||
message: 'Please try again later or visit https://fcast.org to update.',
|
||||
buttons: ['OK'],
|
||||
defaultId: 0
|
||||
});
|
||||
}
|
||||
|
||||
if (Updater.checkForUpdatesOnStart) {
|
||||
Main.checkForUpdates(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static setupProxyServer(): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
try {
|
||||
console.log(`Proxy server starting`);
|
||||
Main.logger.info(`Proxy server starting`);
|
||||
|
||||
const port = 0;
|
||||
Main.proxyServer = http.createServer((req, res) => {
|
||||
console.log(`Request received`);
|
||||
Main.logger.info(`Request received`);
|
||||
const requestUrl = `http://${req.headers.host}${req.url}`;
|
||||
|
||||
const proxyInfo = Main.proxiedFiles.get(requestUrl);
|
||||
|
||||
|
||||
if (!proxyInfo) {
|
||||
res.writeHead(404);
|
||||
res.end('Not found');
|
||||
|
@ -215,8 +306,8 @@ export default class Main {
|
|||
'trailers',
|
||||
'transfer-encoding',
|
||||
'upgrade'
|
||||
]);
|
||||
|
||||
]);
|
||||
|
||||
const filteredHeaders = Object.fromEntries(Object.entries(req.headers)
|
||||
.filter(([key]) => !omitHeaders.has(key.toLowerCase()))
|
||||
.map(([key, value]) => [key, Array.isArray(value) ? value.join(', ') : value]));
|
||||
|
@ -232,10 +323,10 @@ export default class Main {
|
|||
res.writeHead(proxyRes.statusCode, proxyRes.headers);
|
||||
proxyRes.pipe(res, { end: true });
|
||||
});
|
||||
|
||||
|
||||
req.pipe(proxyReq, { end: true });
|
||||
proxyReq.on('error', (e) => {
|
||||
console.error(`Problem with request: ${e.message}`);
|
||||
Main.logger.error(`Problem with request: ${e.message}`);
|
||||
res.writeHead(500);
|
||||
res.end();
|
||||
});
|
||||
|
@ -245,7 +336,7 @@ export default class Main {
|
|||
});
|
||||
Main.proxyServer.listen(port, '127.0.0.1', () => {
|
||||
Main.proxyServerAddress = Main.proxyServer.address() as AddressInfo;
|
||||
console.log(`Proxy server running at http://127.0.0.1:${Main.proxyServerAddress.port}/`);
|
||||
Main.logger.info(`Proxy server running at http://127.0.0.1:${Main.proxyServerAddress.port}/`);
|
||||
resolve();
|
||||
});
|
||||
} catch (e) {
|
||||
|
@ -273,7 +364,7 @@ export default class Main {
|
|||
}
|
||||
|
||||
const proxiedUrl = `http://127.0.0.1:${Main.proxyServerAddress.port}/${uuidv4()}`;
|
||||
console.log("Proxied url", { proxiedUrl, url, headers });
|
||||
Main.logger.info("Proxied url", { proxiedUrl, url, headers });
|
||||
Main.proxiedFiles.set(proxiedUrl, { url: url, headers: headers });
|
||||
return proxiedUrl;
|
||||
}
|
||||
|
@ -281,18 +372,18 @@ export default class Main {
|
|||
static getAllIPv4Addresses() {
|
||||
const interfaces = os.networkInterfaces();
|
||||
const ipv4Addresses: string[] = [];
|
||||
|
||||
|
||||
for (const interfaceName in interfaces) {
|
||||
const addresses = interfaces[interfaceName];
|
||||
if (!addresses) continue;
|
||||
|
||||
|
||||
for (const addressInfo of addresses) {
|
||||
if (addressInfo.family === 'IPv4' && !addressInfo.internal) {
|
||||
ipv4Addresses.push(addressInfo.address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ipv4Addresses;
|
||||
}
|
||||
|
||||
|
@ -303,10 +394,11 @@ export default class Main {
|
|||
}
|
||||
|
||||
Main.mainWindow = new BrowserWindow({
|
||||
fullscreen: true,
|
||||
fullscreen: Main.startFullscreen,
|
||||
autoHideMenuBar: true,
|
||||
minWidth: 500,
|
||||
minHeight: 920,
|
||||
icon: path.join(__dirname, 'icon512.png'),
|
||||
minWidth: 1100,
|
||||
minHeight: 800,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'main/preload.js')
|
||||
}
|
||||
|
@ -317,21 +409,58 @@ export default class Main {
|
|||
Main.mainWindow = null;
|
||||
});
|
||||
|
||||
Main.mainWindow.maximize();
|
||||
Main.mainWindow.show();
|
||||
|
||||
Main.mainWindow.on('ready-to-show', () => {
|
||||
Main.mainWindow.webContents.send("device-info", {name: os.hostname(), addresses: Main.getAllIPv4Addresses()});
|
||||
});
|
||||
}
|
||||
|
||||
static main(app: Electron.App) {
|
||||
Main.application = app;
|
||||
const argv = process.argv;
|
||||
if (argv.includes('--no-main-window')) {
|
||||
Main.shouldOpenMainWindow = false;
|
||||
}
|
||||
|
||||
Main.application.on('ready', Main.onReady);
|
||||
Main.application.on('window-all-closed', () => { });
|
||||
}
|
||||
}
|
||||
|
||||
static async main(app: Electron.App) {
|
||||
try {
|
||||
Main.application = app;
|
||||
|
||||
const argv = yargs(hideBin(process.argv))
|
||||
.version(app.getVersion())
|
||||
.parserConfiguration({
|
||||
'boolean-negation': false
|
||||
})
|
||||
.options({
|
||||
'no-main-window': { type: 'boolean', default: false, desc: "Start minimized to tray" },
|
||||
'fullscreen': { type: 'boolean', default: false, desc: "Start application in fullscreen" }
|
||||
})
|
||||
.parseSync();
|
||||
|
||||
const isUpdating = Updater.isUpdating();
|
||||
const fileLogType = isUpdating ? 'fileSync' : 'file';
|
||||
log4js.configure({
|
||||
appenders: {
|
||||
out: { type: 'stdout' },
|
||||
log: { type: fileLogType, filename: path.join(app.getPath('logs'), 'fcast-receiver.log'), flags: 'a', maxLogSize: '5M' },
|
||||
},
|
||||
categories: {
|
||||
default: { appenders: ['out', 'log'], level: 'info' },
|
||||
},
|
||||
});
|
||||
Main.logger = log4js.getLogger();
|
||||
Main.logger.info(`Starting application: ${app.name} | ${app.getAppPath()}`);
|
||||
Main.logger.info(`Version: ${app.getVersion()}`);
|
||||
Main.logger.info(`Release channel: ${Updater.releaseChannel} - ${Updater.getChannelVersion()}`);
|
||||
Main.logger.info(`OS: ${process.platform} ${process.arch}`);
|
||||
|
||||
if (isUpdating) {
|
||||
await Updater.processUpdate();
|
||||
}
|
||||
|
||||
Main.startFullscreen = argv.fullscreen;
|
||||
Main.shouldOpenMainWindow = !argv.noMainWindow;
|
||||
Main.application.on('ready', Main.onReady);
|
||||
Main.application.on('window-all-closed', () => { });
|
||||
}
|
||||
catch (err) {
|
||||
Main.logger.error(`Error starting application: ${err}`);
|
||||
app.exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
35
receivers/electron/src/Store.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import storage from 'electron-json-storage';
|
||||
import { app } from 'electron';
|
||||
import * as log4js from "log4js";
|
||||
const logger = log4js.getLogger();
|
||||
|
||||
export class Store {
|
||||
private static storeVersion = 1;
|
||||
private static userSettings = 'UserSettings';
|
||||
private static settingsCache: any = null;
|
||||
|
||||
static {
|
||||
storage.setDataPath(app.getPath('userData'));
|
||||
Store.settingsCache = storage.getSync(Store.userSettings);
|
||||
|
||||
if (Store.get('storeVersion') === null) {
|
||||
Store.set('storeVersion', Store.storeVersion);
|
||||
}
|
||||
}
|
||||
|
||||
public static get(key: string): any {
|
||||
return Store.settingsCache[key] ?? null;
|
||||
}
|
||||
|
||||
public static set(key: string, value: any) {
|
||||
Store.settingsCache[key] = value;
|
||||
|
||||
logger.info(`Writing settings file: key '${key}', value ${JSON.stringify(value)}`);
|
||||
storage.set(Store.userSettings, Store.settingsCache, (err) => {
|
||||
if (err) {
|
||||
logger.error(`Error writing user settings: ${err}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import net = require('net');
|
||||
import * as net from 'net';
|
||||
import { FCastSession, Opcode } from './FCastSession';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { dialog } from 'electron';
|
||||
|
@ -8,7 +8,7 @@ export class TcpListenerService {
|
|||
public static PORT = 46899;
|
||||
|
||||
emitter = new EventEmitter();
|
||||
|
||||
|
||||
private server: net.Server;
|
||||
private sessions: FCastSession[] = [];
|
||||
|
||||
|
@ -39,14 +39,14 @@ export class TcpListenerService {
|
|||
try {
|
||||
session.send(opcode, message);
|
||||
} catch (e) {
|
||||
console.warn("Failed to send error.", e);
|
||||
Main.logger.warn("Failed to send error.", e);
|
||||
session.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async handleServerError(err: NodeJS.ErrnoException) {
|
||||
console.error("Server error:", err);
|
||||
Main.logger.error("Server error:", err);
|
||||
|
||||
const restartPrompt = await dialog.showMessageBox({
|
||||
type: 'error',
|
||||
|
@ -56,7 +56,7 @@ export class TcpListenerService {
|
|||
defaultId: 0,
|
||||
cancelId: 1
|
||||
});
|
||||
|
||||
|
||||
if (restartPrompt.response === 0) {
|
||||
Main.application.relaunch();
|
||||
Main.application.exit(0);
|
||||
|
@ -66,14 +66,14 @@ export class TcpListenerService {
|
|||
}
|
||||
|
||||
private handleConnection(socket: net.Socket) {
|
||||
console.log(`new connection from ${socket.remoteAddress}:${socket.remotePort}`);
|
||||
Main.logger.info(`new connection from ${socket.remoteAddress}:${socket.remotePort}`);
|
||||
|
||||
const session = new FCastSession(socket, (data) => socket.write(data));
|
||||
session.bindEvents(this.emitter);
|
||||
this.sessions.push(session);
|
||||
|
||||
socket.on("error", (err) => {
|
||||
console.warn(`Error from ${socket.remoteAddress}:${socket.remotePort}.`, err);
|
||||
Main.logger.warn(`Error from ${socket.remoteAddress}:${socket.remotePort}.`, err);
|
||||
socket.destroy();
|
||||
});
|
||||
|
||||
|
@ -81,7 +81,7 @@ export class TcpListenerService {
|
|||
try {
|
||||
session.processBytes(buffer);
|
||||
} catch (e) {
|
||||
console.warn(`Error while handling packet from ${socket.remoteAddress}:${socket.remotePort}.`, e);
|
||||
Main.logger.warn(`Error while handling packet from ${socket.remoteAddress}:${socket.remotePort}.`, e);
|
||||
socket.end();
|
||||
}
|
||||
});
|
||||
|
@ -89,15 +89,15 @@ export class TcpListenerService {
|
|||
socket.on("close", () => {
|
||||
const index = this.sessions.indexOf(session);
|
||||
if (index != -1) {
|
||||
this.sessions.splice(index, 1);
|
||||
this.sessions.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
console.log('Sending version');
|
||||
Main.logger.info('Sending version');
|
||||
session.send(Opcode.Version, {version: 2});
|
||||
} catch (e) {
|
||||
console.log('Failed to send version');
|
||||
Main.logger.info('Failed to send version', e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,41 +1,89 @@
|
|||
import * as fs from 'fs';
|
||||
import * as https from 'https';
|
||||
import * as path from 'path';
|
||||
import { URL } from 'url';
|
||||
import * as crypto from 'crypto';
|
||||
import * as log4js from "log4js";
|
||||
import { app } from 'electron';
|
||||
import { Store } from './Store';
|
||||
import sudo from 'sudo-prompt';
|
||||
const cp = require('child_process');
|
||||
const extract = require('extract-zip');
|
||||
const logger = log4js.getLogger();
|
||||
|
||||
enum UpdateState {
|
||||
Copy = 'copy',
|
||||
Cleanup = 'cleanup',
|
||||
Error = 'error',
|
||||
};
|
||||
|
||||
interface ReleaseInfo {
|
||||
previousVersions: [string];
|
||||
currentVersion: string;
|
||||
currentReleases: [
|
||||
string: [ // channel
|
||||
string: [ // os
|
||||
string: [ // arch
|
||||
string: []
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
channelCurrentVersions: [string: number];
|
||||
allVersions: [string];
|
||||
fileVersion: string;
|
||||
}
|
||||
|
||||
interface UpdateInfo {
|
||||
updateState: UpdateState;
|
||||
installPath: string;
|
||||
tempPath: string;
|
||||
currentVersion: string;
|
||||
downloadFile: string;
|
||||
error?: string
|
||||
}
|
||||
|
||||
export class Updater {
|
||||
private basePath: string;
|
||||
private baseUrl: string;
|
||||
private appFiles: string[];
|
||||
private static readonly supportedReleasesJsonVersion = '1';
|
||||
|
||||
constructor(basePath: string, baseUrl: string) {
|
||||
this.basePath = basePath;
|
||||
this.baseUrl = baseUrl;
|
||||
this.appFiles = [
|
||||
'dist/main/c.mp4',
|
||||
'dist/main/index.html',
|
||||
'dist/main/preload.js',
|
||||
'dist/main/qrcode.min.js',
|
||||
'dist/main/renderer.js',
|
||||
'dist/main/style.css',
|
||||
'dist/main/video-js.min.css',
|
||||
'dist/main/video.min.js',
|
||||
private static appPath: string = app.getAppPath();
|
||||
private static installPath: string = process.platform === 'darwin' ? path.join(Updater.appPath, '../../../') : path.join(Updater.appPath, '../../');
|
||||
private static updateDataPath: string = path.join(app.getPath('userData'), 'updater');
|
||||
private static updateMetadataPath = path.join(Updater.updateDataPath, './update.json');
|
||||
private static baseUrl: string = 'https://dl.fcast.org/electron';
|
||||
private static isRestarting: boolean = false;
|
||||
|
||||
'dist/player/index.html',
|
||||
'dist/player/preload.js',
|
||||
'dist/player/renderer.js',
|
||||
'dist/player/style.css',
|
||||
'dist/player/video-js.min.css',
|
||||
'dist/player/video.min.js',
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static localPackageJson: any = null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static releasesJson: any = null;
|
||||
|
||||
'dist/app.ico',
|
||||
'dist/app.png',
|
||||
'dist/bundle.js',
|
||||
'package.json'
|
||||
];
|
||||
public static isDownloading: boolean = false;
|
||||
public static updateError: boolean = false;
|
||||
public static updateDownloaded: boolean = false;
|
||||
public static updateProgress: number = 0;
|
||||
public static checkForUpdatesOnStart: boolean = true;
|
||||
public static releaseChannel = 'stable';
|
||||
|
||||
static {
|
||||
Updater.localPackageJson = JSON.parse(fs.readFileSync(path.join(Updater.appPath, './package.json'), 'utf8'));
|
||||
|
||||
let updaterSettings = Store.get('updater');
|
||||
if (updaterSettings !== null) {
|
||||
Updater.localPackageJson.channel = updaterSettings.channel === undefined ? Updater.localPackageJson.channel : updaterSettings.channel;
|
||||
Updater.checkForUpdatesOnStart = updaterSettings.checkForUpdatesOnStart === undefined ? true : updaterSettings.checkForUpdatesOnStart;
|
||||
}
|
||||
|
||||
updaterSettings = {
|
||||
'channel': Updater.localPackageJson.channel,
|
||||
'checkForUpdatesOnStart': Updater.checkForUpdatesOnStart,
|
||||
}
|
||||
|
||||
Updater.releaseChannel = Updater.localPackageJson.channel;
|
||||
Store.set('updater', updaterSettings);
|
||||
}
|
||||
|
||||
private async fetchJSON(url: string): Promise<any> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static async fetchJSON(url: string): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
https.get(url, (res) => {
|
||||
let data = '';
|
||||
|
@ -56,11 +104,19 @@ export class Updater {
|
|||
});
|
||||
}
|
||||
|
||||
private async downloadFile(url: string, destination: string): Promise<void> {
|
||||
private static async downloadFile(url: string, destination: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const file = fs.createWriteStream(destination);
|
||||
https.get(url, (response) => {
|
||||
const downloadSize = Number(response.headers['content-length']);
|
||||
logger.info(`Update size: ${downloadSize} bytes`);
|
||||
response.pipe(file);
|
||||
let downloadedBytes = 0;
|
||||
|
||||
response.on('data', (chunk) => {
|
||||
downloadedBytes += chunk.length;
|
||||
Updater.updateProgress = downloadedBytes / downloadSize;
|
||||
});
|
||||
file.on('finish', () => {
|
||||
file.close();
|
||||
resolve();
|
||||
|
@ -72,40 +128,266 @@ export class Updater {
|
|||
});
|
||||
}
|
||||
|
||||
private compareVersions(v1: string, v2: string): number {
|
||||
const v1Parts = v1.split('.').map(Number);
|
||||
const v2Parts = v2.split('.').map(Number);
|
||||
private static async applyUpdate(src: string, dst: string) {
|
||||
try {
|
||||
fs.accessSync(dst, fs.constants.F_OK | fs.constants.R_OK | fs.constants.W_OK | fs.constants.X_OK);
|
||||
|
||||
for (let i = 0; i < v1Parts.length; i++) {
|
||||
if (v1Parts[i] > v2Parts[i]) {
|
||||
return 1;
|
||||
} else if (v1Parts[i] < v2Parts[i]) {
|
||||
return -1;
|
||||
// Electron runtime sees .asar file as directory and causes errors during copy/remove operations
|
||||
process.noAsar = true
|
||||
if (process.platform === 'win32') {
|
||||
// Cannot remove top-level directory since it might still be locked...
|
||||
fs.rmSync(`${dst}\\*`, { maxRetries: 5, retryDelay: 1000, recursive: true, force: true });
|
||||
}
|
||||
else {
|
||||
fs.rmSync(dst, { maxRetries: 5, retryDelay: 1000, recursive: true, force: true });
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
// Electron framework libraries break otherwise on Mac
|
||||
fs.cpSync(src, dst, { recursive: true, force: true, verbatimSymlinks: true });
|
||||
}
|
||||
else {
|
||||
fs.cpSync(src, dst, { recursive: true, force: true });
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
if (err.code === 'EACCES' || err.code === 'EPERM') {
|
||||
logger.info('Update requires admin privileges. Escalating...');
|
||||
|
||||
return 0;
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
let command: string;
|
||||
if (process.platform === 'win32') {
|
||||
// Using native cmd.exe seems to create less issues than using powershell...
|
||||
command = `rmdir /S /Q "${dst}" & xcopy /Y /E "${src}" "${dst}"`;
|
||||
}
|
||||
else {
|
||||
command = `rm -rf '${dst}'; cp -rf '${src}' '${dst}'; chmod 755 '${dst}'`;
|
||||
}
|
||||
|
||||
sudo.exec(command, { name: 'FCast Receiver' }, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
logger.error(error);
|
||||
logger.warn(`stdout: ${stdout}`);
|
||||
logger.warn(`stderr: ${stderr}`);
|
||||
reject('User did not authorize the operation...');
|
||||
}
|
||||
|
||||
logger.info('stdout', stdout);
|
||||
logger.info('stderr', stderr);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
logger.error(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
process.noAsar = false;
|
||||
}
|
||||
}
|
||||
|
||||
public async update(): Promise<Boolean> {
|
||||
console.log("Updater invoked", { baseUrl: this.baseUrl, basePath: this.basePath });
|
||||
// Cannot use app.relaunch(...) since it breaks privilege escalation on Linux...
|
||||
// Also does not work very well on Mac...
|
||||
private static relaunch(binPath: string) {
|
||||
logger.info(`Relaunching app binary: ${binPath}`);
|
||||
log4js.shutdown();
|
||||
|
||||
const localPackage = JSON.parse(fs.readFileSync(path.join(this.basePath, './package.json'), 'utf-8'));
|
||||
const remotePackage = await this.fetchJSON(`${this.baseUrl}/package.json`.toString());
|
||||
let proc;
|
||||
if (process.platform === 'win32') {
|
||||
// cwd is bugged on Windows, perhaps due to needing to be in system32 to launch cmd.exe
|
||||
proc = cp.spawn(`"${binPath}"`, [], { stdio: 'ignore', shell: true, detached: true, windowsHide: true });
|
||||
}
|
||||
else if (process.platform === 'darwin') {
|
||||
proc = cp.spawn(`open '${binPath}'`, [], { cwd: path.dirname(binPath), shell: true, stdio: 'ignore', detached: true });
|
||||
}
|
||||
else {
|
||||
proc = cp.spawn(binPath, [], { cwd: path.dirname(binPath), shell: true, stdio: 'ignore', detached: true });
|
||||
}
|
||||
|
||||
console.log('Update check', { localVersion: localPackage.version, remoteVersion: remotePackage.version });
|
||||
if (this.compareVersions(remotePackage.version, localPackage.version) === 1) {
|
||||
for (const file of this.appFiles) {
|
||||
const fileUrl = `${this.baseUrl}/${file}`;
|
||||
const destination = path.join(this.basePath, file);
|
||||
proc.unref();
|
||||
app.exit();
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Downloading '${fileUrl}' to '${destination}'.`);
|
||||
await this.downloadFile(fileUrl.toString(), destination);
|
||||
public static restart() {
|
||||
if (!Updater.isRestarting) {
|
||||
Updater.isRestarting = true;
|
||||
const updateInfo: UpdateInfo = JSON.parse(fs.readFileSync(Updater.updateMetadataPath, 'utf8'));
|
||||
const extractionDir = process.platform === 'darwin' ? 'FCast Receiver.app' : `fcast-receiver-${process.platform}-${process.arch}`;
|
||||
const binaryName = process.platform === 'win32' ? 'fcast-receiver.exe' : 'fcast-receiver';
|
||||
const updateBinPath = process.platform === 'darwin' ? path.join(updateInfo.tempPath, extractionDir) : path.join(updateInfo.tempPath, extractionDir, binaryName);
|
||||
|
||||
Updater.relaunch(updateBinPath);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public static isUpdating(): boolean {
|
||||
try {
|
||||
const updateInfo: UpdateInfo = JSON.parse(fs.readFileSync(Updater.updateMetadataPath, 'utf8'));
|
||||
Updater.updateError = true;
|
||||
return updateInfo.updateState !== 'error';
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static getChannelVersion(): string {
|
||||
Updater.localPackageJson.channelVersion = Updater.localPackageJson.channelVersion ? Updater.localPackageJson.channelVersion : 0
|
||||
return Updater.localPackageJson.channelVersion;
|
||||
}
|
||||
|
||||
public static async processUpdate(): Promise<void> {
|
||||
try {
|
||||
const updateInfo: UpdateInfo = JSON.parse(fs.readFileSync(Updater.updateMetadataPath, 'utf8'));
|
||||
const extractionDir = process.platform === 'darwin' ? 'FCast Receiver.app' : `fcast-receiver-${process.platform}-${process.arch}`;
|
||||
const binaryName = process.platform === 'win32' ? 'fcast-receiver.exe' : 'fcast-receiver';
|
||||
const installBinPath = process.platform === 'darwin' ? updateInfo.installPath : path.join(updateInfo.installPath, binaryName);
|
||||
|
||||
switch (updateInfo.updateState) {
|
||||
case UpdateState.Copy: {
|
||||
try {
|
||||
logger.info('Updater process started...');
|
||||
const src = path.join(updateInfo.tempPath, extractionDir);
|
||||
logger.info(`Copying files from update directory ${src} to install directory ${updateInfo.installPath}`);
|
||||
|
||||
await Updater.applyUpdate(src, updateInfo.installPath);
|
||||
updateInfo.updateState = UpdateState.Cleanup;
|
||||
fs.writeFileSync(Updater.updateMetadataPath, JSON.stringify(updateInfo));
|
||||
}
|
||||
catch (err) {
|
||||
logger.error('Error while applying update...');
|
||||
logger.error(err);
|
||||
|
||||
updateInfo.updateState = UpdateState.Error;
|
||||
updateInfo.error = JSON.stringify(err);
|
||||
fs.writeFileSync(Updater.updateMetadataPath, JSON.stringify(updateInfo));
|
||||
}
|
||||
|
||||
Updater.relaunch(installBinPath);
|
||||
return;
|
||||
}
|
||||
|
||||
case UpdateState.Cleanup: {
|
||||
try {
|
||||
logger.info('Performing update cleanup...')
|
||||
// Electron runtime sees .asar file as directory and causes errors during copy
|
||||
process.noAsar = true
|
||||
logger.info(`rm dir ${path.join(Updater.updateDataPath, extractionDir)}`)
|
||||
fs.rmSync(path.join(Updater.updateDataPath, extractionDir), { recursive: true, force: true });
|
||||
process.noAsar = false
|
||||
|
||||
fs.rmSync(path.join(Updater.updateDataPath, updateInfo.downloadFile));
|
||||
fs.rmSync(Updater.updateMetadataPath);
|
||||
|
||||
// Removing the install directory causes an 'ENOENT: no such file or directory, uv_cwd' when calling process.cwd()
|
||||
// Need to fix the working directory to the update directory that overwritten the install directory
|
||||
process.chdir(Updater.installPath);
|
||||
}
|
||||
catch (err) {
|
||||
logger.error('Error while performing update cleanup...');
|
||||
logger.error(err);
|
||||
|
||||
updateInfo.updateState = UpdateState.Error;
|
||||
updateInfo.error = JSON.stringify(err);
|
||||
fs.writeFileSync(Updater.updateMetadataPath, JSON.stringify(updateInfo));
|
||||
}
|
||||
|
||||
Updater.relaunch(installBinPath);
|
||||
return;
|
||||
}
|
||||
|
||||
case UpdateState.Error:
|
||||
logger.warn(`Update operation did not complete successfully: ${updateInfo.error}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
logger.warn(`Error reading update metadata file, ignoring pending update: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
public static async checkForUpdates(): Promise<boolean> {
|
||||
logger.info('Checking for updates...');
|
||||
|
||||
try {
|
||||
Updater.releasesJson = await Updater.fetchJSON(`${Updater.baseUrl}/releases_v${Updater.supportedReleasesJsonVersion}.json`.toString()) as ReleaseInfo;
|
||||
|
||||
const localChannelVersion: number = Updater.localPackageJson.channelVersion ? Updater.localPackageJson.channelVersion : 0;
|
||||
const currentChannelVersion: number = Updater.releasesJson.channelCurrentVersions[Updater.localPackageJson.channel] ? Updater.releasesJson.channelCurrentVersions[Updater.localPackageJson.channel] : 0;
|
||||
logger.info('Update check', { channel: Updater.localPackageJson.channel, channel_version: localChannelVersion, localVersion: Updater.localPackageJson.version,
|
||||
currentVersion: Updater.releasesJson.currentVersion, currentChannelVersion: currentChannelVersion });
|
||||
|
||||
if (Updater.localPackageJson.version !== Updater.releasesJson.currentVersion || (Updater.localPackageJson.channel !== 'stable' && localChannelVersion < currentChannelVersion)) {
|
||||
logger.info('Update available...');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
logger.error(`Failed to check for updates: ${err}`);
|
||||
throw 'Please try again later or visit https://fcast.org for updates.';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static async downloadUpdate(): Promise<boolean> {
|
||||
try {
|
||||
fs.accessSync(Updater.updateDataPath, fs.constants.F_OK);
|
||||
}
|
||||
catch (err) {
|
||||
logger.info(`Directory does not exist: ${err}`);
|
||||
fs.mkdirSync(Updater.updateDataPath);
|
||||
}
|
||||
|
||||
try {
|
||||
const channel = Updater.localPackageJson.version !== Updater.releasesJson.currentVersion ? 'stable' : Updater.localPackageJson.channel;
|
||||
const fileInfo = Updater.releasesJson.currentReleases[channel][process.platform][process.arch]
|
||||
const file = fileInfo.url.toString().split('/').pop();
|
||||
|
||||
const destination = path.join(Updater.updateDataPath, file);
|
||||
logger.info(`Downloading '${fileInfo.url}' to '${destination}'.`);
|
||||
Updater.isDownloading = true;
|
||||
await Updater.downloadFile(fileInfo.url.toString(), destination);
|
||||
|
||||
const downloadedFile = await fs.promises.readFile(destination);
|
||||
const hash = crypto.createHash('sha256').end(downloadedFile).digest('hex');
|
||||
if (fileInfo.sha256Digest !== hash) {
|
||||
const message = 'Update failed integrity check. Please try again later or visit https://fcast.org to for updates.';
|
||||
logger.error(`Update failed integrity check. Expected hash: ${fileInfo.sha256Digest}, actual hash: ${hash}`);
|
||||
throw message;
|
||||
}
|
||||
|
||||
// Electron runtime sees .asar file as directory and causes errors during extraction
|
||||
logger.info('Extracting update...');
|
||||
process.noAsar = true;
|
||||
await extract(destination, { dir: path.dirname(destination) });
|
||||
process.noAsar = false;
|
||||
|
||||
logger.info('Extraction complete.');
|
||||
const updateInfo: UpdateInfo = {
|
||||
updateState: UpdateState.Copy,
|
||||
installPath: Updater.installPath,
|
||||
tempPath: path.dirname(destination),
|
||||
currentVersion: Updater.releasesJson.currentVersion,
|
||||
downloadFile: file,
|
||||
};
|
||||
|
||||
fs.writeFileSync(Updater.updateMetadataPath, JSON.stringify(updateInfo));
|
||||
logger.info('Written update metadata.');
|
||||
Updater.isDownloading = false;
|
||||
Updater.updateDownloaded = true;
|
||||
return true;
|
||||
}
|
||||
catch (err) {
|
||||
Updater.isDownloading = false;
|
||||
process.noAsar = false;
|
||||
logger.error(`Failed to download update: ${err}`);
|
||||
throw 'Failed to download update. Please try again later or visit https://fcast.org to download.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ export class WebSocketListenerService {
|
|||
public static PORT = 46898;
|
||||
|
||||
emitter = new EventEmitter();
|
||||
|
||||
|
||||
private server: WebSocketServer;
|
||||
private sessions: FCastSession[] = [];
|
||||
|
||||
|
@ -38,14 +38,14 @@ export class WebSocketListenerService {
|
|||
try {
|
||||
session.send(opcode, message);
|
||||
} catch (e) {
|
||||
console.warn("Failed to send error.", e);
|
||||
Main.logger.warn("Failed to send error.", e);
|
||||
session.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async handleServerError(err: NodeJS.ErrnoException) {
|
||||
console.error("Server error:", err);
|
||||
Main.logger.error("Server error:", err);
|
||||
|
||||
const restartPrompt = await dialog.showMessageBox({
|
||||
type: 'error',
|
||||
|
@ -55,7 +55,7 @@ export class WebSocketListenerService {
|
|||
defaultId: 0,
|
||||
cancelId: 1
|
||||
});
|
||||
|
||||
|
||||
if (restartPrompt.response === 0) {
|
||||
Main.application.relaunch();
|
||||
Main.application.exit(0);
|
||||
|
@ -65,14 +65,14 @@ export class WebSocketListenerService {
|
|||
}
|
||||
|
||||
private handleConnection(socket: WebSocket) {
|
||||
console.log('New WebSocket connection');
|
||||
Main.logger.info('New WebSocket connection');
|
||||
|
||||
const session = new FCastSession(socket, (data) => socket.send(data));
|
||||
session.bindEvents(this.emitter);
|
||||
this.sessions.push(session);
|
||||
|
||||
socket.on("error", (err) => {
|
||||
console.warn(`Error.`, err);
|
||||
Main.logger.warn(`Error.`, err);
|
||||
session.close();
|
||||
});
|
||||
|
||||
|
@ -81,28 +81,28 @@ export class WebSocketListenerService {
|
|||
if (data instanceof Buffer) {
|
||||
session.processBytes(data);
|
||||
} else {
|
||||
console.warn("Received unhandled string message", data);
|
||||
Main.logger.warn("Received unhandled string message", data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`Error while handling packet.`, e);
|
||||
Main.logger.warn(`Error while handling packet.`, e);
|
||||
session.close();
|
||||
}
|
||||
});
|
||||
|
||||
socket.on("close", () => {
|
||||
console.log('WebSocket connection closed');
|
||||
Main.logger.info('WebSocket connection closed');
|
||||
|
||||
const index = this.sessions.indexOf(session);
|
||||
if (index != -1) {
|
||||
this.sessions.splice(index, 1);
|
||||
this.sessions.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
console.log('Sending version');
|
||||
Main.logger.info('Sending version');
|
||||
session.send(Opcode.Version, {version: 2});
|
||||
} catch (e) {
|
||||
console.log('Failed to send version');
|
||||
Main.logger.info('Failed to send version');
|
||||
}
|
||||
}
|
||||
}
|
17
receivers/electron/src/main/Preload.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
|
||||
let deviceInfo;
|
||||
ipcRenderer.on("device-info", (_event, value) => {
|
||||
deviceInfo = value;
|
||||
})
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
updaterProgress: () => ipcRenderer.invoke('updater-progress'),
|
||||
onDeviceInfo: (callback) => ipcRenderer.on("device-info", callback),
|
||||
onUpdateAvailable: (callback) => ipcRenderer.on("update-available", callback),
|
||||
sendDownloadRequest: () => ipcRenderer.send('send-download-request'),
|
||||
onDownloadComplete: (callback) => ipcRenderer.on("download-complete", callback),
|
||||
onDownloadFailed: (callback) => ipcRenderer.on("download-failed", callback),
|
||||
sendRestartRequest: () => ipcRenderer.send('send-restart-request'),
|
||||
getDeviceInfo: () => deviceInfo,
|
||||
});
|
111
receivers/electron/src/main/Renderer.ts
Normal file
|
@ -0,0 +1,111 @@
|
|||
import QRCode from 'qrcode';
|
||||
|
||||
const updateView = document.getElementById("update-view");
|
||||
const updateViewTitle = document.getElementById("update-view-title");
|
||||
const updateText = document.getElementById("update-text");
|
||||
const updateButton = document.getElementById("update-button");
|
||||
const restartButton = document.getElementById("restart-button");
|
||||
const updateLaterButton = document.getElementById("update-later-button");
|
||||
const progressBar = document.getElementById("progress-bar");
|
||||
const progressBarProgress = document.getElementById("progress-bar-progress");
|
||||
|
||||
let updaterProgressUIUpdateTimer = null;
|
||||
window.electronAPI.onDeviceInfo(renderIPsAndQRCode);
|
||||
|
||||
if(window.electronAPI.getDeviceInfo()) {
|
||||
console.log("device info already present");
|
||||
renderIPsAndQRCode();
|
||||
}
|
||||
|
||||
function renderIPsAndQRCode() {
|
||||
const value = window.electronAPI.getDeviceInfo();
|
||||
console.log("device info", value);
|
||||
|
||||
const ipsElement = document.getElementById('ips');
|
||||
if (ipsElement) {
|
||||
ipsElement.innerHTML = `IPs<br>${value.addresses.join('<br>')}`;
|
||||
}
|
||||
|
||||
const fcastConfig = {
|
||||
name: value.name,
|
||||
addresses: value.addresses,
|
||||
services: [
|
||||
{ port: 46899, type: 0 }, //TCP
|
||||
{ port: 46898, type: 1 }, //WS
|
||||
]
|
||||
};
|
||||
|
||||
const json = JSON.stringify(fcastConfig);
|
||||
let base64 = btoa(json);
|
||||
base64 = base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
||||
const url = `fcast://r/${base64}`;
|
||||
console.log("qr", {json, url, base64});
|
||||
|
||||
const qrCodeElement = document.getElementById('qr-code');
|
||||
QRCode.toCanvas(qrCodeElement, url, {
|
||||
margin: 0,
|
||||
width: 256,
|
||||
color: {
|
||||
dark : "#000000",
|
||||
light : "#ffffff",
|
||||
},
|
||||
errorCorrectionLevel : "M",
|
||||
},
|
||||
(e) => {
|
||||
console.log(`Error rendering QR Code: ${e}`)
|
||||
});
|
||||
}
|
||||
|
||||
window.electronAPI.onUpdateAvailable(() => {
|
||||
console.log(`Received UpdateAvailable event`);
|
||||
updateViewTitle.textContent = 'FCast update available';
|
||||
|
||||
updateText.textContent = 'Do you wish to update now?';
|
||||
updateButton.setAttribute("style", "display: block");
|
||||
updateLaterButton.setAttribute("style", "display: block");
|
||||
restartButton.setAttribute("style", "display: none");
|
||||
progressBar.setAttribute("style", "display: none");
|
||||
updateView.setAttribute("style", "display: flex");
|
||||
});
|
||||
|
||||
window.electronAPI.onDownloadComplete(() => {
|
||||
console.log(`Received DownloadComplete event`);
|
||||
window.clearTimeout(updaterProgressUIUpdateTimer);
|
||||
updateViewTitle.textContent = 'FCast update ready';
|
||||
|
||||
updateText.textContent = 'Restart now to apply the changes?';
|
||||
updateButton.setAttribute("style", "display: none");
|
||||
progressBar.setAttribute("style", "display: none");
|
||||
restartButton.setAttribute("style", "display: block");
|
||||
updateLaterButton.setAttribute("style", "display: block");
|
||||
updateView.setAttribute("style", "display: flex");
|
||||
});
|
||||
|
||||
window.electronAPI.onDownloadFailed(() => {
|
||||
console.log(`Received DownloadFailed event`);
|
||||
window.clearTimeout(updaterProgressUIUpdateTimer);
|
||||
updateView.setAttribute("style", "display: none");
|
||||
});
|
||||
|
||||
updateLaterButton.onclick = () => { updateView.setAttribute("style", "display: none"); };
|
||||
updateButton.onclick = () => {
|
||||
updaterProgressUIUpdateTimer = window.setInterval( async () => {
|
||||
const updateProgress = await window.electronAPI.updaterProgress();
|
||||
|
||||
if (updateProgress >= 1.0) {
|
||||
updateText.textContent = "Preparing update...";
|
||||
progressBarProgress.setAttribute("style", `width: 100%`);
|
||||
}
|
||||
else {
|
||||
progressBarProgress.setAttribute("style", `width: ${Math.max(12, updateProgress * 100)}%`);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
updateText.textContent = 'Downloading...';
|
||||
updateButton.setAttribute("style", "display: none");
|
||||
updateLaterButton.setAttribute("style", "display: none");
|
||||
progressBarProgress.setAttribute("style", "width: 12%");
|
||||
progressBar.setAttribute("style", "display: block");
|
||||
window.electronAPI.sendDownloadRequest();
|
||||
};
|
||||
restartButton.onclick = () => { window.electronAPI.sendRestartRequest(); };
|
|
@ -2,45 +2,61 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link href="./video-js.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../../assets/fonts/outfit.css" />
|
||||
<link rel="stylesheet" href="../../assets/fonts/inter.css" />
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
<title>FCast Receiver</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main-container">
|
||||
<video id="video-player" class="video-js" controls preload="auto" data-setup='{}' style="object-fit: cover;">
|
||||
<p class="vjs-no-js">
|
||||
To view this video please enable JavaScript, and consider upgrading to a web browser that
|
||||
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
|
||||
</p>
|
||||
<video id="video-player" class="video" autoplay loop>
|
||||
<source src="../../assets/video/background.mp4" type="video/mp4">
|
||||
</video>
|
||||
<div id="overlay">
|
||||
<div id="title">FCast</div>
|
||||
<div id="connection-info">
|
||||
<div id="waiting-for-connection">Waiting for a connection</div>
|
||||
<div id="spinner" class="lds-ring"><div></div><div></div><div></div><div></div></div>
|
||||
<div id="manual-connection-info">Manual connection information</div>
|
||||
<div>
|
||||
<div id="ips">IPs</div><br />
|
||||
<div>Port<br>46899 (TCP), 46898 (WS)</div>
|
||||
</div>
|
||||
<div id="automatic-discovery">Automatic discovery is available via mDNS</div>
|
||||
<div id="qr-code"></div>
|
||||
<div id="scan-to-connect" style="font-weight: bold;">Scan to connect</div>
|
||||
</div>
|
||||
<!--<div id="update-dialog">There is an update available. Do you wish to update?</div>
|
||||
<div id="update-button">Update</div>
|
||||
<div id="progress-container">
|
||||
<div id="update-spinner" class="lds-ring"><div></div><div></div><div></div><div></div></div>
|
||||
<div id="progress-text"></div>
|
||||
</div>-->
|
||||
<div id="ui-container">
|
||||
<div id="overlay">
|
||||
<div id="main-view" >
|
||||
<div id="title-container">
|
||||
<div id="title-icon"></div>
|
||||
<div id="title-text" class="non-selectable">FCast</div>
|
||||
</div>
|
||||
|
||||
<div id="window-can-be-closed" style="color: #666666; position: absolute; bottom: 0; margin-bottom: 20px;">App will continue to run as tray app when the window is closed</div>
|
||||
<div id="connection-status">
|
||||
<div id="waiting-for-connection" class="non-selectable">Waiting for a connection</div>
|
||||
<div id="spinner" class="lds-ring"><div></div><div></div><div></div><div></div></div>
|
||||
</div>
|
||||
|
||||
<div id="update-view" class="card">
|
||||
<div id="update-view-title" class="non-selectable card-title">FCast update available</div>
|
||||
<div class="card-title-separator"></div>
|
||||
|
||||
<div id="update-text">Do you wish to update now?</div>
|
||||
<div id="update-button-container">
|
||||
<div id="update-button" class="button button-primary">Update</div>
|
||||
<div id="restart-button" class="button button-primary">Restart</div>
|
||||
<div id="update-later-button" class="button button-secondary">Later</div>
|
||||
</div>
|
||||
|
||||
<div id="progress-bar">
|
||||
<div id="progress-bar-progress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="detail-view" class="card">
|
||||
<div class="non-selectable card-title">Manual connection information</div>
|
||||
<div class="card-title-separator"></div>
|
||||
<div>
|
||||
<div id="ips">IPs</div><br />
|
||||
<div>Port<br>46899 (TCP), 46898 (WS)</div>
|
||||
</div>
|
||||
<div id="automatic-discovery" class="non-selectable">Automatic discovery is available via mDNS</div>
|
||||
<canvas id="qr-code"></canvas>
|
||||
<div id="scan-to-connect" class="non-selectable">Scan to connect</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="window-can-be-closed" class="non-selectable">App will continue to run as tray app when the window is closed</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>window.HELP_IMPROVE_VIDEOJS = false;</script>
|
||||
<script src="./video.min.js"></script>
|
||||
<script src="./qrcode.min.js"></script>
|
||||
<script src="./renderer.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
let deviceInfo;
|
||||
ipcRenderer.on("device-info", (_event, value) => {
|
||||
deviceInfo = value;
|
||||
})
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
onDeviceInfo: (callback) => ipcRenderer.on("device-info", callback),
|
||||
getDeviceInfo: () => deviceInfo,
|
||||
});
|
1
receivers/electron/src/main/qrcode.min.js
vendored
|
@ -1,53 +0,0 @@
|
|||
const options = {
|
||||
textTrackSettings: false,
|
||||
autoplay: true,
|
||||
loop: true,
|
||||
controls: false
|
||||
};
|
||||
|
||||
const player = videojs("video-player", options, function onPlayerReady() {
|
||||
player.src({ type: "video/mp4", src: "./c.mp4" });
|
||||
});
|
||||
|
||||
|
||||
window.electronAPI.onDeviceInfo(renderIPsAndQRCode);
|
||||
|
||||
if(window.electronAPI.getDeviceInfo()) {
|
||||
console.log("device info already present");
|
||||
renderIPsAndQRCode();
|
||||
}
|
||||
|
||||
function renderIPsAndQRCode() {
|
||||
const value = window.electronAPI.getDeviceInfo();
|
||||
console.log("device info", value);
|
||||
|
||||
const ipsElement = document.getElementById('ips');
|
||||
if (ipsElement) {
|
||||
ipsElement.innerHTML = `IPs<br>${value.addresses.join('<br>')}`;
|
||||
}
|
||||
|
||||
const fcastConfig = {
|
||||
name: value.name,
|
||||
addresses: value.addresses,
|
||||
services: [
|
||||
{ port: 46899, type: 0 }, //TCP
|
||||
{ port: 46898, type: 1 }, //WS
|
||||
]
|
||||
};
|
||||
|
||||
const json = JSON.stringify(fcastConfig);
|
||||
let base64 = btoa(json);
|
||||
base64 = base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
||||
const url = `fcast://r/${base64}`;
|
||||
console.log("qr", {json, url, base64});
|
||||
|
||||
const qrCodeElement = document.getElementById('qr-code');
|
||||
new QRCode(qrCodeElement, {
|
||||
text: url,
|
||||
width: 256,
|
||||
height: 256,
|
||||
colorDark : "#000000",
|
||||
colorLight : "#ffffff",
|
||||
correctLevel : QRCode.CorrectLevel.M
|
||||
});
|
||||
}
|
|
@ -6,11 +6,88 @@ body, html {
|
|||
#main-container {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.video-js {
|
||||
.video {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.non-selectable {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
|
||||
background-color: rgba(20, 20, 20, 0.5);
|
||||
padding: 25px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #2E2E2E;
|
||||
scrollbar-width: thin;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-weight: 700;
|
||||
line-height: 24px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.card-title-separator {
|
||||
height: 1px;
|
||||
background: #2E2E2E;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16px;
|
||||
gap: 6px;
|
||||
flex: 1 0 0;
|
||||
border-radius: 6px;
|
||||
|
||||
margin: 20px 10px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
background: #008BD7;
|
||||
}
|
||||
|
||||
.button-primary:hover {
|
||||
background: #0D9DDF;
|
||||
}
|
||||
|
||||
.button-primary:active {
|
||||
background: #0069AA;
|
||||
}
|
||||
|
||||
.button-secondary {
|
||||
background: #3E3E3E;
|
||||
}
|
||||
|
||||
.button-secondary:hover {
|
||||
background: #555555;
|
||||
}
|
||||
|
||||
.button-secondary:active {
|
||||
background: #3E3E3E;
|
||||
}
|
||||
|
||||
#ui-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#overlay {
|
||||
|
@ -20,57 +97,145 @@ body, html {
|
|||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
font-family: 'Inter', sans-serif;
|
||||
gap: 15vw;
|
||||
|
||||
font-family: InterVariable;
|
||||
font-size: 20px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#title {
|
||||
font-size: 40px;
|
||||
#title-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#title-text {
|
||||
font-family: Outfit;
|
||||
font-size: 96px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
|
||||
background-image: linear-gradient(180deg, #FFFFFF 5.9%, #D3D3D3 100%);
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
#connection-info {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
#title-icon {
|
||||
width: 84px;
|
||||
height: 84px;
|
||||
|
||||
background-image: url(../../assets/icons/app/icon.svg);
|
||||
background-size: cover;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#connection-status {
|
||||
padding: 25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#main-view {
|
||||
padding: 25px;
|
||||
}
|
||||
|
||||
#manual-connection-info {
|
||||
font-weight: 700;
|
||||
line-height: 24px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
#manual-connection-info-separator {
|
||||
height: 1px;
|
||||
background: #2E2E2E;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
#qr-code {
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
margin: 20px auto;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#update-dialog, #waiting-for-connection, #ips, #automatic-discovery, #scan-to-connect {
|
||||
#scan-to-connect {
|
||||
margin-top: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#waiting-for-connection, #ips, #automatic-discovery {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#update-text {
|
||||
margin-top: 20px;
|
||||
width: 320px;
|
||||
}
|
||||
|
||||
#update-view {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#restart-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#spinner {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
#update-button {
|
||||
background: blue;
|
||||
padding: 10px 28px;
|
||||
margin-top: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#progress-container {
|
||||
#update-button-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 8px;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
#progress-text {
|
||||
margin-left: 8px;
|
||||
#progress-bar {
|
||||
display: none;
|
||||
|
||||
width: 320px;
|
||||
height: 40px;
|
||||
margin-top: 20px;
|
||||
border-radius: 50px;
|
||||
border: 1px solid #4E4E4E;
|
||||
background: linear-gradient(rgba(20, 20, 20, 0.5), rgba(80, 80, 80, 0.5));
|
||||
/* background-size: cover; */
|
||||
}
|
||||
|
||||
#progress-bar-progress {
|
||||
width: 12%;
|
||||
height: 40px;
|
||||
border-radius: 50px;
|
||||
background-image: linear-gradient(to bottom, #008BD7 35%, #0069AA);
|
||||
transition: width .6s ease;
|
||||
}
|
||||
|
||||
@keyframes progress-bar-stripes {
|
||||
from {
|
||||
background-position: 1rem 0;
|
||||
}
|
||||
to {
|
||||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
#window-can-be-closed {
|
||||
color: #666666;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
margin-bottom: 20px;
|
||||
|
||||
font-family: InterVariable;
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.lds-ring {
|
||||
|
|
1
receivers/electron/src/main/video-js.min.css
vendored
26
receivers/electron/src/main/video.min.js
vendored
235
receivers/electron/src/player/Player.ts
Normal file
|
@ -0,0 +1,235 @@
|
|||
import dashjs from 'dashjs';
|
||||
import Hls from 'hls.js';
|
||||
|
||||
export enum PlayerType {
|
||||
Html,
|
||||
Dash,
|
||||
Hls,
|
||||
}
|
||||
|
||||
export class Player {
|
||||
private player: dashjs.MediaPlayerClass | HTMLVideoElement
|
||||
private hlsPlayer: Hls | undefined
|
||||
public playerType: PlayerType
|
||||
|
||||
constructor(playerType: PlayerType, player: dashjs.MediaPlayerClass | HTMLVideoElement, hlsPlayer?: Hls) {
|
||||
this.playerType = playerType;
|
||||
this.player = player;
|
||||
this.hlsPlayer = playerType === PlayerType.Hls ? hlsPlayer : null;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
switch (this.playerType) {
|
||||
case PlayerType.Dash:
|
||||
try {
|
||||
(this.player as dashjs.MediaPlayerClass).destroy();
|
||||
} catch (e) {
|
||||
console.warn("Failed to destroy dash player", e);
|
||||
}
|
||||
this.player = null;
|
||||
this.playerType = null;
|
||||
break;
|
||||
|
||||
case PlayerType.Hls:
|
||||
// HLS also uses html player
|
||||
try {
|
||||
this.hlsPlayer.destroy();
|
||||
} catch (e) {
|
||||
console.warn("Failed to destroy hls player", e);
|
||||
}
|
||||
// fall through
|
||||
|
||||
case PlayerType.Html: {
|
||||
const videoPlayer = this.player as HTMLVideoElement;
|
||||
|
||||
videoPlayer.src = "";
|
||||
// videoPlayer.onerror = null;
|
||||
videoPlayer.onloadedmetadata = null;
|
||||
videoPlayer.ontimeupdate = null;
|
||||
videoPlayer.onplay = null;
|
||||
videoPlayer.onpause = null;
|
||||
videoPlayer.onended = null;
|
||||
videoPlayer.ontimeupdate = null;
|
||||
videoPlayer.onratechange = null;
|
||||
videoPlayer.onvolumechange = null;
|
||||
|
||||
this.player = null;
|
||||
this.playerType = null;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
play() { console.log("Player: play"); this.player.play(); }
|
||||
|
||||
isPaused(): boolean {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
return (this.player as dashjs.MediaPlayerClass).isPaused();
|
||||
} else { // HLS, HTML
|
||||
return (this.player as HTMLVideoElement).paused;
|
||||
}
|
||||
}
|
||||
pause() { console.log("Player: pause"); this.player.pause(); }
|
||||
|
||||
getVolume(): number {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
return (this.player as dashjs.MediaPlayerClass).getVolume();
|
||||
} else { // HLS, HTML
|
||||
return (this.player as HTMLVideoElement).volume;
|
||||
}
|
||||
}
|
||||
setVolume(value: number) {
|
||||
console.log(`Player: setVolume ${value}`);
|
||||
const sanitizedVolume = Math.min(1.0, Math.max(0.0, value));
|
||||
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
(this.player as dashjs.MediaPlayerClass).setVolume(sanitizedVolume);
|
||||
} else { // HLS, HTML
|
||||
(this.player as HTMLVideoElement).volume = sanitizedVolume;
|
||||
}
|
||||
}
|
||||
|
||||
isMuted(): boolean {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
return (this.player as dashjs.MediaPlayerClass).isMuted();
|
||||
} else { // HLS, HTML
|
||||
return (this.player as HTMLVideoElement).muted;
|
||||
}
|
||||
}
|
||||
setMute(value: boolean) {
|
||||
console.log(`Player: setMute ${value}`);
|
||||
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
(this.player as dashjs.MediaPlayerClass).setMute(value);
|
||||
} else { // HLS, HTML
|
||||
(this.player as HTMLVideoElement).muted = value;
|
||||
}
|
||||
}
|
||||
|
||||
getPlaybackRate(): number {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
return (this.player as dashjs.MediaPlayerClass).getPlaybackRate();
|
||||
} else { // HLS, HTML
|
||||
return (this.player as HTMLVideoElement).playbackRate;
|
||||
}
|
||||
}
|
||||
setPlaybackRate(value: number) {
|
||||
console.log(`Player: setPlaybackRate ${value}`);
|
||||
const sanitizedSpeed = Math.min(16.0, Math.max(0.0, value));
|
||||
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
(this.player as dashjs.MediaPlayerClass).setPlaybackRate(sanitizedSpeed);
|
||||
} else { // HLS, HTML
|
||||
(this.player as HTMLVideoElement).playbackRate = sanitizedSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
getDuration(): number {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
const videoPlayer = this.player as dashjs.MediaPlayerClass;
|
||||
return isFinite(videoPlayer.duration()) ? videoPlayer.duration() : 0;
|
||||
} else { // HLS, HTML
|
||||
const videoPlayer = this.player as HTMLVideoElement;
|
||||
return isFinite(videoPlayer.duration) ? videoPlayer.duration : 0;
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentTime(): number {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
return (this.player as dashjs.MediaPlayerClass).time();
|
||||
} else { // HLS, HTML
|
||||
return (this.player as HTMLVideoElement).currentTime;
|
||||
}
|
||||
}
|
||||
setCurrentTime(value: number) {
|
||||
// console.log(`Player: setCurrentTime ${value}`);
|
||||
const sanitizedTime = Math.min(this.getDuration(), Math.max(0.0, value));
|
||||
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
(this.player as dashjs.MediaPlayerClass).seek(sanitizedTime);
|
||||
const videoPlayer = this.player as dashjs.MediaPlayerClass;
|
||||
|
||||
if (!videoPlayer.isSeeking()) {
|
||||
videoPlayer.seek(sanitizedTime);
|
||||
}
|
||||
|
||||
} else { // HLS, HTML
|
||||
(this.player as HTMLVideoElement).currentTime = sanitizedTime;
|
||||
}
|
||||
}
|
||||
|
||||
getSource(): string {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
const videoPlayer = this.player as dashjs.MediaPlayerClass;
|
||||
return videoPlayer.getSource() instanceof String ? videoPlayer.getSource() as string : JSON.stringify(videoPlayer.getSource());
|
||||
} else { // HLS, HTML
|
||||
return (this.player as HTMLVideoElement).src;
|
||||
}
|
||||
}
|
||||
|
||||
getBufferLength(): number {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
const dashPlayer = this.player as dashjs.MediaPlayerClass;
|
||||
|
||||
let dashBufferLength = dashPlayer.getBufferLength("video")
|
||||
?? dashPlayer.getBufferLength("audio")
|
||||
?? dashPlayer.getBufferLength("text")
|
||||
?? dashPlayer.getBufferLength("image")
|
||||
?? 0;
|
||||
if (Number.isNaN(dashBufferLength))
|
||||
dashBufferLength = 0;
|
||||
|
||||
dashBufferLength += dashPlayer.time();
|
||||
return dashBufferLength;
|
||||
} else { // HLS, HTML
|
||||
const videoPlayer = this.player as HTMLVideoElement;
|
||||
let maxBuffer = 0;
|
||||
|
||||
if (videoPlayer.buffered) {
|
||||
for (let i = 0; i < videoPlayer.buffered.length; i++) {
|
||||
const start = videoPlayer.buffered.start(i);
|
||||
const end = videoPlayer.buffered.end(i);
|
||||
|
||||
if (videoPlayer.currentTime >= start && videoPlayer.currentTime <= end) {
|
||||
maxBuffer = end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return maxBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
isCaptionsSupported(): boolean {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
return (this.player as dashjs.MediaPlayerClass).getTracksFor('text').length > 0;
|
||||
} else if (this.playerType === PlayerType.Hls) {
|
||||
return this.hlsPlayer.allSubtitleTracks.length > 0;
|
||||
} else {
|
||||
return false; // HTML captions not currently supported
|
||||
}
|
||||
}
|
||||
|
||||
isCaptionsEnabled(): boolean {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
return (this.player as dashjs.MediaPlayerClass).isTextEnabled();
|
||||
} else if (this.playerType === PlayerType.Hls) {
|
||||
return this.hlsPlayer.subtitleDisplay;
|
||||
} else {
|
||||
return false; // HTML captions not currently supported
|
||||
}
|
||||
}
|
||||
|
||||
enableCaptions(enable: boolean) {
|
||||
if (this.playerType === PlayerType.Dash) {
|
||||
(this.player as dashjs.MediaPlayerClass).enableText(enable);
|
||||
} else if (this.playerType === PlayerType.Hls) {
|
||||
this.hlsPlayer.subtitleDisplay = enable;
|
||||
}
|
||||
// HTML captions not currently supported
|
||||
}
|
||||
|
||||
}
|
24
receivers/electron/src/player/Preload.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
import { PlaybackErrorMessage, PlaybackUpdateMessage, VolumeUpdateMessage } from '../Packets';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
electronAPI: any;
|
||||
}
|
||||
}
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
isFullScreen: () => ipcRenderer.invoke('is-full-screen'),
|
||||
toggleFullScreen: () => ipcRenderer.send('toggle-full-screen'),
|
||||
exitFullScreen: () => ipcRenderer.send('exit-full-screen'),
|
||||
sendPlaybackError: (error: PlaybackErrorMessage) => ipcRenderer.send('send-playback-error', error),
|
||||
sendPlaybackUpdate: (update: PlaybackUpdateMessage) => ipcRenderer.send('send-playback-update', update),
|
||||
sendVolumeUpdate: (update: VolumeUpdateMessage) => ipcRenderer.send('send-volume-update', update),
|
||||
onPlay: (callback: any) => ipcRenderer.on("play", callback),
|
||||
onPause: (callback: any) => ipcRenderer.on("pause", callback),
|
||||
onResume: (callback: any) => ipcRenderer.on("resume", callback),
|
||||
onSeek: (callback: any) => ipcRenderer.on("seek", callback),
|
||||
onSetVolume: (callback: any) => ipcRenderer.on("setvolume", callback),
|
||||
onSetSpeed: (callback: any) => ipcRenderer.on("setspeed", callback)
|
||||
});
|
731
receivers/electron/src/player/Renderer.ts
Normal file
|
@ -0,0 +1,731 @@
|
|||
import dashjs from 'dashjs';
|
||||
import Hls, { LevelLoadedData } from 'hls.js';
|
||||
import { PlaybackUpdateMessage, PlayMessage, SeekMessage, SetSpeedMessage, SetVolumeMessage } from '../Packets';
|
||||
import { Player, PlayerType } from './Player';
|
||||
|
||||
function formatDuration(duration: number) {
|
||||
const totalSeconds = Math.floor(duration);
|
||||
const hours = Math.floor(totalSeconds / 3600);
|
||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||
const seconds = Math.floor(totalSeconds % 60);
|
||||
|
||||
const paddedMinutes = String(minutes).padStart(2, '0');
|
||||
const paddedSeconds = String(seconds).padStart(2, '0');
|
||||
|
||||
if (hours > 0) {
|
||||
return `${hours}:${paddedMinutes}:${paddedSeconds}`;
|
||||
} else {
|
||||
return `${paddedMinutes}:${paddedSeconds}`;
|
||||
}
|
||||
}
|
||||
|
||||
function sendPlaybackUpdate(updateState: number) {
|
||||
const updateMessage = new PlaybackUpdateMessage(Date.now(), player.getCurrentTime(), player.getDuration(), updateState, player.getPlaybackRate());
|
||||
|
||||
if (updateMessage.generationTime > lastPlayerUpdateGenerationTime) {
|
||||
lastPlayerUpdateGenerationTime = updateMessage.generationTime;
|
||||
window.electronAPI.sendPlaybackUpdate(updateMessage);
|
||||
}
|
||||
};
|
||||
|
||||
function onPlayerLoad(value: PlayMessage, currentPlaybackRate?: number, currentVolume?: number) {
|
||||
playerCtrlStateUpdate(PlayerControlEvent.Load);
|
||||
|
||||
// Subtitles break when seeking post stream initialization for the DASH player.
|
||||
// Its currently done on player initialization.
|
||||
if (player.playerType === PlayerType.Hls || player.playerType === PlayerType.Html) {
|
||||
if (value.time) {
|
||||
player.setCurrentTime(value.time);
|
||||
}
|
||||
}
|
||||
|
||||
if (value.speed) {
|
||||
player.setPlaybackRate(value.speed);
|
||||
} else if (currentPlaybackRate) {
|
||||
player.setPlaybackRate(currentPlaybackRate);
|
||||
} else {
|
||||
player.setPlaybackRate(1.0);
|
||||
}
|
||||
playerCtrlStateUpdate(PlayerControlEvent.SetPlaybackRate);
|
||||
|
||||
if (currentVolume) {
|
||||
volumeChangeHandler(currentVolume);
|
||||
}
|
||||
else {
|
||||
// FCast PlayMessage does not contain volume field and could result in the receiver
|
||||
// getting out-of-sync with the sender on 1st playback.
|
||||
volumeChangeHandler(1.0);
|
||||
window.electronAPI.sendVolumeUpdate({ generationTime: Date.now(), volume: 1.0 });
|
||||
}
|
||||
|
||||
player.play();
|
||||
}
|
||||
|
||||
// HTML elements
|
||||
const videoElement = document.getElementById("videoPlayer") as HTMLVideoElement;
|
||||
const videoCaptions = document.getElementById("videoCaptions") as HTMLDivElement;
|
||||
|
||||
const playerControls = document.getElementById("controls");
|
||||
|
||||
const playerCtrlAction = document.getElementById("action");
|
||||
const playerCtrlVolume = document.getElementById("volume");
|
||||
|
||||
const playerCtrlProgressBar = document.getElementById("progressBar");
|
||||
const playerCtrlProgressBarBuffer = document.getElementById("progressBarBuffer");
|
||||
const playerCtrlProgressBarProgress = document.getElementById("progressBarProgress");
|
||||
const playerCtrlProgressBarPosition = document.getElementById("progressBarPosition");
|
||||
const playerCtrlProgressBarHandle = document.getElementById("progressBarHandle");
|
||||
const PlayerCtrlProgressBarInteractiveArea = document.getElementById("progressBarInteractiveArea");
|
||||
|
||||
const playerCtrlVolumeBar = document.getElementById("volumeBar");
|
||||
const playerCtrlVolumeBarProgress = document.getElementById("volumeBarProgress");
|
||||
const playerCtrlVolumeBarHandle = document.getElementById("volumeBarHandle");
|
||||
const playerCtrlVolumeBarInteractiveArea = document.getElementById("volumeBarInteractiveArea");
|
||||
|
||||
const playerCtrlLiveBadge = document.getElementById("liveBadge");
|
||||
const playerCtrlPosition = document.getElementById("position");
|
||||
const playerCtrlDuration = document.getElementById("duration");
|
||||
|
||||
const playerCtrlCaptions = document.getElementById("captions");
|
||||
const playerCtrlSpeed = document.getElementById("speed");
|
||||
const playerCtrlFullscreen = document.getElementById("fullscreen");
|
||||
|
||||
const playerCtrlSpeedMenu = document.getElementById("speedMenu");
|
||||
let playerCtrlSpeedMenuShown = false;
|
||||
|
||||
|
||||
const playbackRates = ["0.25", "0.50", "0.75", "1.00", "1.25", "1.50", "1.75", "2.00"];
|
||||
const playbackUpdateInterval = 1.0;
|
||||
const livePositionDelta = 5.0;
|
||||
const livePositionWindow = livePositionDelta * 4;
|
||||
let player: Player;
|
||||
let playerPrevTime: number = 0;
|
||||
let lastPlayerUpdateGenerationTime = 0;
|
||||
let isLive = false;
|
||||
let isLivePosition = false;
|
||||
|
||||
|
||||
window.electronAPI.onPlay((_event, value: PlayMessage) => {
|
||||
console.log("Handle play message renderer", JSON.stringify(value));
|
||||
const currentVolume = player ? player.getVolume() : null;
|
||||
const currentPlaybackRate = player ? player.getPlaybackRate() : null;
|
||||
|
||||
playerPrevTime = 0;
|
||||
lastPlayerUpdateGenerationTime = 0;
|
||||
isLive = false;
|
||||
isLivePosition = false;
|
||||
|
||||
if (player) {
|
||||
if (player.getSource() === value.url) {
|
||||
if (value.time) {
|
||||
if (Math.abs(value.time - player.getCurrentTime()) < 5000) {
|
||||
console.warn(`Skipped changing video URL because URL and time is (nearly) unchanged: ${value.url}, ${player.getSource()}, ${formatDuration(value.time)}, ${formatDuration(player.getCurrentTime())}`);
|
||||
} else {
|
||||
console.info(`Skipped changing video URL because URL is the same, but time was changed, seeking instead: ${value.url}, ${player.getSource()}, ${formatDuration(value.time)}, ${formatDuration(player.getCurrentTime())}`);
|
||||
|
||||
player.setCurrentTime(value.time);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
player.destroy();
|
||||
}
|
||||
|
||||
if ((value.url || value.content) && value.container && videoElement) {
|
||||
if (value.container === 'application/dash+xml') {
|
||||
console.log("Loading dash player");
|
||||
const dashPlayer = dashjs.MediaPlayer().create();
|
||||
player = new Player(PlayerType.Dash, dashPlayer);
|
||||
|
||||
dashPlayer.extend("RequestModifier", () => {
|
||||
return {
|
||||
modifyRequestHeader: function (xhr) {
|
||||
if (value.headers) {
|
||||
for (const [key, val] of Object.entries(value.headers)) {
|
||||
xhr.setRequestHeader(key, val);
|
||||
}
|
||||
}
|
||||
|
||||
return xhr;
|
||||
}
|
||||
};
|
||||
}, true);
|
||||
|
||||
// Player event handlers
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_PLAYING, () => { sendPlaybackUpdate(1); playerCtrlStateUpdate(PlayerControlEvent.Play); });
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_PAUSED, () => { sendPlaybackUpdate(2); playerCtrlStateUpdate(PlayerControlEvent.Pause); });
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_ENDED, () => { sendPlaybackUpdate(0) });
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_TIME_UPDATED, () => {
|
||||
playerCtrlStateUpdate(PlayerControlEvent.TimeUpdate);
|
||||
|
||||
if (Math.abs(dashPlayer.time() - playerPrevTime) >= playbackUpdateInterval) {
|
||||
sendPlaybackUpdate(dashPlayer.isPaused() ? 2 : 1);
|
||||
playerPrevTime = dashPlayer.time();
|
||||
}
|
||||
});
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_RATE_CHANGED, () => { sendPlaybackUpdate(dashPlayer.isPaused() ? 2 : 1) });
|
||||
|
||||
// Buffering UI update when paused
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_PROGRESS, () => { playerCtrlStateUpdate(PlayerControlEvent.TimeUpdate); });
|
||||
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_VOLUME_CHANGED, () => {
|
||||
const updateVolume = dashPlayer.isMuted() ? 0 : dashPlayer.getVolume();
|
||||
playerCtrlStateUpdate(PlayerControlEvent.VolumeChange);
|
||||
window.electronAPI.sendVolumeUpdate({ generationTime: Date.now(), volume: updateVolume });
|
||||
});
|
||||
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.ERROR, (data) => { window.electronAPI.sendPlaybackError({
|
||||
message: `DashJS ERROR: ${JSON.stringify(data)}`
|
||||
})});
|
||||
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.PLAYBACK_ERROR, (data) => { window.electronAPI.sendPlaybackError({
|
||||
message: `DashJS PLAYBACK_ERROR: ${JSON.stringify(data)}`
|
||||
})});
|
||||
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED, () => { onPlayerLoad(value, currentPlaybackRate, currentVolume); });
|
||||
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.CUE_ENTER, (e: any) => {
|
||||
// console.log("cueEnter", e);
|
||||
const subtitle = document.createElement("p")
|
||||
subtitle.setAttribute("id", "subtitle-" + e.cueID)
|
||||
|
||||
subtitle.textContent = e.text;
|
||||
videoCaptions.appendChild(subtitle);
|
||||
});
|
||||
|
||||
dashPlayer.on(dashjs.MediaPlayer.events.CUE_EXIT, (e: any) => {
|
||||
// console.log("cueExit ", e);
|
||||
document.getElementById("subtitle-" + e.cueID).remove();
|
||||
});
|
||||
|
||||
dashPlayer.updateSettings({
|
||||
streaming: {
|
||||
text: {
|
||||
dispatchForManualRendering: true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (value.content) {
|
||||
dashPlayer.initialize(videoElement, `data:${value.container};base64,` + window.btoa(value.content), true, value.time);
|
||||
// dashPlayer.initialize(videoElement, "https://dash.akamaized.net/akamai/test/caption_test/ElephantsDream/elephants_dream_480p_heaac5_1_https.mpd", true);
|
||||
} else {
|
||||
dashPlayer.initialize(videoElement, value.url, true, value.time);
|
||||
}
|
||||
|
||||
} else if ((value.container === 'application/vnd.apple.mpegurl' || value.container === 'application/x-mpegURL') && !videoElement.canPlayType(value.container)) {
|
||||
console.log("Loading hls player");
|
||||
|
||||
const config = {
|
||||
xhrSetup: function (xhr: XMLHttpRequest) {
|
||||
if (value.headers) {
|
||||
for (const [key, val] of Object.entries(value.headers)) {
|
||||
xhr.setRequestHeader(key, val);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const hlsPlayer = new Hls(config);
|
||||
|
||||
hlsPlayer.on(Hls.Events.ERROR, (eventName, data) => {
|
||||
window.electronAPI.sendPlaybackError({
|
||||
message: `HLS player error: ${JSON.stringify(data)}`
|
||||
});
|
||||
});
|
||||
|
||||
hlsPlayer.on(Hls.Events.LEVEL_LOADED, (eventName, level: LevelLoadedData) => {
|
||||
isLive = level.details.live;
|
||||
isLivePosition = isLive ? true : false;
|
||||
});
|
||||
|
||||
player = new Player(PlayerType.Hls, videoElement, hlsPlayer);
|
||||
|
||||
// value.url = "https://devstreaming-cdn.apple.com/videos/streaming/examples/adv_dv_atmos/main.m3u8?ref=developerinsider.co";
|
||||
hlsPlayer.loadSource(value.url);
|
||||
hlsPlayer.attachMedia(videoElement);
|
||||
// hlsPlayer.subtitleDisplay = true;
|
||||
|
||||
} else {
|
||||
console.log("Loading html player");
|
||||
player = new Player(PlayerType.Html, videoElement);
|
||||
|
||||
videoElement.src = value.url;
|
||||
videoElement.load();
|
||||
}
|
||||
|
||||
// Player event handlers
|
||||
if (player.playerType === PlayerType.Hls || player.playerType === PlayerType.Html) {
|
||||
videoElement.onplay = () => { sendPlaybackUpdate(1); playerCtrlStateUpdate(PlayerControlEvent.Play); };
|
||||
videoElement.onpause = () => { sendPlaybackUpdate(2); playerCtrlStateUpdate(PlayerControlEvent.Pause); };
|
||||
videoElement.onended = () => { sendPlaybackUpdate(0) };
|
||||
videoElement.ontimeupdate = () => {
|
||||
playerCtrlStateUpdate(PlayerControlEvent.TimeUpdate);
|
||||
|
||||
if (Math.abs(videoElement.currentTime - playerPrevTime) >= playbackUpdateInterval) {
|
||||
sendPlaybackUpdate(videoElement.paused ? 2 : 1);
|
||||
playerPrevTime = videoElement.currentTime;
|
||||
}
|
||||
};
|
||||
// Buffering UI update when paused
|
||||
videoElement.onprogress = () => { playerCtrlStateUpdate(PlayerControlEvent.TimeUpdate); };
|
||||
videoElement.onratechange = () => { sendPlaybackUpdate(videoElement.paused ? 2 : 1) };
|
||||
videoElement.onvolumechange = () => {
|
||||
const updateVolume = videoElement.muted ? 0 : videoElement.volume;
|
||||
playerCtrlStateUpdate(PlayerControlEvent.VolumeChange);
|
||||
window.electronAPI.sendVolumeUpdate({ generationTime: Date.now(), volume: updateVolume });
|
||||
};
|
||||
|
||||
videoElement.onerror = (event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error) => {
|
||||
console.error("Player error", {source, lineno, colno, error});
|
||||
};
|
||||
|
||||
videoElement.onloadedmetadata = () => { onPlayerLoad(value, currentPlaybackRate, currentVolume); };
|
||||
}
|
||||
}
|
||||
|
||||
// Sender generated event handlers
|
||||
window.electronAPI.onPause(() => { player.pause(); });
|
||||
window.electronAPI.onResume(() => { player.play(); });
|
||||
window.electronAPI.onSeek((_event, value: SeekMessage) => { player.setCurrentTime(value.time); });
|
||||
window.electronAPI.onSetVolume((_event, value: SetVolumeMessage) => { volumeChangeHandler(value.volume); });
|
||||
window.electronAPI.onSetSpeed((_event, value: SetSpeedMessage) => { player.setPlaybackRate(value.speed); playerCtrlStateUpdate(PlayerControlEvent.SetPlaybackRate); });
|
||||
});
|
||||
|
||||
let scrubbing = false;
|
||||
let volumeChanging = false;
|
||||
|
||||
enum PlayerControlEvent {
|
||||
Load,
|
||||
Pause,
|
||||
Play,
|
||||
VolumeChange,
|
||||
TimeUpdate,
|
||||
UiFadeOut,
|
||||
UiFadeIn,
|
||||
SetCaptions,
|
||||
ToggleSpeedMenu,
|
||||
SetPlaybackRate,
|
||||
ToggleFullscreen,
|
||||
ExitFullscreen,
|
||||
}
|
||||
|
||||
// UI update handlers
|
||||
function playerCtrlStateUpdate(event: PlayerControlEvent) {
|
||||
switch (event) {
|
||||
case PlayerControlEvent.Load: {
|
||||
playerCtrlProgressBarBuffer.setAttribute("style", "width: 0px");
|
||||
playerCtrlProgressBarProgress.setAttribute("style", "width: 0px");
|
||||
playerCtrlProgressBarHandle.setAttribute("style", `left: ${playerCtrlProgressBar.offsetLeft}px`);
|
||||
|
||||
const volume = Math.round(player.getVolume() * playerCtrlVolumeBar.offsetWidth);
|
||||
playerCtrlVolumeBarProgress.setAttribute("style", `width: ${volume}px`);
|
||||
playerCtrlVolumeBarHandle.setAttribute("style", `left: ${volume + 8}px`);
|
||||
|
||||
if (isLive) {
|
||||
playerCtrlLiveBadge.setAttribute("style", "display: block");
|
||||
playerCtrlPosition.setAttribute("style", "display: none");
|
||||
playerCtrlDuration.setAttribute("style", "display: none");
|
||||
}
|
||||
else {
|
||||
playerCtrlLiveBadge.setAttribute("style", "display: none");
|
||||
playerCtrlPosition.setAttribute("style", "display: block");
|
||||
playerCtrlDuration.setAttribute("style", "display: block");
|
||||
playerCtrlPosition.textContent = formatDuration(player.getCurrentTime());
|
||||
playerCtrlDuration.innerHTML = `/  ${formatDuration(player.getDuration())}`;
|
||||
}
|
||||
|
||||
if (player.isCaptionsSupported()) {
|
||||
playerCtrlCaptions.setAttribute("style", "display: block");
|
||||
videoCaptions.setAttribute("style", "display: block");
|
||||
}
|
||||
else {
|
||||
playerCtrlCaptions.setAttribute("style", "display: none");
|
||||
videoCaptions.setAttribute("style", "display: none");
|
||||
player.enableCaptions(false);
|
||||
}
|
||||
playerCtrlStateUpdate(PlayerControlEvent.SetCaptions);
|
||||
break;
|
||||
}
|
||||
|
||||
case PlayerControlEvent.Pause:
|
||||
playerCtrlAction.setAttribute("class", "play");
|
||||
stopUiHideTimer();
|
||||
break;
|
||||
|
||||
case PlayerControlEvent.Play:
|
||||
playerCtrlAction.setAttribute("class", "pause");
|
||||
startUiHideTimer();
|
||||
break;
|
||||
|
||||
case PlayerControlEvent.VolumeChange: {
|
||||
// console.log(`VolumeChange: isMute ${player.isMuted()}, volume: ${player.getVolume()}`);
|
||||
const volume = Math.round(player.getVolume() * playerCtrlVolumeBar.offsetWidth);
|
||||
|
||||
if (player.isMuted()) {
|
||||
playerCtrlVolume.setAttribute("class", "mute");
|
||||
playerCtrlVolumeBarProgress.setAttribute("style", `width: 0px`);
|
||||
playerCtrlVolumeBarHandle.setAttribute("style", `left: 0px`);
|
||||
}
|
||||
else if (player.getVolume() >= 0.5) {
|
||||
playerCtrlVolume.setAttribute("class", "volume_high");
|
||||
playerCtrlVolumeBarProgress.setAttribute("style", `width: ${volume}px`);
|
||||
playerCtrlVolumeBarHandle.setAttribute("style", `left: ${volume}px`);
|
||||
} else {
|
||||
playerCtrlVolume.setAttribute("class", "volume_low");
|
||||
playerCtrlVolumeBarProgress.setAttribute("style", `width: ${volume}px`);
|
||||
playerCtrlVolumeBarHandle.setAttribute("style", `left: ${volume}px`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PlayerControlEvent.TimeUpdate: {
|
||||
// console.log(`TimeUpdate: Position: ${player.getCurrentTime()}, Duration: ${player.getDuration()}`);
|
||||
|
||||
if (isLive) {
|
||||
if (isLivePosition && player.getDuration() - player.getCurrentTime() > livePositionWindow) {
|
||||
isLivePosition = false;
|
||||
playerCtrlLiveBadge.setAttribute("style", `background-color: #595959`);
|
||||
}
|
||||
else if (!isLivePosition && player.getDuration() - player.getCurrentTime() <= livePositionWindow) {
|
||||
isLivePosition = true;
|
||||
playerCtrlLiveBadge.setAttribute("style", `background-color: red`);
|
||||
}
|
||||
}
|
||||
|
||||
if (isLivePosition) {
|
||||
playerCtrlProgressBarProgress.setAttribute("style", `width: ${playerCtrlProgressBar.offsetWidth}px`);
|
||||
playerCtrlProgressBarHandle.setAttribute("style", `left: ${playerCtrlProgressBar.offsetWidth + playerCtrlProgressBar.offsetLeft}px`);
|
||||
}
|
||||
else {
|
||||
const buffer = Math.round((player.getBufferLength() / player.getDuration()) * playerCtrlProgressBar.offsetWidth);
|
||||
const progress = Math.round((player.getCurrentTime() / player.getDuration()) * playerCtrlProgressBar.offsetWidth);
|
||||
const handle = progress + playerCtrlProgressBar.offsetLeft;
|
||||
|
||||
playerCtrlProgressBarBuffer.setAttribute("style", `width: ${buffer}px`);
|
||||
playerCtrlProgressBarProgress.setAttribute("style", `width: ${progress}px`);
|
||||
playerCtrlProgressBarHandle.setAttribute("style", `left: ${handle}px`);
|
||||
|
||||
playerCtrlPosition.textContent = formatDuration(player.getCurrentTime());
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PlayerControlEvent.UiFadeOut:
|
||||
document.body.style.cursor = "none";
|
||||
playerControls.setAttribute("style", "opacity: 0");
|
||||
break;
|
||||
|
||||
case PlayerControlEvent.UiFadeIn:
|
||||
document.body.style.cursor = "default";
|
||||
playerControls.setAttribute("style", "opacity: 1");
|
||||
break;
|
||||
|
||||
case PlayerControlEvent.SetCaptions:
|
||||
if (player.isCaptionsEnabled()) {
|
||||
playerCtrlCaptions.setAttribute("class", "captions_on");
|
||||
videoCaptions.setAttribute("style", "display: block");
|
||||
} else {
|
||||
playerCtrlCaptions.setAttribute("class", "captions_off");
|
||||
videoCaptions.setAttribute("style", "display: none");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PlayerControlEvent.ToggleSpeedMenu: {
|
||||
if (playerCtrlSpeedMenuShown) {
|
||||
playerCtrlSpeedMenu.setAttribute("style", "display: none");
|
||||
} else {
|
||||
playerCtrlSpeedMenu.setAttribute("style", "display: block");
|
||||
}
|
||||
|
||||
playerCtrlSpeedMenuShown = !playerCtrlSpeedMenuShown;
|
||||
break;
|
||||
}
|
||||
|
||||
case PlayerControlEvent.SetPlaybackRate: {
|
||||
const rate = player.getPlaybackRate().toFixed(2);
|
||||
const entryElement = document.getElementById(`speedMenuEntry_${rate}_enabled`);
|
||||
|
||||
playbackRates.forEach(r => {
|
||||
const entry = document.getElementById(`speedMenuEntry_${r}_enabled`);
|
||||
entry.setAttribute("style", "opacity: 0");
|
||||
});
|
||||
|
||||
// Ignore updating GUI for custom rates
|
||||
if (entryElement !== null) {
|
||||
entryElement.setAttribute("style", "opacity: 1");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PlayerControlEvent.ToggleFullscreen: {
|
||||
window.electronAPI.toggleFullScreen();
|
||||
|
||||
window.electronAPI.isFullScreen().then((isFullScreen: boolean) => {
|
||||
if (isFullScreen) {
|
||||
playerCtrlFullscreen.setAttribute("class", "fullscreen_on");
|
||||
} else {
|
||||
playerCtrlFullscreen.setAttribute("class", "fullscreen_off");
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PlayerControlEvent.ExitFullscreen:
|
||||
window.electronAPI.exitFullScreen();
|
||||
playerCtrlFullscreen.setAttribute("class", "fullscreen_off");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function scrubbingMouseUIHandler(e: MouseEvent) {
|
||||
const progressBarOffset = e.offsetX - 8;
|
||||
const progressBarWidth = PlayerCtrlProgressBarInteractiveArea.offsetWidth - 16;
|
||||
let time = isLive ? Math.round((1 - (progressBarOffset / progressBarWidth)) * player.getDuration()) : Math.round((progressBarOffset / progressBarWidth) * player.getDuration());
|
||||
time = Math.min(player.getDuration(), Math.max(0.0, time));
|
||||
|
||||
if (scrubbing && isLive && e.buttons === 1) {
|
||||
isLivePosition = false;
|
||||
playerCtrlLiveBadge.setAttribute("style", `background-color: #595959`);
|
||||
}
|
||||
|
||||
const livePrefix = isLive && Math.floor(time) !== 0 ? "-" : "";
|
||||
playerCtrlProgressBarPosition.textContent = isLive ? `${livePrefix}${formatDuration(time)}` : formatDuration(time);
|
||||
|
||||
let offset = e.offsetX - (playerCtrlProgressBarPosition.offsetWidth / 2);
|
||||
offset = Math.min(PlayerCtrlProgressBarInteractiveArea.offsetWidth - (playerCtrlProgressBarPosition.offsetWidth / 1), Math.max(8, offset));
|
||||
playerCtrlProgressBarPosition.setAttribute("style", `display: block; left: ${offset}px`);
|
||||
}
|
||||
|
||||
// Receiver generated event handlers
|
||||
playerCtrlAction.onclick = () => {
|
||||
if (player.isPaused()) {
|
||||
player.play();
|
||||
} else {
|
||||
player.pause();
|
||||
}
|
||||
};
|
||||
|
||||
playerCtrlVolume.onclick = () => { player.setMute(!player.isMuted()); };
|
||||
|
||||
PlayerCtrlProgressBarInteractiveArea.onmousedown = (e: MouseEvent) => { scrubbing = true; scrubbingMouseHandler(e) };
|
||||
PlayerCtrlProgressBarInteractiveArea.onmouseup = () => { scrubbing = false; };
|
||||
PlayerCtrlProgressBarInteractiveArea.onmouseenter = (e: MouseEvent) => {
|
||||
if (e.buttons === 0) {
|
||||
volumeChanging = false;
|
||||
}
|
||||
|
||||
scrubbingMouseUIHandler(e);
|
||||
};
|
||||
PlayerCtrlProgressBarInteractiveArea.onmouseleave = () => { playerCtrlProgressBarPosition.setAttribute("style", "display: none"); };
|
||||
PlayerCtrlProgressBarInteractiveArea.onmousemove = (e: MouseEvent) => { scrubbingMouseHandler(e) };
|
||||
|
||||
function scrubbingMouseHandler(e: MouseEvent) {
|
||||
const progressBarOffset = e.offsetX - 8;
|
||||
const progressBarWidth = PlayerCtrlProgressBarInteractiveArea.offsetWidth - 16;
|
||||
let time = Math.round((progressBarOffset / progressBarWidth) * player.getDuration());
|
||||
time = Math.min(player.getDuration(), Math.max(0.0, time));
|
||||
|
||||
if (scrubbing && e.buttons === 1) {
|
||||
player.setCurrentTime(time);
|
||||
}
|
||||
|
||||
scrubbingMouseUIHandler(e);
|
||||
}
|
||||
|
||||
playerCtrlVolumeBarInteractiveArea.onmousedown = (e: MouseEvent) => { volumeChanging = true; volumeChangeMouseHandler(e) };
|
||||
playerCtrlVolumeBarInteractiveArea.onmouseup = () => { volumeChanging = false; };
|
||||
playerCtrlVolumeBarInteractiveArea.onmouseenter = (e: MouseEvent) => {
|
||||
if (e.buttons === 0) {
|
||||
scrubbing = false;
|
||||
}
|
||||
};
|
||||
playerCtrlVolumeBarInteractiveArea.onmousemove = (e: MouseEvent) => { volumeChangeMouseHandler(e) };
|
||||
playerCtrlVolumeBarInteractiveArea.onwheel = (e: WheelEvent) => {
|
||||
const delta = -e.deltaY;
|
||||
|
||||
if (delta > 0 ) {
|
||||
volumeChangeHandler(Math.min(player.getVolume() + volumeIncrement, 1));
|
||||
} else if (delta < 0) {
|
||||
volumeChangeHandler(Math.max(player.getVolume() - volumeIncrement, 0));
|
||||
}
|
||||
};
|
||||
|
||||
function volumeChangeMouseHandler(e: MouseEvent) {
|
||||
if (volumeChanging && e.buttons === 1) {
|
||||
const volumeBarOffsetX = e.offsetX - 8;
|
||||
const volumeBarWidth = playerCtrlVolumeBarInteractiveArea.offsetWidth - 16;
|
||||
const volume = volumeBarOffsetX / volumeBarWidth;
|
||||
volumeChangeHandler(volume);
|
||||
}
|
||||
}
|
||||
|
||||
function volumeChangeHandler(volume: number) {
|
||||
if (!player.isMuted() && volume <= 0) {
|
||||
player.setMute(true);
|
||||
}
|
||||
else if (player.isMuted() && volume > 0) {
|
||||
player.setMute(false);
|
||||
}
|
||||
|
||||
player.setVolume(volume);
|
||||
}
|
||||
|
||||
playerCtrlLiveBadge.onclick = () => { setLivePosition(); };
|
||||
|
||||
function setLivePosition() {
|
||||
if (!isLivePosition) {
|
||||
isLivePosition = true;
|
||||
|
||||
player.setCurrentTime(player.getDuration() - livePositionDelta);
|
||||
playerCtrlLiveBadge.setAttribute("style", `background-color: red`);
|
||||
|
||||
if (player.isPaused()) {
|
||||
player.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playerCtrlCaptions.onclick = () => { player.enableCaptions(!player.isCaptionsEnabled()); playerCtrlStateUpdate(PlayerControlEvent.SetCaptions); };
|
||||
playerCtrlSpeed.onclick = () => { playerCtrlStateUpdate(PlayerControlEvent.ToggleSpeedMenu); };
|
||||
playerCtrlFullscreen.onclick = () => { playerCtrlStateUpdate(PlayerControlEvent.ToggleFullscreen); };
|
||||
|
||||
playbackRates.forEach(r => {
|
||||
const entry = document.getElementById(`speedMenuEntry_${r}`);
|
||||
entry.onclick = () => {
|
||||
player.setPlaybackRate(parseFloat(r));
|
||||
playerCtrlStateUpdate(PlayerControlEvent.SetPlaybackRate);
|
||||
playerCtrlStateUpdate(PlayerControlEvent.ToggleSpeedMenu);
|
||||
};
|
||||
});
|
||||
|
||||
videoElement.onclick = () => {
|
||||
if (!playerCtrlSpeedMenuShown) {
|
||||
if (player.isPaused()) {
|
||||
player.play();
|
||||
} else {
|
||||
player.pause();
|
||||
}
|
||||
}
|
||||
};
|
||||
videoElement.ondblclick = () => { playerCtrlStateUpdate(PlayerControlEvent.ToggleFullscreen); };
|
||||
|
||||
// Component hiding
|
||||
let uiHideTimer = null;
|
||||
let uiVisible = true;
|
||||
|
||||
function startUiHideTimer() {
|
||||
if (uiHideTimer === null) {
|
||||
uiHideTimer = window.setTimeout(() => {
|
||||
uiHideTimer = null;
|
||||
uiVisible = false;
|
||||
playerCtrlStateUpdate(PlayerControlEvent.UiFadeOut);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
function stopUiHideTimer() {
|
||||
if (uiHideTimer) {
|
||||
window.clearTimeout(uiHideTimer);
|
||||
uiHideTimer = null;
|
||||
}
|
||||
|
||||
if (!uiVisible) {
|
||||
uiVisible = true;
|
||||
playerCtrlStateUpdate(PlayerControlEvent.UiFadeIn);
|
||||
}
|
||||
}
|
||||
|
||||
document.onmousemove = function() {
|
||||
stopUiHideTimer();
|
||||
|
||||
if (player && !player.isPaused()) {
|
||||
startUiHideTimer();
|
||||
}
|
||||
};
|
||||
|
||||
window.onresize = () => { playerCtrlStateUpdate(PlayerControlEvent.TimeUpdate); };
|
||||
|
||||
// Listener for hiding speed menu when clicking outside element
|
||||
document.addEventListener('click', (event: MouseEvent) => {
|
||||
const node = event.target as Node;
|
||||
if (playerCtrlSpeedMenuShown && !playerCtrlSpeed.contains(node) && !playerCtrlSpeedMenu.contains(node)){
|
||||
playerCtrlStateUpdate(PlayerControlEvent.ToggleSpeedMenu);
|
||||
}
|
||||
});
|
||||
|
||||
// Add the keydown event listener to the document
|
||||
const skipInterval = 10;
|
||||
const volumeIncrement = 0.1;
|
||||
|
||||
document.addEventListener('keydown', (event) => {
|
||||
// console.log("KeyDown", event);
|
||||
|
||||
switch (event.code) {
|
||||
case 'KeyF':
|
||||
case 'F11':
|
||||
playerCtrlStateUpdate(PlayerControlEvent.ToggleFullscreen);
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'Escape':
|
||||
playerCtrlStateUpdate(PlayerControlEvent.ExitFullscreen);
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'ArrowLeft':
|
||||
// Skip back
|
||||
player.setCurrentTime(Math.max(player.getCurrentTime() - skipInterval, 0));
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'ArrowRight':
|
||||
// Skip forward
|
||||
if (!isLivePosition) {
|
||||
player.setCurrentTime(Math.min(player.getCurrentTime() + skipInterval, player.getDuration()));
|
||||
}
|
||||
event.preventDefault();
|
||||
break;
|
||||
case "Home":
|
||||
player.setCurrentTime(0);
|
||||
event.preventDefault();
|
||||
break;
|
||||
case "End":
|
||||
if (isLive) {
|
||||
setLivePosition();
|
||||
}
|
||||
else {
|
||||
player.setCurrentTime(player.getDuration());
|
||||
}
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'KeyK':
|
||||
case 'Space':
|
||||
case 'Enter':
|
||||
// Pause/Continue
|
||||
if (player.isPaused()) {
|
||||
player.play();
|
||||
} else {
|
||||
player.pause();
|
||||
}
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'KeyM':
|
||||
// Mute toggle
|
||||
player.setMute(!player.isMuted());
|
||||
break;
|
||||
case 'ArrowUp':
|
||||
// Volume up
|
||||
volumeChangeHandler(Math.min(player.getVolume() + volumeIncrement, 1));
|
||||
break;
|
||||
case 'ArrowDown':
|
||||
// Volume down
|
||||
volumeChangeHandler(Math.max(player.getVolume() - volumeIncrement, 0));
|
||||
break;
|
||||
}
|
||||
});
|
|
@ -1,21 +1,88 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link href="./video-js.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
<title>FCast Receiver</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../assets/fonts/inter.css" />
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
<title>FCast Receiver</title>
|
||||
</head>
|
||||
<body>
|
||||
<video id="video-player" class="video-js" controls preload="auto" data-setup='{}'>
|
||||
<p class="vjs-no-js">
|
||||
To view this video please enable JavaScript, and consider upgrading to a web browser that
|
||||
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video
|
||||
</a>
|
||||
</p>
|
||||
</video>
|
||||
<script>window.HELP_IMPROVE_VIDEOJS = false;</script>
|
||||
<script src="./video.min.js"></script>
|
||||
<script src="./renderer.js"></script>
|
||||
<video id="videoPlayer" autoplay preload="auto"></video>
|
||||
<div id="videoCaptions" class="captionsContainer"></div>
|
||||
|
||||
<div id="controls" class="container">
|
||||
<div class="progressBarContainer">
|
||||
<div id="progressBar" ref="progressBar" class="progressBar" ></div>
|
||||
<div id="progressBarBuffer" class="progressBarBuffer" ></div>
|
||||
<div id="progressBarProgress" class="progressBarProgress" ></div>
|
||||
<div id="progressBarPosition" class="progressBarPosition" ></div>
|
||||
<!-- <div class="progressBarChapterContainer"></div> -->
|
||||
<div id="progressBarHandle" class="progressBarHandle" ></div>
|
||||
<div id="progressBarInteractiveArea" class="progressBarInteractiveArea" ></div>
|
||||
</div>
|
||||
|
||||
<div class="leftButtonContainer">
|
||||
<div id="action" class="play"></div>
|
||||
|
||||
<div id="volume" class="volume_high"></div>
|
||||
<div class="volumeContainer">
|
||||
<div id="volumeBar" ref="volumeBar" class="volumeBar" ></div>
|
||||
<div id="volumeBarProgress" class="volumeBarProgress" ></div>
|
||||
<div id="volumeBarHandle" class="volumeBarHandle" ></div>
|
||||
<div id="volumeBarInteractiveArea" class="volumeBarInteractiveArea" ></div>
|
||||
</div>
|
||||
|
||||
<div class="positionContainer">
|
||||
<div id="liveBadge" class="liveBadge" style="display: none">LIVE</div>
|
||||
<div id="position" class="position">00:00</div>
|
||||
<div id="duration" class="duration">/  00:00</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="buttonContainer">
|
||||
<div id="fullscreen" class="fullscreen_on"></div>
|
||||
<div id="speed" class="speed"></div>
|
||||
<div id="captions" class="captions_off"></div>
|
||||
</div>
|
||||
|
||||
<div id="speedMenu" class="speedMenu" style="display: none">
|
||||
<div class="speedMenuTitle">Playback speed</div>
|
||||
<div class="speedMenuSeparator"></div>
|
||||
<div id="speedMenuEntry_0.25" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_0.25_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">0.25</div>
|
||||
</div>
|
||||
<div id="speedMenuEntry_0.50" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_0.50_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">0.5</div>
|
||||
</div>
|
||||
<div id="speedMenuEntry_0.75" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_0.75_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">0.75</div>
|
||||
</div>
|
||||
<div id="speedMenuEntry_1.00" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_1.00_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">1.0</div>
|
||||
</div>
|
||||
<div id="speedMenuEntry_1.25" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_1.25_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">1.25</div>
|
||||
</div>
|
||||
<div id="speedMenuEntry_1.50" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_1.50_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">1.5</div>
|
||||
</div>
|
||||
<div id="speedMenuEntry_1.75" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_1.75_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">1.75</div>
|
||||
</div>
|
||||
<div id="speedMenuEntry_2.00" class="speedMenuEntry">
|
||||
<div id="speedMenuEntry_2.00_enabled" class="speedMenuEntryEnabled"></div>
|
||||
<div class="speedMenuEntryText">2.0</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="./renderer.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,15 +0,0 @@
|
|||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
toggleFullScreen: () => ipcRenderer.send('toggle-full-screen'),
|
||||
exitFullScreen: () => ipcRenderer.send('exit-full-screen'),
|
||||
sendPlaybackError: (error) => ipcRenderer.send('send-playback-error', error),
|
||||
sendPlaybackUpdate: (update) => ipcRenderer.send('send-playback-update', update),
|
||||
sendVolumeUpdate: (update) => ipcRenderer.send('send-volume-update', update),
|
||||
onPlay: (callback) => ipcRenderer.on("play", callback),
|
||||
onPause: (callback) => ipcRenderer.on("pause", callback),
|
||||
onResume: (callback) => ipcRenderer.on("resume", callback),
|
||||
onSeek: (callback) => ipcRenderer.on("seek", callback),
|
||||
onSetVolume: (callback) => ipcRenderer.on("setvolume", callback),
|
||||
onSetSpeed: (callback) => ipcRenderer.on("setspeed", callback)
|
||||
});
|
|
@ -1,240 +0,0 @@
|
|||
function toggleFullScreen(ev) {
|
||||
window.electronAPI.toggleFullScreen();
|
||||
}
|
||||
|
||||
const options = {
|
||||
textTrackSettings: false
|
||||
};
|
||||
|
||||
let customHeaders = null;
|
||||
videojs.Vhs.xhr.beforeRequest = function(options) {
|
||||
options.headers = { ... options.headers, ... customHeaders };
|
||||
return options;
|
||||
};
|
||||
|
||||
const player = videojs("video-player", options, function onPlayerReady() {
|
||||
const fullScreenControls = document.getElementsByClassName("vjs-fullscreen-control");
|
||||
for (let i = 0; i < fullScreenControls.length; i++) {
|
||||
const node = fullScreenControls[i].cloneNode(true);
|
||||
fullScreenControls[i].parentNode.replaceChild(node, fullScreenControls[i]);
|
||||
fullScreenControls[i].onclick = toggleFullScreen;
|
||||
fullScreenControls[i].ontap = toggleFullScreen;
|
||||
}
|
||||
});
|
||||
|
||||
sendPlaybackUpdate = (message) => {
|
||||
const sanitizedMessage = {
|
||||
generationTime: Date.now(),
|
||||
time: message.time ? message.time : 0,
|
||||
duration: message.duration && isFinite(message.duration) ? message.duration : 0,
|
||||
state: message.state,
|
||||
speed: message.speed ? message.speed : 1
|
||||
};
|
||||
|
||||
window.electronAPI.sendPlaybackUpdate(sanitizedMessage);
|
||||
};
|
||||
|
||||
player.on("pause", () => { sendPlaybackUpdate({
|
||||
time: player.currentTime(),
|
||||
duration: player.duration(),
|
||||
state: 2,
|
||||
speed: player.playbackRate()
|
||||
})});
|
||||
|
||||
player.on("play", () => { sendPlaybackUpdate({
|
||||
time: player.currentTime(),
|
||||
duration: player.duration(),
|
||||
state: 1,
|
||||
speed: player.playbackRate()
|
||||
})});
|
||||
|
||||
player.on("seeked", () => { sendPlaybackUpdate({
|
||||
time: player.currentTime(),
|
||||
duration: player.duration(),
|
||||
state: player.paused() ? 2 : 1,
|
||||
speed: player.playbackRate()
|
||||
})});
|
||||
|
||||
player.on("ratechange", () => { sendPlaybackUpdate({
|
||||
time: player.currentTime(),
|
||||
duration: player.duration(),
|
||||
state: player.paused() ? 2 : 1,
|
||||
speed: player.playbackRate()
|
||||
})});
|
||||
|
||||
player.on("volumechange", () => { window.electronAPI.sendVolumeUpdate({
|
||||
generationTime: Date.now(),
|
||||
volume: player.volume()
|
||||
})});
|
||||
|
||||
player.on('error', () => { window.electronAPI.sendPlaybackError({
|
||||
message: JSON.stringify(player.error())
|
||||
})});
|
||||
|
||||
window.electronAPI.onPlay((_event, value) => {
|
||||
console.log("Handle play message renderer", value);
|
||||
customHeaders = value.headers;
|
||||
|
||||
if (value.content) {
|
||||
player.src({ type: value.container, src: `data:${value.container};base64,` + window.btoa(value.content) });
|
||||
} else {
|
||||
player.src({ type: value.container, src: value.url });
|
||||
}
|
||||
|
||||
const onLoadedMetadata = () => {
|
||||
if (value.time) {
|
||||
player.currentTime(value.time);
|
||||
}
|
||||
|
||||
if (value.speed) {
|
||||
player.playbackRate(value.speed);
|
||||
} else {
|
||||
player.playbackRate(1.0);
|
||||
}
|
||||
|
||||
player.off('loadedmetadata', onLoadedMetadata);
|
||||
};
|
||||
|
||||
player.on('loadedmetadata', onLoadedMetadata);
|
||||
player.play();
|
||||
});
|
||||
|
||||
window.electronAPI.onPause((_event) => {
|
||||
console.log("Handle pause");
|
||||
player.pause();
|
||||
});
|
||||
|
||||
window.electronAPI.onResume((_event) => {
|
||||
console.log("Handle resume");
|
||||
player.play();
|
||||
});
|
||||
|
||||
window.electronAPI.onSeek((_event, value) => {
|
||||
console.log("Handle seek");
|
||||
player.currentTime(value.time);
|
||||
});
|
||||
|
||||
window.electronAPI.onSetVolume((_event, value) => {
|
||||
console.log("Handle setVolume");
|
||||
player.volume(Math.min(1.0, Math.max(0.0, value.volume)));
|
||||
});
|
||||
|
||||
window.electronAPI.onSetSpeed((_event, value) => {
|
||||
console.log("Handle setSpeed");
|
||||
player.playbackRate(value.speed);
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
sendPlaybackUpdate({
|
||||
time: player.currentTime(),
|
||||
duration: player.duration(),
|
||||
state: player.paused() ? 2 : 1,
|
||||
speed: player.playbackRate(),
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
let mouseTimer = null;
|
||||
let cursorVisible = true;
|
||||
|
||||
//Hide mouse cursor
|
||||
|
||||
function startMouseHideTimer() {
|
||||
mouseTimer = window.setTimeout(() => {
|
||||
mouseTimer = null;
|
||||
document.body.style.cursor = "none";
|
||||
cursorVisible = false;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
document.onmousemove = function() {
|
||||
if (mouseTimer) {
|
||||
window.clearTimeout(mouseTimer);
|
||||
}
|
||||
|
||||
if (!cursorVisible) {
|
||||
document.body.style.cursor = "default";
|
||||
cursorVisible = true;
|
||||
}
|
||||
|
||||
startMouseHideTimer();
|
||||
};
|
||||
|
||||
startMouseHideTimer();
|
||||
|
||||
// Add the keydown event listener to the document
|
||||
const skipInterval = 10;
|
||||
const volumeIncrement = 0.1;
|
||||
|
||||
document.addEventListener('keydown', (event) => {
|
||||
console.log("KeyDown", event);
|
||||
|
||||
switch (event.code) {
|
||||
case 'F11':
|
||||
window.electronAPI.toggleFullScreen();
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'Escape':
|
||||
window.electronAPI.exitFullScreen();
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'ArrowLeft':
|
||||
// Skip back
|
||||
player.currentTime(Math.max(player.currentTime() - skipInterval, 0));
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'ArrowRight':
|
||||
// Skip forward
|
||||
const duration = player.duration();
|
||||
if (duration) {
|
||||
player.currentTime(Math.min(player.currentTime() + skipInterval, duration));
|
||||
} else {
|
||||
player.currentTime(player.currentTime());
|
||||
}
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'Space':
|
||||
case 'Enter':
|
||||
// Pause/Continue
|
||||
if (player.paused()) {
|
||||
player.play();
|
||||
} else {
|
||||
player.pause();
|
||||
}
|
||||
event.preventDefault();
|
||||
break;
|
||||
case 'KeyM':
|
||||
// Mute toggle
|
||||
player.muted(!player.muted());
|
||||
break;
|
||||
case 'ArrowUp':
|
||||
// Volume up
|
||||
player.volume(Math.min(player.volume() + volumeIncrement, 1));
|
||||
break;
|
||||
case 'ArrowDown':
|
||||
// Volume down
|
||||
player.volume(Math.max(player.volume() - volumeIncrement, 0));
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
//Select subtitle track by default
|
||||
player.ready(() => {
|
||||
const textTracks = player.textTracks();
|
||||
textTracks.addEventListener("change", function () {
|
||||
console.log("Text tracks changed", textTracks);
|
||||
for (let i = 0; i < textTracks.length; i++) {
|
||||
if (textTracks[i].language === "df" && textTracks[i].mode !== "showing") {
|
||||
textTracks[i].mode = "showing";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
player.on('loadedmetadata', function () {
|
||||
console.log("Metadata loaded", textTracks);
|
||||
for (let i = 0; i < textTracks.length; i++) {
|
||||
if (textTracks[i].language === "df" && textTracks[i].mode !== "showing") {
|
||||
textTracks[i].mode = "showing";
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
|
@ -5,9 +5,9 @@ html {
|
|||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: black;
|
||||
background-color: black;
|
||||
color: white;
|
||||
width: 100vw;
|
||||
max-width: 100%;
|
||||
|
@ -15,7 +15,7 @@ body {
|
|||
max-height: 100%;
|
||||
}
|
||||
|
||||
#video-player {
|
||||
#videoPlayer {
|
||||
object-fit: contain;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -24,4 +24,476 @@ body {
|
|||
*:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
|
||||
/* height: 100%; */
|
||||
height: 120px;
|
||||
width: 100%;
|
||||
/* background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%); */
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.0) 35%);
|
||||
|
||||
background-size: 100% 300px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: bottom;
|
||||
|
||||
opacity: 1;
|
||||
transition: opacity 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.volumeContainer {
|
||||
position: relative;
|
||||
height: 24px;
|
||||
width: 92px;
|
||||
flex-shrink: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.volumeBar {
|
||||
position: absolute;
|
||||
/* left: 12px; */
|
||||
left: 8px;
|
||||
top: 10px;
|
||||
height: 4px;
|
||||
/* width: 72px; */
|
||||
width: 76px;
|
||||
background-color: #999999;
|
||||
border-radius: 3px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.volumeBarInteractiveArea {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
/* left: 8px; */
|
||||
top: 0px;
|
||||
height: 24px;
|
||||
width: 92px;
|
||||
/* width: 84px; */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.volumeBarHandle {
|
||||
position: absolute;
|
||||
left: 84px;
|
||||
top: 4px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
/* background-color: #ffffff; */
|
||||
background-color: #c9c9c9;
|
||||
box-shadow: 0px 32px 64px 0px rgba(0, 0, 0, 0.56), 0px 2px 21px 0px rgba(0, 0, 0, 0.55);
|
||||
border-radius: 50%;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.volumeBarProgress {
|
||||
position: absolute;
|
||||
/* left: 12px; */
|
||||
left: 8px;
|
||||
top: 10px;
|
||||
height: 4px;
|
||||
width: 76px;
|
||||
/* background-color: #ffffff; */
|
||||
background-color: #c9c9c9;
|
||||
border-radius: 3px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.progressBarContainer {
|
||||
position: absolute;
|
||||
bottom: 60px;
|
||||
left: 16px;
|
||||
right: 16px;
|
||||
height: 4px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.progressBarInteractiveArea {
|
||||
position: absolute;
|
||||
/* bottom: 60px; */
|
||||
/* left: 24px; */
|
||||
/* right: 24px; */
|
||||
height: 4px;
|
||||
width: 100%;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
z-index: 999;
|
||||
}
|
||||
.progressBarChapterContainer {
|
||||
position: absolute;
|
||||
bottom: 73px;
|
||||
left: 24px;
|
||||
right: 24px;
|
||||
height: 4px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
/* position: absolute; */
|
||||
position: relative;
|
||||
/* bottom: 70px; */
|
||||
/* left: 24px; */
|
||||
/* right: 24px; */
|
||||
left: 8px;
|
||||
width: calc(100% - 16px);
|
||||
height: 4px;
|
||||
background-color: #99999945;
|
||||
border-radius: 3px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.progressBarBuffer {
|
||||
/* position: absolute; */
|
||||
position: relative;
|
||||
/* bottom: 70px; */
|
||||
/* left: 24px; */
|
||||
left: 8px;
|
||||
bottom: 4px;
|
||||
height: 4px;
|
||||
background-color: #D9D9D945;
|
||||
border-radius: 3px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.progressBarProgress {
|
||||
/* position: absolute; */
|
||||
position: relative;
|
||||
/* bottom: 70px; */
|
||||
/* left: 24px; */
|
||||
left: 8px;
|
||||
bottom: 8px;
|
||||
height: 4px;
|
||||
width: 0px;
|
||||
background-color: #019BE7;
|
||||
border-radius: 3px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.progressBarPosition {
|
||||
position: absolute;
|
||||
bottom: 25px;
|
||||
padding: 2px 5px;
|
||||
|
||||
font-family: InterVariable;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
|
||||
border-radius: 3px;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.progressBarHandle {
|
||||
position: absolute;
|
||||
/* bottom: 70px; */
|
||||
bottom: 10px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-left: -8px;
|
||||
margin-bottom: -8px;
|
||||
background-color: #019BE7;
|
||||
border-radius: 50%;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.positionContainer {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-grow: 1;
|
||||
align-items: center;
|
||||
|
||||
font-family: InterVariable;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
|
||||
.position {
|
||||
margin-right: 10px;
|
||||
vertical-align: bottom;
|
||||
|
||||
color: #c9c9c9;
|
||||
}
|
||||
|
||||
.duration {
|
||||
opacity: 0.6;
|
||||
|
||||
color: #c9c9c9;
|
||||
}
|
||||
|
||||
.liveBadge {
|
||||
background-color: red;
|
||||
/* margin-top: -2px; */
|
||||
/* padding: 5px 5px; */
|
||||
padding: 2px 5px;
|
||||
border-radius: 4px;
|
||||
/* margin-left: 10px; */
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.play {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_play.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.play:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_play_active.svg");
|
||||
}
|
||||
|
||||
.pause {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_pause.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.pause:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_pause_active.svg");
|
||||
}
|
||||
|
||||
.volume_high {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_volume_more_50pct.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.volume_high:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_volume_more_50pct_active.svg");
|
||||
}
|
||||
|
||||
.volume_low {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_volume_less_50pct.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.volume_low:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_volume_less_50pct_active.svg");
|
||||
}
|
||||
|
||||
.mute {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_mute.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.mute:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_mute_active.svg");
|
||||
}
|
||||
|
||||
.fullscreen_on {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_fullscreen_on.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.fullscreen_on:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_fullscreen_on_active.svg");
|
||||
}
|
||||
|
||||
.fullscreen_off {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_fullscreen_off.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.fullscreen_off:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_fullscreen_off_active.svg");
|
||||
}
|
||||
|
||||
|
||||
.speed {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_speed.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.speed:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_speed_active.svg");
|
||||
}
|
||||
|
||||
.captions_off {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_cc_off.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.captions_off:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_cc_off_active.svg");
|
||||
}
|
||||
|
||||
.captions_on {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_cc_on.svg");
|
||||
transition: background-image 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.captions_on:hover {
|
||||
background-image: url("../../assets/icons/player/icon24_cc_on_active.svg");
|
||||
}
|
||||
|
||||
.leftButtonContainer {
|
||||
position: absolute;
|
||||
bottom: 24px;
|
||||
left: 24px;
|
||||
height: 24px;
|
||||
/* width: calc(50% - 24px); */
|
||||
right: 160px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
overflow: hidden;
|
||||
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.buttonContainer {
|
||||
position: absolute;
|
||||
bottom: 24px;
|
||||
right: 24px;
|
||||
height: 24px;
|
||||
/* width: calc(50% - 24px); */
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.captionsContainer {
|
||||
/* display: none; */
|
||||
position: relative;
|
||||
/* top: -200px; */
|
||||
bottom: 150px;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
|
||||
font-family: InterVariable;
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
padding: 0px 5px;
|
||||
|
||||
width: fit-content;
|
||||
|
||||
/* display: flex; */
|
||||
/* align-items: center; */
|
||||
/* min-width: 100%; */
|
||||
/* height: 100px; */
|
||||
/* text-overflow: ellipsis; */
|
||||
/* overflow: hidden; */
|
||||
}
|
||||
|
||||
.speedMenu {
|
||||
position: absolute;
|
||||
bottom: 80px;
|
||||
right: 60px;
|
||||
height: calc(55vh);
|
||||
max-height: 368px;
|
||||
|
||||
background-color: #141414;
|
||||
padding: 12px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #2E2E2E;
|
||||
scrollbar-width: thin;
|
||||
overflow: auto;
|
||||
|
||||
font-family: InterVariable;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
|
||||
box-shadow: 0px 1.852px 3.148px 0px rgba(0, 0, 0, 0.06), 0px 8.148px 6.519px 0px rgba(0, 0, 0, 0.10), 0px 20px 13px 0px rgba(0, 0, 0, 0.13), 0px 38.519px 25.481px 0px rgba(0, 0, 0, 0.15), 0px 64.815px 46.852px 0px rgba(0, 0, 0, 0.19), 0px 100px 80px 0px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.speedMenuTitle {
|
||||
font-weight: 700;
|
||||
line-height: 24px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.speedMenuEntry {
|
||||
display: flex;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.speedMenuEntry:hover {
|
||||
cursor: pointer;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.speedMenuSeparator {
|
||||
height: 1px;
|
||||
background: #2E2E2E;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.speedMenuEntryEnabled {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 10px;
|
||||
|
||||
background-image: url("../../assets/icons/player/icon24_check_thin.svg");
|
||||
background-size: cover;
|
||||
opacity: 0;
|
||||
}
|
||||
|
|
26
receivers/electron/src/player/video.min.js
vendored
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": false,
|
||||
"emitDecoratorMetadata": true,
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"removeComments": false,
|
||||
"noImplicitAny": false,
|
||||
"suppressImplicitAnyIndexErrors": true ,
|
||||
"outDir": "dist"
|
||||
},
|
||||
"exclude": [ "node_modules", "test" ]
|
||||
"exclude": [ "node_modules", "test" ]
|
||||
}
|
|
@ -1,23 +1,73 @@
|
|||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: './src/App.ts',
|
||||
target: 'electron-main',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: /src/,
|
||||
use: [{ loader: 'ts-loader' }]
|
||||
}
|
||||
],
|
||||
module.exports = [
|
||||
{
|
||||
mode: 'development',
|
||||
entry: './src/App.ts',
|
||||
target: 'electron-main',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: /src/,
|
||||
use: [{ loader: 'ts-loader' }]
|
||||
}
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
{
|
||||
mode: 'development',
|
||||
entry: {
|
||||
preload: './src/main/Preload.ts',
|
||||
renderer: './src/main/Renderer.ts',
|
||||
},
|
||||
target: 'electron-renderer',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: /src/,
|
||||
use: [{ loader: 'ts-loader' }]
|
||||
}
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'dist/main'),
|
||||
},
|
||||
},
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
};
|
||||
{
|
||||
mode: 'development',
|
||||
entry: {
|
||||
preload: './src/player/Preload.ts',
|
||||
renderer: './src/player/Renderer.ts',
|
||||
},
|
||||
target: 'electron-renderer',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: /src/,
|
||||
use: [{ loader: 'ts-loader' }]
|
||||
}
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'dist/player'),
|
||||
},
|
||||
}
|
||||
];
|
164
website/images/ic_banner.svg
Normal file
After Width: | Height: | Size: 41 KiB |
|
@ -1,4 +1,103 @@
|
|||
<svg width="97" height="97" viewBox="0 0 97 97" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="97" height="97" rx="20" fill="#D9D9D9"/>
|
||||
<path d="M17.0303 67V30.6364H42.5985V38.5909H26.9024V44.8409H41.036V52.7955H26.9024V67H17.0303ZM80.1784 44.2727H70.1642C70.0931 43.4441 69.9037 42.6925 69.596 42.0178C69.3 41.343 68.8857 40.763 68.3531 40.2777C67.8322 39.7805 67.199 39.4018 66.4532 39.1413C65.7075 38.8691 64.8611 38.733 63.9142 38.733C62.257 38.733 60.8543 39.1354 59.7061 39.9403C58.5697 40.7453 57.7056 41.8994 57.1137 43.4027C56.5337 44.906 56.2437 46.7112 56.2437 48.8182C56.2437 51.0436 56.5396 52.9079 57.1315 54.4112C57.7352 55.9027 58.6052 57.0272 59.7416 57.7848C60.8779 58.5305 62.2451 58.9034 63.8431 58.9034C64.7546 58.9034 65.5713 58.791 66.2934 58.5661C67.0155 58.3293 67.6428 57.992 68.1755 57.554C68.7082 57.116 69.1402 56.5893 69.4717 55.9737C69.815 55.3464 70.0458 54.642 70.1642 53.8608L80.1784 53.9318C80.06 55.4706 79.6279 57.0391 78.8822 58.6371C78.1365 60.2232 77.077 61.6911 75.7039 63.0405C74.3427 64.3781 72.6559 65.4553 70.6436 66.272C68.6312 67.0888 66.2934 67.4972 63.6301 67.4972C60.292 67.4972 57.2972 66.781 54.6457 65.3487C52.006 63.9164 49.9168 61.8094 48.3779 59.0277C46.8509 56.246 46.0874 52.8428 46.0874 48.8182C46.0874 44.7699 46.8687 41.3608 48.4312 38.5909C49.9937 35.8092 52.1007 33.7081 54.7522 32.2876C57.4037 30.8553 60.363 30.1392 63.6301 30.1392C65.9265 30.1392 68.0394 30.4529 69.9688 31.0803C71.8983 31.7076 73.591 32.625 75.047 33.8324C76.5029 35.0279 77.6748 36.5017 78.5626 38.2536C79.4504 40.0054 79.989 42.0118 80.1784 44.2727Z" fill="black"/>
|
||||
<svg width="320" height="320" viewBox="0 0 320 320" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_200_650)">
|
||||
<rect width="319.291" height="319.291" rx="72" fill="url(#paint0_linear_200_650)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M205.646 77.6738C208.925 74.3951 206.603 68.7891 201.966 68.7891H75.9545C73.0802 68.7891 70.75 71.1192 70.75 73.9936V200.005C70.75 204.642 76.356 206.964 79.6347 203.685L103.168 180.152C104.144 179.176 104.692 177.852 104.692 176.472V107.933C104.692 105.059 107.022 102.729 109.897 102.729H178.436C179.816 102.729 181.14 102.18 182.116 101.204L205.646 77.6738Z" fill="#252525" fill-opacity="0.3"/>
|
||||
<g filter="url(#filter0_dddddd_200_650)">
|
||||
<path d="M141.456 183.508C142.714 183.508 143.734 184.528 143.734 185.786V213.126C143.734 214.385 142.714 215.405 141.456 215.405H114.571C113.313 215.405 112.293 214.385 112.293 213.126L112.293 185.786C112.293 184.528 113.313 183.508 114.571 183.508H141.456Z" fill="url(#paint1_linear_200_650)"/>
|
||||
<path d="M141.456 147.965C142.714 147.965 143.734 148.985 143.734 150.244V177.584C143.734 178.842 142.714 179.862 141.456 179.862H114.571C113.313 179.862 112.293 178.842 112.293 177.584L112.293 150.244C112.293 148.985 113.313 147.965 114.571 147.965H141.456Z" fill="url(#paint2_linear_200_650)"/>
|
||||
<path d="M176.543 147.965C177.801 147.965 178.821 148.985 178.821 150.244V177.584C178.821 178.842 177.801 179.862 176.543 179.862H149.658C148.4 179.862 147.38 178.842 147.38 177.584V150.244C147.38 148.985 148.4 147.965 149.658 147.965H176.543Z" fill="url(#paint3_linear_200_650)"/>
|
||||
<path d="M176.543 112.423C177.801 112.423 178.821 113.443 178.821 114.701V142.041C178.821 143.3 177.801 144.32 176.543 144.32H149.658C148.4 144.32 147.38 143.3 147.38 142.041V114.701C147.38 113.443 148.4 112.423 149.658 112.423L176.543 112.423Z" fill="url(#paint4_linear_200_650)"/>
|
||||
<path d="M211.629 147.965C212.888 147.965 213.908 148.985 213.908 150.244V177.584C213.908 178.842 212.888 179.862 211.629 179.862H184.745C183.486 179.862 182.466 178.842 182.466 177.584V150.244C182.466 148.985 183.486 147.965 184.745 147.965H211.629Z" fill="url(#paint5_linear_200_650)"/>
|
||||
<path d="M176.543 183.508C177.801 183.508 178.821 184.528 178.821 185.786V213.126C178.821 214.385 177.801 215.405 176.543 215.405H149.658C148.4 215.405 147.38 214.385 147.38 213.126V185.786C147.38 184.528 148.4 183.508 149.658 183.508H176.543Z" fill="url(#paint6_linear_200_650)"/>
|
||||
<path d="M211.629 112.423C212.888 112.423 213.908 113.443 213.908 114.701V142.041C213.908 143.3 212.888 144.32 211.629 144.32H184.745C183.486 144.32 182.466 143.3 182.466 142.041V114.701C182.466 113.443 183.486 112.423 184.745 112.423L211.629 112.423Z" fill="url(#paint7_linear_200_650)"/>
|
||||
<path d="M141.456 112.423C142.714 112.423 143.734 113.443 143.734 114.701V142.041C143.734 143.3 142.714 144.32 141.456 144.32H114.571C113.313 144.32 112.293 143.3 112.293 142.041L112.293 114.701C112.293 113.443 113.313 112.423 114.571 112.423L141.456 112.423Z" fill="url(#paint8_linear_200_650)"/>
|
||||
<path d="M141.456 219.05C142.714 219.05 143.734 220.07 143.734 221.328V248.669C143.734 249.927 142.714 250.947 141.456 250.947H114.571C113.313 250.947 112.293 249.927 112.293 248.669L112.293 221.328C112.293 220.07 113.313 219.05 114.571 219.05H141.456Z" fill="url(#paint9_linear_200_650)"/>
|
||||
<path d="M246.641 112.423C247.899 112.423 248.919 113.443 248.919 114.701V142.041C248.919 143.3 247.899 144.32 246.641 144.32H219.757C218.498 144.32 217.478 143.3 217.478 142.041V114.701C217.478 113.443 218.498 112.423 219.757 112.423L246.641 112.423Z" fill="url(#paint10_linear_200_650)"/>
|
||||
<path d="M145.326 213.126V185.786C145.326 183.649 143.593 181.916 141.456 181.916H114.571C112.434 181.916 110.702 183.649 110.702 185.786L110.702 213.126C110.702 215.263 112.434 216.996 114.571 216.996H141.456C143.593 216.996 145.326 215.263 145.326 213.126ZM145.326 177.584V150.244C145.326 148.106 143.593 146.374 141.456 146.374H114.571C112.434 146.374 110.702 148.106 110.702 150.244L110.702 177.584C110.702 179.721 112.434 181.454 114.571 181.454H141.456C143.593 181.454 145.326 179.721 145.326 177.584ZM180.412 177.584V150.244C180.412 148.106 178.68 146.374 176.543 146.374H149.658C147.521 146.374 145.788 148.106 145.788 150.244V177.584C145.788 179.721 147.521 181.454 149.658 181.454H176.543C178.68 181.454 180.412 179.721 180.412 177.584ZM180.412 142.041V114.701C180.412 112.564 178.68 110.831 176.543 110.831L149.658 110.831C147.521 110.831 145.788 112.564 145.788 114.701V142.041C145.788 144.179 147.521 145.911 149.658 145.911H176.543C178.68 145.911 180.412 144.179 180.412 142.041ZM215.499 177.584V150.244C215.499 148.106 213.767 146.374 211.629 146.374H184.745C182.607 146.374 180.875 148.106 180.875 150.244V177.584C180.875 179.721 182.607 181.454 184.745 181.454H211.629C213.767 181.454 215.499 179.721 215.499 177.584ZM180.412 213.126V185.786C180.412 183.649 178.68 181.916 176.543 181.916H149.658C147.521 181.916 145.788 183.649 145.788 185.786V213.126C145.788 215.263 147.521 216.996 149.658 216.996H176.543C178.68 216.996 180.412 215.263 180.412 213.126ZM215.499 142.041V114.701C215.499 112.564 213.767 110.831 211.629 110.831L184.745 110.831C182.607 110.831 180.875 112.564 180.875 114.701V142.041C180.875 144.179 182.607 145.911 184.745 145.911H211.629C213.767 145.911 215.499 144.179 215.499 142.041ZM145.326 142.041V114.701C145.326 112.564 143.593 110.831 141.456 110.831L114.571 110.831C112.434 110.831 110.702 112.564 110.702 114.701L110.702 142.041C110.702 144.179 112.434 145.911 114.571 145.911H141.456C143.593 145.911 145.326 144.179 145.326 142.041ZM145.326 248.669V221.328C145.326 219.191 143.593 217.458 141.456 217.458H114.571C112.434 217.458 110.702 219.191 110.702 221.328L110.702 248.669C110.702 250.806 112.434 252.538 114.571 252.538H141.456C143.593 252.538 145.326 250.806 145.326 248.669ZM250.511 142.041V114.701C250.511 112.564 248.778 110.831 246.641 110.831L219.757 110.831C217.619 110.831 215.887 112.564 215.887 114.701V142.041C215.887 144.179 217.619 145.911 219.757 145.911H246.641C248.778 145.911 250.511 144.179 250.511 142.041Z" stroke="black" stroke-opacity="0.11" stroke-width="3.18289"/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_dddddd_200_650" x="-18.2058" y="107.177" width="397.624" height="433.413" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="2.94712"/>
|
||||
<feGaussianBlur stdDeviation="2.50505"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0312963 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_200_650"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="12.9673"/>
|
||||
<feGaussianBlur stdDeviation="5.18693"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.051037 0"/>
|
||||
<feBlend mode="normal" in2="effect1_dropShadow_200_650" result="effect2_dropShadow_200_650"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="31.8289"/>
|
||||
<feGaussianBlur stdDeviation="10.3444"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.065 0"/>
|
||||
<feBlend mode="normal" in2="effect2_dropShadow_200_650" result="effect3_dropShadow_200_650"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="61.3001"/>
|
||||
<feGaussianBlur stdDeviation="20.2762"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.078963 0"/>
|
||||
<feBlend mode="normal" in2="effect3_dropShadow_200_650" result="effect4_dropShadow_200_650"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="103.149"/>
|
||||
<feGaussianBlur stdDeviation="37.2811"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0987037 0"/>
|
||||
<feBlend mode="normal" in2="effect4_dropShadow_200_650" result="effect5_dropShadow_200_650"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="159.145"/>
|
||||
<feGaussianBlur stdDeviation="63.6578"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0"/>
|
||||
<feBlend mode="normal" in2="effect5_dropShadow_200_650" result="effect6_dropShadow_200_650"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect6_dropShadow_200_650" result="shape"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_200_650" x1="13" y1="12" x2="280" y2="313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#26D1FF"/>
|
||||
<stop offset="0.545685" stop-color="#0A62F5"/>
|
||||
<stop offset="1" stop-color="#1E05FF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint6_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint7_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint8_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint9_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint10_linear_200_650" x1="201.333" y1="120.597" x2="201.333" y2="250.947" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="#D3D3D3"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_200_650">
|
||||
<rect width="319.291" height="319.291" rx="72" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 11 KiB |