diff --git a/.vscode/launch.json b/.vscode/launch.json index dd61863e..8aa49f64 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -76,6 +76,29 @@ "args": "--log-level info --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc", "cwd": "${workspaceFolder}/playlet-lib", "console": "integratedTerminal" + }, + { + "name": "Playground", + "type": "brightscript", + "request": "launch", + "envFile": "${workspaceFolder}/.env", + "host": "${env:ROKU_DEV_TARGET}", + "password": "${env:ROKU_DEVPASSWORD}", + "stopOnEntry": false, + "enableDebuggerAutoRecovery": false, + "stopDebuggerOnAppExit": false, + "rootDir": "${workspaceFolder}/build/playground", + "sourceDirs": [ + "${workspaceFolder}/playground/src" + ], + "files": [ + "**" + ], + "preLaunchTask": "build-playground", + "injectRdbOnDeviceComponent": true, + "injectRaleTrackerTask": true, + "raleTrackerTaskFileLocation": "${workspaceFolder}/tools/RALE/TrackerTask.xml", + "enableDebugProtocol": true } ], "compounds": [ diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0f7d4020..a86492cf 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -49,6 +49,11 @@ "label": "build-web", "script": "build:web", "type": "npm" + }, + { + "label": "build-playground", + "script": "build:playground", + "type": "npm" } ] } \ No newline at end of file diff --git a/package.json b/package.json index 3b53c0e3..e10f7625 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "build:lib:dev": "cd playlet-lib && npm run build:dev", "build:lib:prod": "cd playlet-lib && npm run build:prod", "build:web": "cd playlet-web && npm run build", + "build:playground": "cd playground && npm run build", "lint": "cd playlet-lib && npm run lint && cd ../playlet-app && npm run lint && cd ../playlet-web && npm run lint", "lint:fix": "cd playlet-lib && npm run lint:fix && cd ../playlet-app && npm run lint:fix && cd ../playlet-web && npm run lint", "format": "cd playlet-lib && npm run format && cd ../playlet-app && npm run format", diff --git a/playground/bsconfig.json b/playground/bsconfig.json new file mode 100644 index 00000000..1ad95d98 --- /dev/null +++ b/playground/bsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../config/bsconfig.base.jsonc", + "rootDir": "src/", + "stagingDir": "../build/playground", + "outFile": "../dist/playground.zip" +} \ No newline at end of file diff --git a/playground/bsconfig.lint.json b/playground/bsconfig.lint.json new file mode 100644 index 00000000..df682fae --- /dev/null +++ b/playground/bsconfig.lint.json @@ -0,0 +1,7 @@ +{ + "extends": "bsconfig.json", + "createPackage": false, + "deploy": false, + "retainStagingDir": false, + "sourceMap": false +} \ No newline at end of file diff --git a/playground/bsconfig.tests.json b/playground/bsconfig.tests.json new file mode 100644 index 00000000..6751f6dc --- /dev/null +++ b/playground/bsconfig.tests.json @@ -0,0 +1,6 @@ +{ + "extends": "../config/bsconfig.tests.base.jsonc", + "rootDir": "src/", + "stagingDir": "../build/playground-tests", + "outFile": "../build/playground-tests.zip" +} \ No newline at end of file diff --git a/playground/package.json b/playground/package.json new file mode 100644 index 00000000..6ad62aed --- /dev/null +++ b/playground/package.json @@ -0,0 +1,17 @@ +{ + "name": "playground", + "version": "0.1.0", + "description": "A playground for testing Roku development", + "scripts": { + "prebuild": "node ../tools/rm.js ../build/playground", + "build": "bsc --debug --create-package --sourceMap=true --lintConfig ../config/bslint.jsonc", + "lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc", + "lint:fix": "npm run lint -- --fix", + "format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" --bsfmt-path ../config/bsfmt.jsonc", + "format": "npm run format:base -- --check", + "format:fix": "npm run format:base -- --write", + "test": "npm run test:build && npm run test:run", + "test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc", + "test:run": "node ../tools/run-test-app.js --package ../build/playground-tests.zip" + } +} \ No newline at end of file diff --git a/playground/src/components/Playground.bs b/playground/src/components/Playground.bs new file mode 100644 index 00000000..0c357608 --- /dev/null +++ b/playground/src/components/Playground.bs @@ -0,0 +1,3 @@ +function Init() + print "Playground Init" +end function diff --git a/playground/src/components/Playground.xml b/playground/src/components/Playground.xml new file mode 100644 index 00000000..ee759b9c --- /dev/null +++ b/playground/src/components/Playground.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/playground/src/images/channel-poster_fhd.png b/playground/src/images/channel-poster_fhd.png new file mode 100644 index 00000000..c9f3a973 Binary files /dev/null and b/playground/src/images/channel-poster_fhd.png differ diff --git a/playground/src/images/channel-poster_hd.png b/playground/src/images/channel-poster_hd.png new file mode 100644 index 00000000..d8ca561e Binary files /dev/null and b/playground/src/images/channel-poster_hd.png differ diff --git a/playground/src/images/channel-poster_sd.png b/playground/src/images/channel-poster_sd.png new file mode 100644 index 00000000..3a36dd1d Binary files /dev/null and b/playground/src/images/channel-poster_sd.png differ diff --git a/playground/src/images/splash-screen_fhd.jpg b/playground/src/images/splash-screen_fhd.jpg new file mode 100644 index 00000000..877df163 Binary files /dev/null and b/playground/src/images/splash-screen_fhd.jpg differ diff --git a/playground/src/images/splash-screen_hd.jpg b/playground/src/images/splash-screen_hd.jpg new file mode 100644 index 00000000..5ce35d9f Binary files /dev/null and b/playground/src/images/splash-screen_hd.jpg differ diff --git a/playground/src/images/splash-screen_sd.jpg b/playground/src/images/splash-screen_sd.jpg new file mode 100644 index 00000000..832dbb4f Binary files /dev/null and b/playground/src/images/splash-screen_sd.jpg differ diff --git a/playground/src/manifest b/playground/src/manifest new file mode 100644 index 00000000..781661a1 --- /dev/null +++ b/playground/src/manifest @@ -0,0 +1,31 @@ +title=Playlet Playground + +major_version=0 +minor_version=1 +build_version=00000 + +ui_resolutions=hd +uri_resolution_autosub=$$RES$$,480p,720p,1080p + +## Channel Assets +### Main Menu Icons / Channel Poster Artwork +#### Image sizes are FHD: 540x405px | HD: 290x218px | SD: 246x140px +mm_icon_focus_fhd=pkg:/images/channel-poster_fhd.png +mm_icon_focus_hd=pkg:/images/channel-poster_hd.png +mm_icon_focus_sd=pkg:/images/channel-poster_sd.png + +### Splash Screen + Loading Screen Artwork +#### Image sizes are FHD: 1920x1080px | HD: 1280x720px | SD: 720x480px +splash_screen_fhd=pkg:/images/splash-screen_fhd.jpg +splash_screen_hd=pkg:/images/splash-screen_hd.jpg +splash_screen_sd=pkg:/images/splash-screen_sd.jpg + +splash_color=#242424 +splash_min_time=0 + +confirm_partner_button=1 + +supports_input_launch=1 + +requires_widevine_drm=1 +requires_widevine_version=1.0 diff --git a/playground/src/source/Main.bs b/playground/src/source/Main.bs new file mode 100644 index 00000000..ce91a659 --- /dev/null +++ b/playground/src/source/Main.bs @@ -0,0 +1,56 @@ +' Playlet (App to play videos from an Invidious server on Roku TVs) +' Copyright (C) 2025 Brahim Hadriche + +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU Affero 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 Affero General Public License for more details. + +' You should have received a copy of the GNU Affero General Public License +' along with this program. If not, see . + +function Main(args as object) as void + screen = CreateObject("roSGScreen") + port = CreateObject("roMessagePort") + screen.setMessagePort(port) + + scene = screen.CreateScene("Playground") + screen.show() + + scene.ObserveField("exitChannel", port) + scene.launchArgs = args + + input = CreateObject("roInput") + input.setMessagePort(port) + + ' The following comment is to enable the SceneGraph inspector + ' on the VSCode BrightScript plugin. + ' vscode_rdb_on_device_component_entry + + ' The following comment is to enable RALE tracking + ' vscode_rale_tracker_entry + + while true + msg = wait(0, port) + msgType = type(msg) + if msgType = "roSGScreenEvent" + if msg.isScreenClosed() + return + end if + else if msgType = "roSGNodeEvent" + field = msg.getField() + data = msg.getData() + if field = "exitChannel" and data = true + return + end if + else if msgType = "roInputEvent" + scene.inputArgs = msg.getInfo() + end if + end while + +end function