1
0
Fork 0
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:
Michael Hollister 2025-02-20 00:09:24 -06:00
parent 113e5707cd
commit a0349c6edf
8 changed files with 1438 additions and 2039 deletions

View file

@ -1,5 +1,6 @@
/.metadata/
dist
certs
.env
FCastReceiver/.buildResult

View file

@ -27,7 +27,7 @@ namespace FCastReceiverService
protected override void OnCreate()
{
base.OnCreate();
Serilog.Log.Information($"Starting: {Program.Current.ApplicationInfo.ApplicationId}");
Serilog.Log.Information($"Version: 1.0.0");
Serilog.Log.Information($"Manufacturer: {SystemInformation.Manufacturer}");
@ -68,6 +68,7 @@ namespace FCastReceiverService
// Older Tizen models seem to throw exceptions when accessing standard .NET APIs for
// 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...
// Format: YYYYMMDD_HHMMSS

View file

@ -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
From `receivers/webos` directory:
## Preparing for build
## Prerequisites
```sh
npm install -g @webos-tools/cli
cd fcast-receiver
npm install
cd ../fcast-receiver-service
npm install
cd ../
A docker file is provided to setup your build environment. From the root of the repository:
* **Build:**: `docker build -t fcast/receiver-tizen-dev:latest receivers/tizen`
**Run:**
```bash
docker run --rm -it -w /app/receivers/tizen --env-file=./receivers/tizen/.env \
--entrypoint='bash' -p 26099:26099 -p 26101:26101 -v .:/app \
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
```sh
cd fcast-receiver
npm run build
cd ../fcast-receiver-service
npm run build
cd ../
```
## Packaging
```sh
ares-package fcast-receiver/dist/ fcast-receiver-service/dist/ --no-minify
```
To build the `.wgt` package run `scripts/build.sh`. Build artifact will be located at `REPO_ROOT/receivers/tizen/FCastReceiver/.buildResult/FCastReceiver.wgt`.

File diff suppressed because it is too large Load diff

View file

@ -15,16 +15,16 @@ cd .buildResult
# it has to be regenerated on every packaging...
# 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"
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/SamsungCertificate/default/distributor.pwd|$CERT_DIST_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
../../scripts/package.sh tizen package -t wgt -s default -- .
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/$CERT_IDENTITY/distributor.pwd|$CERT_DIST_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
../../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"
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/SamsungCertificate/default/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
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/$CERT_IDENTITY/distributor.pwd|$CERT_DIST_PASSWORD|g" /home/ubuntu/tizen-studio-data/profile/profiles.xml
../../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 ../../

View file

@ -8,20 +8,25 @@ const loadingScreen = document.getElementById('loading-screen');
var backgroundVideoLoaded: boolean;
// eslint-disable-next-line no-var
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 = () => {
backgroundVideoLoaded = true;
if (backgroundVideoLoaded && qrCodeRendered) {
loadingScreen.style.display = 'none';
backgroundVideo.onplaying = null;
}
backgroundVideo.onplaying = null;
};
export function onQRCodeRendered() {
qrCodeRendered = true;
if (backgroundVideoLoaded && qrCodeRendered) {
loadingScreen.style.display = 'none';
}
}

View file

@ -14,7 +14,7 @@ preloadData.sendPlaybackErrorCb = (error: PlaybackErrorMessage) => {
{ key: 'data', value: JSON.stringify(error) }
]);
};
preloadData.sendPlaybackUpdateCb = (update: PlaybackUpdateMessage) => {
preloadData.sendPlaybackUpdateCb = (update: PlaybackUpdateMessage) => {
servicePort.sendMessage([
{ key: 'opcode', value: Opcode.PlaybackUpdate.toString() },
{ key: 'data', value: JSON.stringify(update) }
@ -27,7 +27,6 @@ preloadData.sendVolumeUpdateCb = (update: VolumeUpdateMessage) => {
]);
};
let playerWindowOpen = false;
window.tizenOSAPI = {
pendingPlay: JSON.parse(sessionStorage.getItem('playData'))
};
@ -55,10 +54,6 @@ const ipcListener = ipcPort.addMessagePortListener((data) => {
case 'play':
if (message !== null) {
if (!playerWindowOpen) {
playerWindowOpen = true;
}
if (preloadData.onPlayCb === undefined) {
window.tizenOSAPI.pendingPlay = message;
}
@ -77,7 +72,6 @@ const ipcListener = ipcPort.addMessagePortListener((data) => {
break;
case 'stop':
playerWindowOpen = false;
window.open('../main_window/index.html', '_self');
break;

View file

@ -95,7 +95,7 @@ export function targetKeyDownEventListener(event: any): boolean {
switch (event.keyCode) {
case RemoteKeyCode.Stop:
window.open('../main_window/index.html');
window.open('../main_window/index.html', '_self');
handledCase = true;
break;
@ -142,7 +142,7 @@ export function targetKeyDownEventListener(event: any): boolean {
break;
case RemoteKeyCode.Back:
window.open('../main_window/index.html');
window.open('../main_window/index.html', '_self');
event.preventDefault();
handledCase = true;
break;