Skip to content

Commit 097b393

Browse files
committed
Create hosted Tizen WGT wrapper
0 parents  commit 097b393

10 files changed

Lines changed: 479 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build Tizen Release Asset
2+
3+
on:
4+
repository_dispatch:
5+
types: [build-release]
6+
workflow_dispatch:
7+
inputs:
8+
source_repo:
9+
description: Shared source repository, owner/name
10+
required: true
11+
tag:
12+
description: Release tag to build
13+
required: true
14+
rebuild_tizen:
15+
description: Rebuild hosted Tizen asset instead of reusing the previous release asset
16+
required: false
17+
default: "false"
18+
19+
jobs:
20+
build-wgt:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
env:
25+
SOURCE_REPO: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.source_repo || inputs.source_repo }}
26+
SOURCE_TAG: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.tag || inputs.tag }}
27+
REBUILD_TIZEN: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.rebuild_tizen || inputs.rebuild_tizen || 'false' }}
28+
steps:
29+
- name: Check out hosted Tizen wrapper repository
30+
uses: actions/checkout@v4
31+
32+
- name: Resolve effective build mode
33+
id: mode
34+
env:
35+
GH_TOKEN: ${{ secrets.MAIN_REPO_RELEASE_TOKEN }}
36+
run: |
37+
if [ "$REBUILD_TIZEN" = "true" ]; then
38+
echo "rebuild=true" >> "$GITHUB_OUTPUT"
39+
exit 0
40+
fi
41+
42+
PREVIOUS_TAG=$(gh release list --repo "$SOURCE_REPO" --exclude-drafts --exclude-pre-releases --limit 20 --json tagName | node -e "const fs=require('fs');const releases=JSON.parse(fs.readFileSync(0,'utf8'));const current=process.env.SOURCE_TAG;const match=releases.find((release)=>release.tagName!==current);if(!match){process.exit(1)}process.stdout.write(match.tagName);" 2>/dev/null || true)
43+
if [ -n "$PREVIOUS_TAG" ] && gh release download "$PREVIOUS_TAG" --repo "$SOURCE_REPO" --pattern "NuvioTV-Tizen-*.wgt" --dir .; then
44+
echo "rebuild=false" >> "$GITHUB_OUTPUT"
45+
else
46+
echo "No previous reusable Tizen WGT found; rebuilding wrapper"
47+
echo "rebuild=true" >> "$GITHUB_OUTPUT"
48+
fi
49+
50+
- name: Set up Node.js
51+
if: ${{ steps.mode.outputs.rebuild == 'true' }}
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 20
55+
cache: npm
56+
57+
- name: Install dependencies
58+
if: ${{ steps.mode.outputs.rebuild == 'true' }}
59+
run: npm ci
60+
61+
- name: Package hosted Tizen WGT
62+
if: ${{ steps.mode.outputs.rebuild == 'true' }}
63+
run: npm run package
64+
65+
- name: Normalize WGT asset name
66+
run: |
67+
PACKAGE_FILE=$(ls NuvioTV-Tizen-*.wgt | head -n 1)
68+
TARGET_FILE="NuvioTV-Tizen-${SOURCE_TAG}.wgt"
69+
if [ ! -f "$PACKAGE_FILE" ]; then
70+
echo "No WGT found to normalize: $PACKAGE_FILE"
71+
exit 1
72+
fi
73+
rm -f "$TARGET_FILE"
74+
mv "$PACKAGE_FILE" "$TARGET_FILE"
75+
76+
- name: Upload WGT to shared release
77+
env:
78+
GH_TOKEN: ${{ secrets.MAIN_REPO_RELEASE_TOKEN }}
79+
run: |
80+
gh release upload "$SOURCE_TAG" "NuvioTV-Tizen-${SOURCE_TAG}.wgt" --repo "$SOURCE_REPO" --clobber

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
.cache/
3+
*.wgt

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div align="center">
2+
3+
<img src="https://github.com/tapframe/NuvioTV/raw/dev/assets/brand/app_logo_wordmark.png" alt="NuvioTV Tizen Hosted" width="300" />
4+
<br />
5+
<br />
6+
7+
<p>
8+
Lightweight <b>hosted Tizen wrapper</b> for Nuvio TV.
9+
<br />
10+
Hosted TV launcher • Standalone WGT build • Minimal packaging layer
11+
</p>
12+
13+
<p>
14+
⚠️ <b>Status: BETA</b> — experimental and may be unstable.
15+
</p>
16+
17+
</div>
18+
19+
## About
20+
21+
**NuvioTizen** is a tiny Samsung Tizen wrapper that opens the hosted Nuvio TV web app as a standalone WGT.
22+
23+
It is not the main application source code. This project only contains the launcher shell and packaging workflow for the hosted experience.
24+
25+
## Build
26+
27+
```bash
28+
npm install
29+
npm run package
30+
```
31+
32+
That creates `NuvioTV-Tizen-VERSION.wgt` in the project root.
33+
34+
## Release Automation
35+
36+
- This repo can build on `repository_dispatch` `build-release`
37+
- The workflow builds a hosted WGT and uploads it to the shared source release
38+
39+
## For Developers
40+
41+
- Main shared app source: `NuvioMedia/NuvioWeb`
42+
- Hosted app URL is defined in `main.js`
43+
- Tizen widget metadata is defined in `config.xml`
44+
- WGT packaging logic is in `scripts/package-hosted-tizen.mjs`

config.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="https://nuvio.tv" version="0.1.0" viewmodes="maximized">
3+
<access origin="*" subdomains="true"/>
4+
<tizen:application id="NuvioTVH01.NuvioTVHosted" package="NuvioTVH01" required_version="3.0"/>
5+
<author href="https://nuvio.tv">Nuvio</author>
6+
<content src="index.html"/>
7+
<feature name="http://tizen.org/feature/screen.size.all"/>
8+
<icon src="icon.png"/>
9+
<name>Nuvio TV</name>
10+
<tizen:privilege name="http://tizen.org/privilege/internet"/>
11+
<tizen:privilege name="http://developer.samsung.com/privilege/network.public"/>
12+
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
13+
<tizen:profile name="tv-samsung"/>
14+
<tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
15+
</widget>

icon.png

71.3 KB
Loading

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=1920, height=1080, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
7+
<title>Nuvio TV</title>
8+
</head>
9+
<body>
10+
<script src="main.js"></script>
11+
</body>
12+
</html>

main.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
(function openHostedNuvioTv() {
2+
var hostedAppUrl = "https://web.nuvioapp.space/";
3+
var tvInput = window.tizen && window.tizen.tvinputdevice;
4+
5+
function buildFreshHostedUrl() {
6+
try {
7+
var url = new URL(hostedAppUrl);
8+
url.searchParams.set("source", "tizen-hosted");
9+
url.searchParams.set("wrapper", "tizen");
10+
url.searchParams.set("_cb", String(Date.now()));
11+
return url.toString();
12+
} catch (_) {
13+
return hostedAppUrl + "?_cb=" + encodeURIComponent(String(Date.now()));
14+
}
15+
}
16+
17+
if (tvInput && typeof tvInput.registerKey === "function") {
18+
[
19+
"Back",
20+
"Return",
21+
"MediaPlay",
22+
"MediaPause",
23+
"MediaPlayPause",
24+
"MediaStop",
25+
"MediaFastForward",
26+
"MediaRewind",
27+
"MediaTrackPrevious",
28+
"MediaTrackNext"
29+
].forEach(function registerKey(keyName) {
30+
try {
31+
tvInput.registerKey(keyName);
32+
} catch (_) {}
33+
});
34+
}
35+
36+
window.location.replace(buildFreshHostedUrl());
37+
}());

package-lock.json

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "nuvio-tizen-hosted",
3+
"private": true,
4+
"type": "module",
5+
"version": "0.1.0",
6+
"description": "Hosted standalone Tizen WGT wrapper for Nuvio TV",
7+
"scripts": {
8+
"package": "node ./scripts/package-hosted-tizen.mjs"
9+
},
10+
"dependencies": {
11+
"jszip": "^3.10.1"
12+
}
13+
}

0 commit comments

Comments
 (0)