mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-08-03 07:47:01 +00:00
Initial commit of WebOS receiver
This commit is contained in:
parent
b7e304b987
commit
90e1f4de1a
118 changed files with 18279 additions and 1746 deletions
133
receivers/webos/fcast-receiver/.gitignore
vendored
Normal file
133
receivers/webos/fcast-receiver/.gitignore
vendored
Normal file
|
@ -0,0 +1,133 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Snowpack dependency directory (https://snowpack.dev/)
|
||||
web_modules/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional stylelint cache
|
||||
.stylelintcache
|
||||
|
||||
# Microbundle cache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
.parcel-cache
|
||||
|
||||
# Next.js build output
|
||||
.next
|
||||
out
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# vuepress v2.x temp and cache directory
|
||||
.temp
|
||||
.cache
|
||||
|
||||
# Docusaurus cache and generated files
|
||||
.docusaurus
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
.tern-port
|
||||
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
.vscode-test
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
# Ignore VSCode user project settings
|
||||
.vscode
|
3
receivers/webos/fcast-receiver/.webosstudio.config
Normal file
3
receivers/webos/fcast-receiver/.webosstudio.config
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"api_level": "0"
|
||||
}
|
95
receivers/webos/fcast-receiver/README.md
Normal file
95
receivers/webos/fcast-receiver/README.md
Normal file
|
@ -0,0 +1,95 @@
|
|||
# What is FCast?
|
||||
|
||||
FCast is a protocol designed for wireless streaming of audio and video content between devices. Unlike alternative protocols like Chromecast and AirPlay, FCast is an open source protocol that allows for custom receiver implementations, enabling third-party developers to create their own receiver devices or integrate the FCast protocol into their own apps.
|
||||
|
||||
# Why do I need a receiver?
|
||||
|
||||
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.futo.org/videostreaming/fcast/-/wikis/home
|
||||
|
||||
# Receiver application
|
||||
|
||||
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 `FCast Receiver` application
|
||||
- **Linux:** Run the `fcast-receiver` application
|
||||
- **Windows:** Run the `fcast-receiver.exe` application
|
||||
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
|
||||
|
||||
## Automatic discovery
|
||||
|
||||
1. Open the video streaming application.
|
||||
2. Open the FCast receiver or restart it.
|
||||
3. The receiver should now be visible in the casting dialog under "Discovered Devices".
|
||||
4. If this failed, try manually connecting it. Automatic discovery does not work on all network types.
|
||||
5. Click start to connect to the device.
|
||||
6. Start watching content.
|
||||
|
||||
## Manual
|
||||
|
||||
1. Open the FCast receiver.
|
||||
2. Find the IP of the device running the receiver.
|
||||
3. Open the video streaming application.
|
||||
4. Open the casting dialog.
|
||||
5. Click add to manually add a device.
|
||||
6. Select the FCast protocol, enter a descriptive name, the IP you found and port 46899.
|
||||
7. Click start to connect to the device.
|
||||
8. Start watching content.
|
||||
|
||||

|
||||
|
||||
# How to build
|
||||
|
||||
## Preparing for build
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Run the following commands in the `/app/receivers/electron` directory.
|
||||
* Build: `npm run build`
|
||||
* Run: `npm run start`
|
||||
|
||||
## 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"`
|
||||
|
||||
Other platforms and architectures supported by [Electron Forge](https://www.electronforge.io/) might work, but are currently untested.
|
||||
|
||||
Packages that will be built from running the above `make` commands:
|
||||
* Windows: `.msi` and `.zip`
|
||||
* MacOS: `.dmg` and `.zip`
|
||||
* Linux: `.deb`, `.rpm` and `.zip`
|
||||
|
||||
Package artifacts will be located in `/app/receivers/electron/out/make`
|
13
receivers/webos/fcast-receiver/appinfo.json
Normal file
13
receivers/webos/fcast-receiver/appinfo.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"id": "com.futo.fcast.receiver",
|
||||
"version": "1.0.0",
|
||||
"vendor": "FUTO",
|
||||
"type": "web",
|
||||
"main": "main_window/index.html",
|
||||
"title": "FCast Receiver",
|
||||
"appDescription": "FCast Receiver",
|
||||
"icon": "assets/icons/icon.png",
|
||||
"largeIcon": "assets/icons/largeIcon.png",
|
||||
"iconColor": "#0a62f5",
|
||||
"splashBackground": "assets/images/splash.png"
|
||||
}
|
BIN
receivers/webos/fcast-receiver/assets/icons/icon.png
Normal file
BIN
receivers/webos/fcast-receiver/assets/icons/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
BIN
receivers/webos/fcast-receiver/assets/icons/largeIcon.png
Normal file
BIN
receivers/webos/fcast-receiver/assets/icons/largeIcon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
BIN
receivers/webos/fcast-receiver/assets/images/splash.png
Normal file
BIN
receivers/webos/fcast-receiver/assets/images/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 251 KiB |
11
receivers/webos/fcast-receiver/eslint.config.mjs
Normal file
11
receivers/webos/fcast-receiver/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,
|
||||
];
|
6
receivers/webos/fcast-receiver/jest.config.js
Normal file
6
receivers/webos/fcast-receiver/jest.config.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['<rootDir>/test/**/*.test.ts'],
|
||||
modulePathIgnorePatterns: ["<rootDir>/packaging/fcast/fcast-receiver-linux-x64/resources/app/package.json"],
|
||||
};
|
|
@ -0,0 +1,202 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7181
receivers/webos/fcast-receiver/package-lock.json
generated
Normal file
7181
receivers/webos/fcast-receiver/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
46
receivers/webos/fcast-receiver/package.json
Normal file
46
receivers/webos/fcast-receiver/package.json
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "com.futo.fcast.receiver",
|
||||
"version": "1.0.0",
|
||||
"description": "An application implementing a FCast receiver.",
|
||||
"author": "FUTO",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "rm -rf dist/ && webpack --config ./webpack.config.js",
|
||||
"test": "jest",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.10.0",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/mdns": "^0.0.38",
|
||||
"@types/node-forge": "^1.3.10",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/webostvjs": "^1.2.6",
|
||||
"@types/workerpool": "^6.1.1",
|
||||
"@types/ws": "^8.5.10",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"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": "^5.5.4",
|
||||
"typescript-eslint": "^8.4.0",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"bufferutil": "^4.0.8",
|
||||
"dashjs": "^4.7.4",
|
||||
"hls.js": "^1.5.15",
|
||||
"http": "^0.0.1-security",
|
||||
"https": "^1.0.0",
|
||||
"log4js": "^6.9.1",
|
||||
"qrcode": "^1.5.3",
|
||||
"url": "^0.11.3",
|
||||
"uuid": "^9.0.1",
|
||||
"ws": "^8.14.2"
|
||||
}
|
||||
}
|
1
receivers/webos/fcast-receiver/src/main/Preload.ts
Normal file
1
receivers/webos/fcast-receiver/src/main/Preload.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import 'common/main/Preload';
|
1
receivers/webos/fcast-receiver/src/main/Renderer.ts
Normal file
1
receivers/webos/fcast-receiver/src/main/Renderer.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import 'common/main/Renderer';
|
51
receivers/webos/fcast-receiver/src/main/index.html
Normal file
51
receivers/webos/fcast-receiver/src/main/index.html
Normal file
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>FCast Receiver</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../assets/fonts/outfit.css" />
|
||||
<link rel="stylesheet" href="../assets/fonts/inter.css" />
|
||||
<link rel="stylesheet" href="./common.css" />
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
<script src="./preload.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main-container">
|
||||
<video id="video-player" class="video" autoplay loop>
|
||||
<source src="../assets/video/background.mp4" type="video/mp4">
|
||||
</video>
|
||||
<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="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>
|
||||
<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 in the background when app is closed</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="./renderer.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
23
receivers/webos/fcast-receiver/src/main/style.css
Normal file
23
receivers/webos/fcast-receiver/src/main/style.css
Normal file
|
@ -0,0 +1,23 @@
|
|||
.card-title {
|
||||
font-family: InterBold;
|
||||
}
|
||||
|
||||
#overlay {
|
||||
font-family: InterRegular;
|
||||
}
|
||||
|
||||
#title-text {
|
||||
font-family: OutfitExtraBold;
|
||||
}
|
||||
|
||||
#manual-connection-info {
|
||||
font-family: InterBold;
|
||||
}
|
||||
|
||||
#scan-to-connect {
|
||||
font-family: InterBold;
|
||||
}
|
||||
|
||||
#window-can-be-closed {
|
||||
font-family: InterRegular;
|
||||
}
|
1
receivers/webos/fcast-receiver/src/player/Preload.ts
Normal file
1
receivers/webos/fcast-receiver/src/player/Preload.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import 'common/player/Preload';
|
20
receivers/webos/fcast-receiver/src/player/Renderer.ts
Normal file
20
receivers/webos/fcast-receiver/src/player/Renderer.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { onPlay, PlayerControlEvent } from 'common/player/Renderer';
|
||||
|
||||
export function targetPlayerCtrlStateUpdate(event: PlayerControlEvent) {
|
||||
switch (event) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function targetKeyDownEventListener(event: any) {
|
||||
switch (event.code) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
if (window.webOSAPI.pendingPlay !== null) {
|
||||
onPlay(null, window.webOSAPI.pendingPlay);
|
||||
}
|
90
receivers/webos/fcast-receiver/src/player/index.html
Normal file
90
receivers/webos/fcast-receiver/src/player/index.html
Normal file
|
@ -0,0 +1,90 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>FCast Receiver</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../assets/fonts/inter.css" />
|
||||
<link rel="stylesheet" href="./common.css" />
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
<script src="./preload.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<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
receivers/webos/fcast-receiver/src/player/style.css
Normal file
1
receivers/webos/fcast-receiver/src/player/style.css
Normal file
|
@ -0,0 +1 @@
|
|||
/* WebOS custom player styles */
|
22
receivers/webos/fcast-receiver/tsconfig.json
Normal file
22
receivers/webos/fcast-receiver/tsconfig.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": false,
|
||||
"emitDecoratorMetadata": true,
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"removeComments": false,
|
||||
"noImplicitAny": false,
|
||||
"outDir": "dist",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"src/*": ["./src/*"],
|
||||
"lib/*": ["./lib/*"],
|
||||
"modules/*": ["./node_modules/*"],
|
||||
"common/*": ["../../common/web/*"],
|
||||
}
|
||||
},
|
||||
"exclude": [ "node_modules", "test" ]
|
||||
}
|
132
receivers/webos/fcast-receiver/webpack.config.js
Normal file
132
receivers/webos/fcast-receiver/webpack.config.js
Normal file
|
@ -0,0 +1,132 @@
|
|||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
|
||||
// Build issues:
|
||||
// * Must use '--no-minify' when packaging since packaging would break otherwise...
|
||||
// const buildMode = 'production';
|
||||
const buildMode = 'development';
|
||||
|
||||
// const TARGET = 'electron';
|
||||
const TARGET = 'webOS';
|
||||
// const TARGET = 'tizenOS';
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
mode: buildMode,
|
||||
entry: {
|
||||
preload: './src/main/Preload.ts',
|
||||
renderer: './src/main/Renderer.ts',
|
||||
},
|
||||
target: 'web',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: /src/,
|
||||
use: [{ loader: 'ts-loader' }]
|
||||
}
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'src': path.resolve(__dirname, 'src'),
|
||||
'lib': path.resolve(__dirname, 'lib'),
|
||||
'modules': path.resolve(__dirname, 'node_modules'),
|
||||
'common': path.resolve(__dirname, '../../common/web'),
|
||||
},
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
// NOTE: `dist/main` seems to be a reserved directory on the LGTV device??? Access denied errors otherwise when reading from main directory...
|
||||
path: path.resolve(__dirname, 'dist/main_window'),
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
// Common assets
|
||||
{
|
||||
from: '../common/assets/**',
|
||||
to: '../[path][name][ext]',
|
||||
context: path.resolve(__dirname, '..', '..', 'common'),
|
||||
globOptions: { ignore: ['**/*.txt'] }
|
||||
},
|
||||
{
|
||||
from: '../../common/web/main/common.css',
|
||||
to: '[name][ext]',
|
||||
},
|
||||
// Target assets
|
||||
{ from: 'appinfo.json', to: '../[name][ext]' },
|
||||
{
|
||||
from: '**',
|
||||
to: '../assets/[path][name][ext]',
|
||||
context: path.resolve(__dirname, 'assets'),
|
||||
},
|
||||
{
|
||||
from: '**',
|
||||
to: '../lib/[name][ext]',
|
||||
context: path.resolve(__dirname, 'lib'),
|
||||
globOptions: { ignore: ['**/*.txt'] }
|
||||
},
|
||||
{
|
||||
from: './src/main/*',
|
||||
to: '[name][ext]',
|
||||
globOptions: { ignore: ['**/*.ts'] }
|
||||
}
|
||||
],
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
TARGET: JSON.stringify(TARGET)
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
mode: buildMode,
|
||||
entry: {
|
||||
preload: './src/player/Preload.ts',
|
||||
renderer: './src/player/Renderer.ts',
|
||||
},
|
||||
target: 'web',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: /src/,
|
||||
use: [{ loader: 'ts-loader' }]
|
||||
}
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'src': path.resolve(__dirname, 'src'),
|
||||
'lib': path.resolve(__dirname, 'lib'),
|
||||
'modules': path.resolve(__dirname, 'node_modules'),
|
||||
'common': path.resolve(__dirname, '../../common/web'),
|
||||
},
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'dist/player'),
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: '../../common/web/player/common.css',
|
||||
to: '[name][ext]',
|
||||
},
|
||||
{
|
||||
from: './src/player/*',
|
||||
to: '[name][ext]',
|
||||
globOptions: { ignore: ['**/*.ts'] }
|
||||
}
|
||||
],
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
TARGET: JSON.stringify(TARGET)
|
||||
})
|
||||
]
|
||||
},
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue