mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-06-24 21:25:23 +00:00
Cleanup and initial submission changes
This commit is contained in:
parent
113e5707cd
commit
a0349c6edf
8 changed files with 1438 additions and 2039 deletions
1
receivers/tizen/.gitignore
vendored
1
receivers/tizen/.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
/.metadata/
|
/.metadata/
|
||||||
dist
|
dist
|
||||||
|
certs
|
||||||
|
|
||||||
.env
|
.env
|
||||||
FCastReceiver/.buildResult
|
FCastReceiver/.buildResult
|
||||||
|
|
|
@ -68,6 +68,7 @@ namespace FCastReceiverService
|
||||||
|
|
||||||
// Older Tizen models seem to throw exceptions when accessing standard .NET APIs for
|
// Older Tizen models seem to throw exceptions when accessing standard .NET APIs for
|
||||||
// Querying network interface information or using HttpListeners...
|
// Querying network interface information or using HttpListeners...
|
||||||
|
// May need to investigate further however, perhaps its only an issue when running in emulator
|
||||||
|
|
||||||
// No API to get Tizen version, so have to go by OS image build date...
|
// No API to get Tizen version, so have to go by OS image build date...
|
||||||
// Format: YYYYMMDD_HHMMSS
|
// Format: YYYYMMDD_HHMMSS
|
||||||
|
|
|
@ -1,33 +1,41 @@
|
||||||
# FCast WebOS Receiver
|
# FCast Tizen OS Receiver
|
||||||
|
|
||||||
The FCast WebOS Receiver is split into two separate projects `fcast-receiver` for frontend UI and `fcast-receiver-service` for the background network service. The WebOS receiver is supported running on TV devices from WebOS TV 5.0 and later.
|
The FCast Tizen OS Receiver is split into two separate projects `FCastReceiver` for frontend UI and `FCastReceiverService` for the background network service. The WebOS receiver is supported running on TV devices from Tizen OS 5.0 and later.
|
||||||
|
|
||||||
The TV receiver player is a simplified player compared to the Electron receiver due to functionality being redundant when using a TV remote control or due to platform limitations (https://gitlab.futo.org/videostreaming/fcast/-/issues/21).
|
The TV receiver player is using the same simplified player used in the webOS receiver implementation. Future versions might support a more advanced player like the Electron player since Tizen OS video player is less limited compared to webOS.
|
||||||
|
|
||||||
# How to build
|
# How to build
|
||||||
|
|
||||||
From `receivers/webos` directory:
|
## Preparing for build
|
||||||
|
|
||||||
## Prerequisites
|
A docker file is provided to setup your build environment. From the root of the repository:
|
||||||
```sh
|
|
||||||
npm install -g @webos-tools/cli
|
* **Build:**: `docker build -t fcast/receiver-tizen-dev:latest receivers/tizen`
|
||||||
cd fcast-receiver
|
**Run:**
|
||||||
npm install
|
```bash
|
||||||
cd ../fcast-receiver-service
|
docker run --rm -it -w /app/receivers/tizen --env-file=./receivers/tizen/.env \
|
||||||
npm install
|
--entrypoint='bash' -p 26099:26099 -p 26101:26101 -v .:/app \
|
||||||
cd ../
|
fcast/receiver-tizen-dev:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can then run the following commands to finish setup inside the docker container.
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
For signing the build artifact you must export the following environment variables or set them in your `.env` file:
|
||||||
|
```
|
||||||
|
CERT_PATH=/app/receivers/tizen/PATH_TO_CERTS
|
||||||
|
CERT_IDENTITY=YOUR_IDENTITY
|
||||||
|
CERT_AUTHOR_PASSWORD=YOUR_PASSWORD
|
||||||
|
CERT_DIST_PASSWORD=YOUR_PASSWORD
|
||||||
|
```
|
||||||
|
|
||||||
|
Directory structure should be as follows for storing certificates:
|
||||||
|
* Author certificates: `$CERT_PATH/author/$CERT_IDENTITY/author.p12`
|
||||||
|
* Distributor certificates: `$CERT_PATH/SamsungCertificate/$CERT_IDENTITY/distributor.p12`
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
```sh
|
|
||||||
cd fcast-receiver
|
|
||||||
npm run build
|
|
||||||
cd ../fcast-receiver-service
|
|
||||||
npm run build
|
|
||||||
cd ../
|
|
||||||
```
|
|
||||||
|
|
||||||
## Packaging
|
To build the `.wgt` package run `scripts/build.sh`. Build artifact will be located at `REPO_ROOT/receivers/tizen/FCastReceiver/.buildResult/FCastReceiver.wgt`.
|
||||||
```sh
|
|
||||||
ares-package fcast-receiver/dist/ fcast-receiver-service/dist/ --no-minify
|
|
||||||
```
|
|
||||||
|
|
3366
receivers/tizen/package-lock.json
generated
3366
receivers/tizen/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -15,16 +15,16 @@ cd .buildResult
|
||||||
# it has to be regenerated on every packaging...
|
# it has to be regenerated on every packaging...
|
||||||
# https://stackoverflow.com/a/61718469
|
# https://stackoverflow.com/a/61718469
|
||||||
|
|
||||||
tizen security-profiles add --active --force --name default --author $CERT_PATH/author/default/author.p12 --password $CERT_AUTHOR_PASSWORD --dist $CERT_PATH/SamsungCertificate/default/distributor.p12 --dist-password $CERT_DIST_PASSWORD
|
tizen security-profiles add --active --force --name $CERT_IDENTITY --author $CERT_PATH/author/$CERT_IDENTITY/author.p12 --password $CERT_AUTHOR_PASSWORD --dist $CERT_PATH/SamsungCertificate/$CERT_IDENTITY/distributor.p12 --dist-password $CERT_DIST_PASSWORD
|
||||||
tizen cli-config "profiles.path=/home/ubuntu/tizen-studio-data/profile/profiles.xml"
|
tizen cli-config "profiles.path=/home/ubuntu/tizen-studio-data/profile/profiles.xml"
|
||||||
sed -i "s|$CERT_PATH/author/default/author.pwd|$CERT_AUTHOR_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
sed -i "s|$CERT_PATH/author/$CERT_IDENTITY/author.pwd|$CERT_AUTHOR_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
||||||
sed -i "s|$CERT_PATH/SamsungCertificate/default/distributor.pwd|$CERT_DIST_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
sed -i "s|$CERT_PATH/SamsungCertificate/$CERT_IDENTITY/distributor.pwd|$CERT_DIST_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
||||||
../../scripts/package.sh tizen package -t wgt -s default -- .
|
../../scripts/package.sh tizen package -t wgt -s $CERT_IDENTITY -- .
|
||||||
|
|
||||||
tizen security-profiles add --active --force --name default --author $CERT_PATH/author/default/author.p12 --password $CERT_AUTHOR_PASSWORD --dist $CERT_PATH/SamsungCertificate/default/distributor.p12 --dist-password $CERT_DIST_PASSWORD
|
tizen security-profiles add --active --force --name $CERT_IDENTITY --author $CERT_PATH/author/$CERT_IDENTITY/author.p12 --password $CERT_AUTHOR_PASSWORD --dist $CERT_PATH/SamsungCertificate/$CERT_IDENTITY/distributor.p12 --dist-password $CERT_DIST_PASSWORD
|
||||||
tizen cli-config "profiles.path=/home/ubuntu/tizen-studio-data/profile/profiles.xml"
|
tizen cli-config "profiles.path=/home/ubuntu/tizen-studio-data/profile/profiles.xml"
|
||||||
sed -i "s|$CERT_PATH/author/default/author.pwd|$CERT_AUTHOR_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
sed -i "s|$CERT_PATH/author/$CERT_IDENTITY/author.pwd|$CERT_AUTHOR_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
||||||
sed -i "s|$CERT_PATH/SamsungCertificate/default/distributor.pwd|$CERT_DIST_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
sed -i "s|$CERT_PATH/SamsungCertificate/$CERT_IDENTITY/distributor.pwd|$CERT_DIST_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
|
||||||
../../scripts/package.sh tizen package -t wgt -s default -r ../../FCastReceiverService/bin/Release/netcoreapp2.1/com.futo.FCastReceiverService-1.0.0.tpk -- FCastReceiver.wgt
|
../../scripts/package.sh tizen package -t wgt -s $CERT_IDENTITY -r ../../FCastReceiverService/bin/Release/netcoreapp2.1/com.futo.FCastReceiverService-1.0.0.tpk -- FCastReceiver.wgt
|
||||||
|
|
||||||
cd ../../
|
cd ../../
|
||||||
|
|
|
@ -8,20 +8,25 @@ const loadingScreen = document.getElementById('loading-screen');
|
||||||
var backgroundVideoLoaded: boolean;
|
var backgroundVideoLoaded: boolean;
|
||||||
// eslint-disable-next-line no-var
|
// eslint-disable-next-line no-var
|
||||||
var qrCodeRendered: boolean;
|
var qrCodeRendered: boolean;
|
||||||
|
// eslint-disable-next-line no-var
|
||||||
|
var loadPollCount = 0;
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-var
|
||||||
|
var loadScreenDone = setInterval(() => {
|
||||||
|
// Show main screen regardless if resources not loaded within 10s
|
||||||
|
if ((backgroundVideoLoaded && qrCodeRendered) || loadPollCount > 10) {
|
||||||
|
clearInterval(loadScreenDone);
|
||||||
|
loadingScreen.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
loadPollCount++;
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
backgroundVideo.onplaying = () => {
|
backgroundVideo.onplaying = () => {
|
||||||
backgroundVideoLoaded = true;
|
backgroundVideoLoaded = true;
|
||||||
|
|
||||||
if (backgroundVideoLoaded && qrCodeRendered) {
|
|
||||||
loadingScreen.style.display = 'none';
|
|
||||||
backgroundVideo.onplaying = null;
|
backgroundVideo.onplaying = null;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function onQRCodeRendered() {
|
export function onQRCodeRendered() {
|
||||||
qrCodeRendered = true;
|
qrCodeRendered = true;
|
||||||
|
|
||||||
if (backgroundVideoLoaded && qrCodeRendered) {
|
|
||||||
loadingScreen.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ preloadData.sendVolumeUpdateCb = (update: VolumeUpdateMessage) => {
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
let playerWindowOpen = false;
|
|
||||||
window.tizenOSAPI = {
|
window.tizenOSAPI = {
|
||||||
pendingPlay: JSON.parse(sessionStorage.getItem('playData'))
|
pendingPlay: JSON.parse(sessionStorage.getItem('playData'))
|
||||||
};
|
};
|
||||||
|
@ -55,10 +54,6 @@ const ipcListener = ipcPort.addMessagePortListener((data) => {
|
||||||
|
|
||||||
case 'play':
|
case 'play':
|
||||||
if (message !== null) {
|
if (message !== null) {
|
||||||
if (!playerWindowOpen) {
|
|
||||||
playerWindowOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (preloadData.onPlayCb === undefined) {
|
if (preloadData.onPlayCb === undefined) {
|
||||||
window.tizenOSAPI.pendingPlay = message;
|
window.tizenOSAPI.pendingPlay = message;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +72,6 @@ const ipcListener = ipcPort.addMessagePortListener((data) => {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'stop':
|
case 'stop':
|
||||||
playerWindowOpen = false;
|
|
||||||
window.open('../main_window/index.html', '_self');
|
window.open('../main_window/index.html', '_self');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ export function targetKeyDownEventListener(event: any): boolean {
|
||||||
|
|
||||||
switch (event.keyCode) {
|
switch (event.keyCode) {
|
||||||
case RemoteKeyCode.Stop:
|
case RemoteKeyCode.Stop:
|
||||||
window.open('../main_window/index.html');
|
window.open('../main_window/index.html', '_self');
|
||||||
handledCase = true;
|
handledCase = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ export function targetKeyDownEventListener(event: any): boolean {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RemoteKeyCode.Back:
|
case RemoteKeyCode.Back:
|
||||||
window.open('../main_window/index.html');
|
window.open('../main_window/index.html', '_self');
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handledCase = true;
|
handledCase = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue