Compare commits

..
23 Commits
Author SHA1 Message Date
Brahim Hadriche e67dd2fa4b Release v0.25.0 (#428) 2024-07-22 13:02:34 -04:00
Brahim Hadriche 5a379247c7 Add video size to dash manifest 2024-07-22 12:56:20 -04:00
Brahim Hadriche ac36d11930 update dependencies (#426) 2024-07-19 21:10:38 -04:00
Brahim Hadriche 33ad151991 [skip ci] update readme screenshots link 2024-07-14 23:05:08 -04:00
Brahim Hadriche 1e8da4e84b [skip ci] update readme screenshots link 2024-07-14 23:04:24 -04:00
Brahim Hadriche ce410cfd5d [skip ci] update loading message 2024-07-12 22:43:04 -04:00
Brahim Hadriche 4585149675 update dependencies (#424) 2024-07-12 22:03:06 -04:00
Brahim Hadriche 4991c42507 Added sort options to channel live streams 2024-07-10 23:11:34 -04:00
Brahim Hadriche 37f049867d [skip ci] add todo 2024-07-10 22:49:23 -04:00
Brahim Hadriche 1494d85dad Handle different disabled endpoints 2024-07-10 17:11:01 -04:00
Brahim Hadriche 8f2bdbfa07 Move GetLastExitInfo call to playlet app 2024-07-08 08:50:57 -04:00
Brahim Hadriche f5befe3ccc [skip ci] typo 2024-07-08 08:15:12 -04:00
Brahim Hadriche 59d640b14e Release v0.24.6 (#423) 2024-07-08 08:09:45 -04:00
Brahim Hadriche 65509298a3 Fix for removing invalid playlists from bookmarks (#422) 2024-07-07 11:13:14 -04:00
Brahim Hadriche d915efd2b1 update dependencies (#420) 2024-07-05 21:39:33 -04:00
Brahim Hadriche 27fc34338d Basic state machine for dev player 2024-07-05 21:38:45 -04:00
Brahim Hadriche 84a860cd6c [skip ci] Update README.md 2024-07-05 11:50:50 -04:00
Brahim Hadriche a1a3ce686e dev player small tweak 2024-07-04 22:09:19 -04:00
Brahim Hadriche e229a8e929 bug fix for dev player 2024-07-04 17:30:17 -04:00
Brahim Hadriche b9b97c67fd Pip state machine for dev player 2024-07-04 17:30:06 -04:00
Brahim Hadriche 37b3e88b93 Background poster in dev player 2024-07-04 13:59:57 -04:00
Brahim Hadriche 38e8856b09 [skip ci] small fix for locale validation 2024-07-04 12:03:19 -04:00
Brahim Hadriche ebc5d81180 Fix video selection bug (#419)
* Fix video selection bug

* Refactor key handling

* comment
2024-07-04 11:16:09 -04:00
54 changed files with 827 additions and 489 deletions

No files matched your search

+14
View File
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.25.0] - 2024-07-22
## Added
- Sort options to channel live streams
- Video width and height to DASH manifest
## [0.24.6] - 2024-07-08
### Fixed
- A bug where the right video will not play if selected too quickly
- A bug where a bookmarked but deleted playlist can't be removed from bookmarks
## [0.24.5] - 2024-07-03 ## [0.24.5] - 2024-07-03
- Additional Spanish (Mexico) translations (Thanks to Jean Carton) - Additional Spanish (Mexico) translations (Thanks to Jean Carton)
+4 -4
View File
@@ -31,8 +31,8 @@ Playlet is an unofficial YouTube client for Roku 📺
<a href="./docs/screenshots/README.md"> <a href="./docs/screenshots/README.md">
| ![Home](docs/screenshots/home.jpg) | ![Search](docs/screenshots/search.jpg) | ![Settings](docs/screenshots/settings.jpg) | | [![Home](docs/screenshots/home.jpg)](docs/screenshots/README.md) | [![Search](docs/screenshots/search.jpg)](docs/screenshots/README.md) | [![Settings](docs/screenshots/settings.jpg)](docs/screenshots/README.md) |
| ---------------------------------- | -------------------------------------- | ------------------------------------------ | | ---------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------ |
</a> </a>
@@ -46,8 +46,8 @@ More under [Screenshots](./docs/screenshots/README.md)
- 🔥 No Ads (Not now, not ever) - 🔥 No Ads (Not now, not ever)
- 🕵️ No Tracking - 🕵️ No Tracking
- 🛡️ Privacy driven (uses Invidious backend) - 🛡️ Privacy driven (uses [Invidious](https://invidious.io/) backend)
- ⚔️ SponsorBlock integration (skips undesirable sections in videos) - ⚔️ [SponsorBlock](https://sponsor.ajay.app/) integration (skips undesirable sections in videos)
- 📱 Browse, search, and cast from phone using the YouTube app or the browser - 📱 Browse, search, and cast from phone using the YouTube app or the browser
- 🔮 Picture-in-picture mode - 🔮 Picture-in-picture mode
- ⚡ Fast! [Check out how we compare with the official YouTube app](https://youtu.be/qmSvA-QQW20) - ⚡ Fast! [Check out how we compare with the official YouTube app](https://youtu.be/qmSvA-QQW20)
+1 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info: info:
title: Playlet Web API title: Playlet Web API
version: 0.24.5 version: 0.25.0
description: description:
Playlet Web API is a RESTful API for controlling the Playlet app on Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can Roku devices. The API is intended to be used by the Playlet web app, but can
+44 -44
View File
@@ -1,18 +1,18 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.24.5", "version": "0.25.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet", "name": "playlet",
"version": "0.24.5", "version": "0.25.0",
"hasInstallScript": true, "hasInstallScript": true,
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.21", "@rokucommunity/bslint": "^0.8.21",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.14.9", "@types/node": "^20.14.11",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.67.3", "brighterscript": "0.67.3",
@@ -23,18 +23,18 @@
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.19.2", "express": "^4.19.2",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"glob": "^10.4.2", "glob": "^11.0.0",
"imap": "^0.8.19", "imap": "^0.8.19",
"ip": "^2.0.1", "ip": "^2.0.1",
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.7.1", "mailparser": "^3.7.1",
"roku-deploy": "^3.12.0", "roku-deploy": "^3.12.1",
"rooibos-roku": "5.12.0", "rooibos-roku": "5.12.0",
"rounded-rect-9patch": "^1.0.1", "rounded-rect-9patch": "^1.0.1",
"semver": "^7.6.2", "semver": "^7.6.3",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.5.2", "typescript": "^5.5.3",
"xml2js": "^0.6.2", "xml2js": "^0.6.2",
"yaml": "^2.4.5" "yaml": "^2.4.5"
}, },
@@ -514,9 +514,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.14.9", "version": "20.14.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz",
"integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
@@ -2457,23 +2457,23 @@
} }
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "10.4.2", "version": "11.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz",
"integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"foreground-child": "^3.1.0", "foreground-child": "^3.1.0",
"jackspeak": "^3.1.2", "jackspeak": "^4.0.1",
"minimatch": "^9.0.4", "minimatch": "^10.0.0",
"minipass": "^7.1.2", "minipass": "^7.1.2",
"package-json-from-dist": "^1.0.0", "package-json-from-dist": "^1.0.0",
"path-scurry": "^1.11.1" "path-scurry": "^2.0.0"
}, },
"bin": { "bin": {
"glob": "dist/esm/bin.mjs" "glob": "dist/esm/bin.mjs"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.18" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -2534,15 +2534,15 @@
} }
}, },
"node_modules/glob/node_modules/minimatch": { "node_modules/glob/node_modules/minimatch": {
"version": "9.0.4", "version": "10.0.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
"integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"brace-expansion": "^2.0.1" "brace-expansion": "^2.0.1"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.17" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -3001,15 +3001,15 @@
"dev": true "dev": true
}, },
"node_modules/jackspeak": { "node_modules/jackspeak": {
"version": "3.1.2", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz",
"integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@isaacs/cliui": "^8.0.2" "@isaacs/cliui": "^8.0.2"
}, },
"engines": { "engines": {
"node": ">=14" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -3223,12 +3223,12 @@
} }
}, },
"node_modules/lru-cache": { "node_modules/lru-cache": {
"version": "10.2.2", "version": "11.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz",
"integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "14 || >=16.14" "node": "20 || >=22"
} }
}, },
"node_modules/luxon": { "node_modules/luxon": {
@@ -3908,16 +3908,16 @@
"dev": true "dev": true
}, },
"node_modules/path-scurry": { "node_modules/path-scurry": {
"version": "1.11.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^10.2.0", "lru-cache": "^11.0.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" "minipass": "^7.1.2"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.18" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -4385,9 +4385,9 @@
} }
}, },
"node_modules/roku-deploy": { "node_modules/roku-deploy": {
"version": "3.12.0", "version": "3.12.1",
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.12.0.tgz", "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.12.1.tgz",
"integrity": "sha512-YiCZeQ+sEmFW9ZfXtMNH+/CBSHQ5deNZYWONM+s6gCEQsrz7kCMFPj5YEdgfqW+d2b8G1ve9GELHcSt2FsfM8g==", "integrity": "sha512-PEOdiFKGW1jrcoC9zjb+9kOWC/Q3eH7dzPvSi5kKignjNcyDiyJi+/wINwNrzw9SsxAVtw+NLvYueyZi9wQVsw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"chalk": "^2.4.2", "chalk": "^2.4.2",
@@ -4607,9 +4607,9 @@
} }
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "7.6.2", "version": "7.6.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
"integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"dev": true, "dev": true,
"bin": { "bin": {
"semver": "bin/semver.js" "semver": "bin/semver.js"
@@ -5120,9 +5120,9 @@
"dev": true "dev": true
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.5.2", "version": "5.5.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz",
"integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
+6 -6
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.24.5", "version": "0.25.0",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.21", "@rokucommunity/bslint": "^0.8.21",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.14.9", "@types/node": "^20.14.11",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.67.3", "brighterscript": "0.67.3",
@@ -17,18 +17,18 @@
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.19.2", "express": "^4.19.2",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"glob": "^10.4.2", "glob": "^11.0.0",
"imap": "^0.8.19", "imap": "^0.8.19",
"ip": "^2.0.1", "ip": "^2.0.1",
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.7.1", "mailparser": "^3.7.1",
"roku-deploy": "^3.12.0", "roku-deploy": "^3.12.1",
"rooibos-roku": "5.12.0", "rooibos-roku": "5.12.0",
"rounded-rect-9patch": "^1.0.1", "rounded-rect-9patch": "^1.0.1",
"semver": "^7.6.2", "semver": "^7.6.3",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.5.2", "typescript": "^5.5.3",
"xml2js": "^0.6.2", "xml2js": "^0.6.2",
"yaml": "^2.4.5" "yaml": "^2.4.5"
}, },
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.24.5", "version": "0.25.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-app", "name": "playlet-app",
"version": "0.24.5" "version": "0.25.0"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.24.5", "version": "0.25.0",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf ../build/playlet-app", "prebuild": "rm -rf ../build/playlet-app",
@@ -15,7 +15,7 @@ function GetLoadingMessage() as string
"Deleting system32...", "Deleting system32...",
"Updating: 3 hours 32 minutes remaining...", "Updating: 3 hours 32 minutes remaining...",
"Asking ChatGPT for humorous loading messages...", "Asking ChatGPT for humorous loading messages...",
"Loading today's sponsor... NordVPN!", "Loading today's sponsor... Just kidding!",
"Don't worry, this is normal...", "Don't worry, this is normal...",
"Don't forget to like and subscribe...", "Don't forget to like and subscribe...",
"Shoveling coal into the server...", "Shoveling coal into the server...",
@@ -25,6 +25,7 @@ function GetLoadingMessage() as string
"Looking for the remote...", "Looking for the remote...",
"Finding that song that goes 'La la lala la'...", "Finding that song that goes 'La la lala la'...",
"Waiting for the spinny thing to finish...", "Waiting for the spinny thing to finish...",
"Oh I'm on TV... Hi mom!",
] ]
end if end if
index = GetRandom(0, messages.count() - 1) index = GetRandom(0, messages.count() - 1)
+2 -2
View File
@@ -2,8 +2,8 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=24 minor_version=25
build_version=00005 build_version=00000
ui_resolutions=hd ui_resolutions=hd
+29
View File
@@ -17,4 +17,33 @@ namespace Logger
buffer.AppendFile(LOGS_FILE_PATH) buffer.AppendFile(LOGS_FILE_PATH)
end function end function
function LogLastExitInfo() as void
' roAppManager.GetLastExitInfo() is only available on Roku OS 13 and above
appManager = CreateObject("roAppManager")
hasMethod = FindMemberFunction(appManager, "GetLastExitInfo") <> invalid
if not hasMethod
return
end if
lastExitInfo = appManager.GetLastExitInfo()
if lastExitInfo = invalid
return
end if
msg = `************ Last Exit Info ************\n`
msg += `exit_code: ${lastExitInfo.exit_code}\n`
msg += `timestamp: ${lastExitInfo.timestamp}\n`
msg += `app_state: ${lastExitInfo.app_state}\n`
msg += `media_player_state: ${lastExitInfo.media_player_state}\n`
msg += `mem_limit: ${lastExitInfo.mem_limit}\n`
msg += `console_log:\n${lastExitInfo.console_log}\n`
msg += `********** End Last Exit Info **********\n`
' bs:disable-next-line LINT3012
print(msg)
buffer = CreateObject("roByteArray")
buffer.FromAsciiString(msg + `\n`)
buffer.AppendFile(LOGS_FILE_PATH)
end function
end namespace end namespace
+2
View File
@@ -24,6 +24,8 @@ function Main(args as object) as void
Registry.ClearPlayletLibUrlsIfNeeded(args) Registry.ClearPlayletLibUrlsIfNeeded(args)
Registry.ClearRegistryIfNeeded(args) Registry.ClearRegistryIfNeeded(args)
Logger.LogLastExitInfo()
scene = screen.CreateScene("BootstrapScene") scene = screen.CreateScene("BootstrapScene")
screen.show() screen.show()
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.24.5", "version": "0.25.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.24.5" "version": "0.25.0"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.24.5", "version": "0.25.0",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf ../build/playlet-lib", "prebuild": "rm -rf ../build/playlet-lib",
@@ -5,6 +5,7 @@ import "pkg:/components/VideoQueue/VideoQueueViewUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -86,18 +87,18 @@ function GetRootScreen(screenName as string) as object
return m.screens[screenName] return m.screens[screenName]
end function end function
function onKeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if LongPressHandler(key, press) if LongPressHandler(key, press)
return true return true
end if end if
if key = OPTIONS_LONG_PRESS_KEY and press if key = RemoteKeys.OptionsLongPress and press
LogInfo("Opening VideoQueueView") LogInfo("Opening VideoQueueView")
VideoQueueViewUtils.Open(m.top.videoQueue, m.top) VideoQueueViewUtils.Open(m.top.videoQueue, m.top)
return true return true
end if end if
if key = "options" and not press if key = RemoteKeys.Options and not press
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue) if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
return true return true
end if end if
@@ -107,25 +108,25 @@ function onKeyEvent(key as string, press as boolean) as boolean
return false return false
end if end if
if key = "play" if key = RemoteKeys.Play
if VideoQueueUtils.TogglePause(m.top.videoQueue) if VideoQueueUtils.TogglePause(m.top.videoQueue)
return true return true
end if end if
end if end if
if key = "pause" if key = RemoteKeys.Pause
if VideoQueueUtils.Pause(m.top.videoQueue) if VideoQueueUtils.Pause(m.top.videoQueue)
return true return true
end if end if
end if end if
if key = "playonly" if key = RemoteKeys.PlayOnly
if VideoQueueUtils.Play(m.top.videoQueue) if VideoQueueUtils.Play(m.top.videoQueue)
return true return true
end if end if
end if end if
if key = "back" if key = RemoteKeys.Back
if VideoQueueUtils.IsVideoPlayerOpen(m.top.videoQueue) and not VideoQueueUtils.IsVideoPlayerFullScreen(m.top.videoQueue) if VideoQueueUtils.IsVideoPlayerOpen(m.top.videoQueue) and not VideoQueueUtils.IsVideoPlayerFullScreen(m.top.videoQueue)
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue) if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
return true return true
@@ -1,4 +1,5 @@
import "pkg:/source/utils/MathUtils.bs" import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -129,12 +130,12 @@ function OnButtonFocused()
end if end if
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if not press if not press
return false return false
end if end if
if key = "OK" if key = RemoteKeys.Ok
disabled = m.top.disabled disabled = m.top.disabled
if not disabled if not disabled
m.top.buttonSelected = true m.top.buttonSelected = true
@@ -7,6 +7,7 @@ import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -36,8 +37,8 @@ end function
function OnNodeready() function OnNodeready()
m.rowList@.BindNode() m.rowList@.BindNode()
SetNavigation(m.rowList, "up", m.subscribeButton) SetNavigation(m.rowList, RemoteKeys.Up, m.subscribeButton)
SetNavigation(m.subscribeButton, "down", m.rowList) SetNavigation(m.subscribeButton, RemoteKeys.Down, m.rowList)
m.subscribeButton.text = Tr(Locale.Buttons.Subscribe) m.subscribeButton.text = Tr(Locale.Buttons.Subscribe)
DisposableObserveFieldScoped(m.subscribeButton, "buttonSelected", FuncName(OnSubscribeButtonSelected)) DisposableObserveFieldScoped(m.subscribeButton, "buttonSelected", FuncName(OnSubscribeButtonSelected))
@@ -104,7 +105,7 @@ function CreateChannelFeeds(authorId as string, author as string, tabs as object
return feeds return feeds
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
@@ -113,7 +114,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return false return false
end if end if
if key = "back" if key = RemoteKeys.Back
Close() Close()
return true return true
end if end if
@@ -210,6 +211,16 @@ function InitializeSortOptions()
"id": "oldest" "id": "oldest"
"title": "Oldest" "title": "Oldest"
}] }]
"channel_streams": [{
"id": "newest"
"title": "Latest"
}, {
"id": "popular"
"title": "Popular"
}, {
"id": "oldest"
"title": "Oldest"
}]
"channel_playlists": [{ "channel_playlists": [{
"id": "newest" "id": "newest"
"title": "Date added (newest)" "title": "Date added (newest)"
@@ -1,5 +1,6 @@
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -152,22 +153,22 @@ function OnItemSelected(event as object) as void
end if end if
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if press = false if press = false
return false return false
end if end if
if key = "back" if key = RemoteKeys.Back
Close() Close()
return true return true
end if end if
if key = "up" if key = RemoteKeys.Up
m.optionsList.jumpToItem = m.optionsList.content.getChildCount() - 1 m.optionsList.jumpToItem = m.optionsList.content.getChildCount() - 1
return true return true
end if end if
if key = "down" if key = RemoteKeys.Down
m.optionsList.jumpToItem = 0 m.optionsList.jumpToItem = 0
return true return true
end if end if
@@ -67,7 +67,7 @@ function OnDialogClosed()
CancelTimer() CancelTimer()
end function end function
function onKeyEvent(_key as string, _press as boolean) as boolean function OnKeyEvent(_key as string, _press as boolean) as boolean
if m.timer = invalid if m.timer = invalid
return false return false
end if end if
@@ -53,15 +53,6 @@ function LoggerLoop()
buffer.AppendFile(logsFile) buffer.AppendFile(logsFile)
end if end if
lastExitInfo = GetLastExitInfo()
if not StringUtils.IsNullOrEmpty(lastExitInfo)
line = `************ Last Exit Info ************\n${lastExitInfo}\n********** End Last Exit Info **********\n`
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line)
buffer.AppendFile(logsFile)
end if
appMemoryMonitor = CreateObject("roAppMemoryMonitor") appMemoryMonitor = CreateObject("roAppMemoryMonitor")
if appMemoryMonitor <> invalid and FindMemberFunction(appMemoryMonitor, "EnableMemoryWarningEvent") <> invalid if appMemoryMonitor <> invalid and FindMemberFunction(appMemoryMonitor, "EnableMemoryWarningEvent") <> invalid
appMemoryMonitor.SetMessagePort(port) appMemoryMonitor.SetMessagePort(port)
@@ -175,19 +166,3 @@ function FormatTime(dateTime as object) as string
return "[" + hours + ":" + minutes + ":" + seconds + "." + milliseconds + "]" return "[" + hours + ":" + minutes + ":" + seconds + "." + milliseconds + "]"
end function end function
function GetLastExitInfo() as dynamic
' roAppManager.GetLastExitInfo() is only available on Roku OS 13 and above
appManager = CreateObject("roAppManager")
hasMethod = FindMemberFunction(appManager, "GetLastExitInfo") <> invalid
if not hasMethod
return invalid
end if
lastExitInfo = appManager.GetLastExitInfo()
if lastExitInfo = invalid
return invalid
end if
return ToString(lastExitInfo)
end function
+3 -2
View File
@@ -1,4 +1,5 @@
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -116,8 +117,8 @@ function UnfocusItem(index as integer) as void
m.appController@.HideRootScreen(item.screen) m.appController@.HideRootScreen(item.screen)
end function end function
function onKeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if key <> "right" or not press if key <> RemoteKeys.Right or not press
return false return false
end if end if
@@ -1,11 +1,10 @@
const OK_LONG_PRESS_KEY = "OK_LONG_PRESS" import "pkg:/source/utils/RemoteKeys.bs"
const OPTIONS_LONG_PRESS_KEY = "OPTIONS_LONG_PRESS"
function InitializeLongPress(keys as object, duration = 1.0 as float) function InitializeLongPress(keys as object, duration = 1.0 as float)
longPressKeyMap = { longPressKeyMap = {}
"OK": OK_LONG_PRESS_KEY longPressKeyMap[RemoteKeys.Ok] = RemoteKeys.OkLongPress
"options": OPTIONS_LONG_PRESS_KEY longPressKeyMap[RemoteKeys.Options] = RemoteKeys.OptionsLongPress
}
m._longPressKeyMap = {} m._longPressKeyMap = {}
for each key in keys for each key in keys
m._longPressKeyMap[key] = longPressKeyMap[key] m._longPressKeyMap[key] = longPressKeyMap[key]
@@ -16,10 +15,9 @@ function InitializeLongPress(keys as object, duration = 1.0 as float)
' Using the keyboard: ' Using the keyboard:
' - press K to simulate an "OK" long press on the remote. ' - press K to simulate an "OK" long press on the remote.
' - press O to simulate an "options" long press on the remote. ' - press O to simulate an "options" long press on the remote.
simulatedLongPressKeyMap = { simulatedLongPressKeyMap = {}
"OK": "Lit_k" simulatedLongPressKeyMap[RemoteKeys.Ok] = "Lit_k"
"options": "Lit_o" simulatedLongPressKeyMap[RemoteKeys.Options] = "Lit_o"
}
m._simulatedLongPressKeyMap = {} m._simulatedLongPressKeyMap = {}
for each key in keys for each key in keys
@@ -43,7 +41,7 @@ function LongPressHandler(key as string, press as boolean) as boolean
LogInfo(`[${subtype}] Simulating`, simulatedKey, "long press using key:", key, "press:", press) LogInfo(`[${subtype}] Simulating`, simulatedKey, "long press using key:", key, "press:", press)
longPressKey = m._longPressKeyMap[simulatedKey] longPressKey = m._longPressKeyMap[simulatedKey]
m._longPressFired = true m._longPressFired = true
return OnkeyEvent(longPressKey, press) return OnKeyEvent(longPressKey, press)
end if end if
#end if #end if
@@ -87,5 +85,5 @@ function LongPressTimerFired() as void
return return
end if end if
OnkeyEvent(m._longPressKeyMap[m._longPressKey], true) OnKeyEvent(m._longPressKeyMap[m._longPressKey], true)
end function end function
@@ -8,6 +8,7 @@ import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -61,17 +62,17 @@ function OnContentSet() as void
LoadPlaylistIfNeeded() LoadPlaylistIfNeeded()
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if LongPressHandler(key, press) if LongPressHandler(key, press)
return true return true
end if end if
if key = OK_LONG_PRESS_KEY and press if key = RemoteKeys.OkLongPress and press
OnItemLongPressed(m.list.itemFocused) OnItemLongPressed(m.list.itemFocused)
return true return true
end if end if
if key = "OK" and not press if key = RemoteKeys.Ok and not press
OnItemSelected(m.list.itemFocused) OnItemSelected(m.list.itemFocused)
return true return true
end if end if
@@ -80,7 +81,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return false return false
end if end if
if key = "back" if key = RemoteKeys.Back
Close() Close()
return true return true
end if end if
@@ -2,6 +2,7 @@ import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/DisposableObserve.bs" import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -16,10 +17,10 @@ function Init()
end function end function
function OnNodeReady() function OnNodeReady()
SetNavigation(m.activateButton, "down", m.logoutButton) SetNavigation(m.activateButton, RemoteKeys.Down, m.logoutButton)
SetNavigation(m.logoutButton, "down", m.closeButton) SetNavigation(m.logoutButton, RemoteKeys.Down, m.closeButton)
SetNavigation(m.closeButton, "up", m.logoutButton) SetNavigation(m.closeButton, RemoteKeys.Up, m.logoutButton)
SetNavigation(m.logoutButton, "up", m.activateButton) SetNavigation(m.logoutButton, RemoteKeys.Up, m.activateButton)
DisposableObserveFieldScoped(m.profilesService, "currentProfile", FuncName(OnCunrrentProfileChanged)) DisposableObserveFieldScoped(m.profilesService, "currentProfile", FuncName(OnCunrrentProfileChanged))
DisposableObserveFieldScoped(m.profilesService, "onProfileLogout", FuncName(OnProfileLogout)) DisposableObserveFieldScoped(m.profilesService, "onProfileLogout", FuncName(OnProfileLogout))
@@ -57,17 +58,17 @@ function OnFocusChange() as void
end if end if
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
if key = "options" or key = "play" or key = "pause" or key = "playonly" if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play ' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play
return false return false
end if end if
if key = "back" and press if key = RemoteKeys.Back and press
Close() Close()
return true return true
end if end if
@@ -3,6 +3,7 @@ import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Services/BookmarksService/BookmarksServiceUtils.bs" import "pkg:/components/Services/BookmarksService/BookmarksServiceUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -16,8 +17,8 @@ function Init()
end function end function
function OnNodeReady() function OnNodeReady()
SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, RemoteKeys.Back, m.navBar)
SetNavigation(invalid, "left", m.navBar) SetNavigation(invalid, RemoteKeys.Left, m.navBar)
m.rowList@.BindNode() m.rowList@.BindNode()
@@ -73,7 +74,7 @@ function SetRowListContent(bookmarksContent as object)
m.rowList.feeds = BookmarksServiceUtils.BookmarksContentToFeed(bookmarksContent) m.rowList.feeds = BookmarksServiceUtils.BookmarksContentToFeed(bookmarksContent)
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
@@ -3,6 +3,7 @@ import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/RemoteKeys.bs"
function Init() function Init()
m.top.focusable = true m.top.focusable = true
@@ -12,8 +13,8 @@ function Init()
end function end function
function OnNodeReady() function OnNodeReady()
SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, RemoteKeys.Back, m.navBar)
SetNavigation(invalid, "left", m.navBar) SetNavigation(invalid, RemoteKeys.Left, m.navBar)
m.rowList@.BindNode() m.rowList@.BindNode()
@@ -34,7 +35,7 @@ function OnFocusChange() as void
NodeSetFocus(m.rowList, true) NodeSetFocus(m.rowList, true)
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
@@ -2,6 +2,7 @@ import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/ProfileView/ProfileViewUtils.bs" import "pkg:/components/ProfileView/ProfileViewUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -10,8 +11,8 @@ function Init()
end function end function
function OnNodeReady() function OnNodeReady()
SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, RemoteKeys.Back, m.navBar)
SetNavigation(invalid, "left", m.navBar) SetNavigation(invalid, RemoteKeys.Left, m.navBar)
m.profileRowList.content = m.profilesService.content m.profileRowList.content = m.profilesService.content
m.profileRowList.observeFieldScoped("rowItemSelected", FuncName(OnRowItemSelected)) m.profileRowList.observeFieldScoped("rowItemSelected", FuncName(OnRowItemSelected))
@@ -25,7 +26,7 @@ function OnFocusChange() as void
NodeSetFocus(m.profileRowList, true) NodeSetFocus(m.profileRowList, true)
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
@@ -7,6 +7,7 @@ import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MathUtils.bs" import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
function Init() function Init()
@@ -39,13 +40,13 @@ function Init()
end function end function
function OnNodeReady() function OnNodeReady()
SetNavigation(m.webAppButton, "down", m.linkWithWifiButton) SetNavigation(m.webAppButton, RemoteKeys.Down, m.linkWithWifiButton)
SetNavigation(m.linkWithWifiButton, "down", m.linkWithTvButton) SetNavigation(m.linkWithWifiButton, RemoteKeys.Down, m.linkWithTvButton)
SetNavigation(m.linkWithTvButton, "up", m.linkWithWifiButton) SetNavigation(m.linkWithTvButton, RemoteKeys.Up, m.linkWithWifiButton)
SetNavigation(m.linkWithWifiButton, "up", m.webAppButton) SetNavigation(m.linkWithWifiButton, RemoteKeys.Up, m.webAppButton)
SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, RemoteKeys.Back, m.navBar)
SetNavigation(invalid, "left", m.navBar) SetNavigation(invalid, RemoteKeys.Left, m.navBar)
address = m.webserver@.GetServerAddress() address = m.webserver@.GetServerAddress()
isValidAddress = not StringUtils.IsNullOrEmpty(address) isValidAddress = not StringUtils.IsNullOrEmpty(address)
@@ -102,7 +103,7 @@ function OnButtonSizeChange()
m.linkWithTvButton.minWidth = width m.linkWithTvButton.minWidth = width
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
navigation = NavigationKeyHandler(key, press) navigation = NavigationKeyHandler(key, press)
if navigation.handled if navigation.handled
ShowTab(navigation.node) ShowTab(navigation.node)
@@ -1,6 +1,7 @@
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/ArrayUtils.bs" import "pkg:/source/utils/ArrayUtils.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -127,10 +128,10 @@ function Init()
navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort] navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort]
for i = 0 to navigationNodes.count() - 2 for i = 0 to navigationNodes.count() - 2
SetNavigation(navigationNodes[i], "right", navigationNodes[i + 1]) SetNavigation(navigationNodes[i], RemoteKeys.Right, navigationNodes[i + 1])
end for end for
for i = 1 to navigationNodes.count() - 1 for i = 1 to navigationNodes.count() - 1
SetNavigation(navigationNodes[i], "left", navigationNodes[i - 1]) SetNavigation(navigationNodes[i], RemoteKeys.Left, navigationNodes[i - 1])
end for end for
end function end function
@@ -243,19 +244,19 @@ function SetFilterArray(control as object) as void
m.searchScreen.filters = state m.searchScreen.filters = state
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
navigation = NavigationKeyHandler(key, press) navigation = NavigationKeyHandler(key, press)
if navigation.handled if navigation.handled
m.currentNavigtionNode = navigation.node m.currentNavigtionNode = navigation.node
return true return true
end if end if
if key = "options" or key = "play" or key = "pause" or key = "playonly" if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play ' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play
return false return false
end if end if
if key = "back" and press if key = RemoteKeys.Back and press
Close() Close()
return true return true
end if end if
@@ -9,6 +9,7 @@ import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/LoadingScreen.bs" import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/UrlUtils.bs" import "pkg:/source/utils/UrlUtils.bs"
function Init() function Init()
@@ -50,30 +51,30 @@ function OnNodeReady()
m.top.ObserveField("visible", FuncName(OnVisibilityChange)) m.top.ObserveField("visible", FuncName(OnVisibilityChange))
m.rowlist.ObserveFieldScoped("onError", FuncName(OnSearchError)) m.rowlist.ObserveFieldScoped("onError", FuncName(OnSearchError))
SetNavigation(invalid, "back", m.navBar, function() SetNavigation(invalid, RemoteKeys.Back, m.navBar, function()
ScrollUp() ScrollUp()
end function) end function)
SetNavigation(m.suggestions, "right", m.keyboard) SetNavigation(m.suggestions, RemoteKeys.Right, m.keyboard)
SetNavigation(m.filtersButton, "right", m.keyboard) SetNavigation(m.filtersButton, RemoteKeys.Right, m.keyboard)
SetNavigation(m.keyboard, "left", m.suggestions) SetNavigation(m.keyboard, RemoteKeys.Left, m.suggestions)
SetNavigation(m.suggestions, "left", m.navBar) SetNavigation(m.suggestions, RemoteKeys.Left, m.navBar)
SetNavigation(m.filtersButton, "left", m.navBar) SetNavigation(m.filtersButton, RemoteKeys.Left, m.navBar)
SetNavigation(m.keyboard, "left", m.navBar) SetNavigation(m.keyboard, RemoteKeys.Left, m.navBar)
SetNavigation(m.rowList, "left", m.navBar, function() SetNavigation(m.rowList, RemoteKeys.Left, m.navBar, function()
ScrollUp() ScrollUp()
end function) end function)
SetNavigation(m.filtersButton, "down", m.suggestions) SetNavigation(m.filtersButton, RemoteKeys.Down, m.suggestions)
SetNavigation(m.filtersButton, "down", m.keyboard) SetNavigation(m.filtersButton, RemoteKeys.Down, m.keyboard)
SetNavigation(invalid, "down", m.rowList, function() SetNavigation(invalid, RemoteKeys.Down, m.rowList, function()
ScrollDown() ScrollDown()
end function) end function)
SetNavigation(m.rowList, "up", m.suggestions, function() SetNavigation(m.rowList, RemoteKeys.Up, m.suggestions, function()
ScrollUp() ScrollUp()
end function) end function)
SetNavigation(m.suggestions, "up", m.filtersButton) SetNavigation(m.suggestions, RemoteKeys.Up, m.filtersButton)
SetNavigation(m.keyboard, "up", m.filtersButton) SetNavigation(m.keyboard, RemoteKeys.Up, m.filtersButton)
m.currentNavigtionNode = m.suggestions m.currentNavigtionNode = m.suggestions
' Trigger suggestions ' Trigger suggestions
@@ -310,7 +311,7 @@ function ScrollDown() as void
m.scrollAnimation.control = "start" m.scrollAnimation.control = "start"
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
navigation = NavigationKeyHandler(key, press) navigation = NavigationKeyHandler(key, press)
if navigation.handled if navigation.handled
m.currentNavigtionNode = navigation.node m.currentNavigtionNode = navigation.node
@@ -2,6 +2,7 @@ import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs" import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MathUtils.bs" import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -17,17 +18,17 @@ function Init()
m.closeButton = m.top.findNode("closeButton") m.closeButton = m.top.findNode("closeButton")
m.saveButton = m.top.findNode("saveButton") m.saveButton = m.top.findNode("saveButton")
SetNavigation(m.checkList, "down", m.saveButton) SetNavigation(m.checkList, RemoteKeys.Down, m.saveButton)
SetNavigation(m.saveButton, "up", m.checkList) SetNavigation(m.saveButton, RemoteKeys.Up, m.checkList)
SetNavigation(m.closeButton, "up", m.checkList) SetNavigation(m.closeButton, RemoteKeys.Up, m.checkList)
SetNavigation(m.saveButton, "right", m.closeButton) SetNavigation(m.saveButton, RemoteKeys.Right, m.closeButton)
SetNavigation(m.closeButton, "left", m.saveButton) SetNavigation(m.closeButton, RemoteKeys.Left, m.saveButton)
SetNavigation(m.moveUpButton, "left", m.checkList) SetNavigation(m.moveUpButton, RemoteKeys.Left, m.checkList)
SetNavigation(m.moveDownButton, "left", m.checkList) SetNavigation(m.moveDownButton, RemoteKeys.Left, m.checkList)
SetNavigation(m.checkList, "right", m.moveUpButton) SetNavigation(m.checkList, RemoteKeys.Right, m.moveUpButton)
SetNavigation(m.moveUpButton, "down", m.moveDownButton) SetNavigation(m.moveUpButton, RemoteKeys.Down, m.moveDownButton)
SetNavigation(m.moveDownButton, "up", m.moveUpButton) SetNavigation(m.moveDownButton, RemoteKeys.Up, m.moveUpButton)
SetNavigation(m.moveDownButton, "down", m.closeButton) SetNavigation(m.moveDownButton, RemoteKeys.Down, m.closeButton)
m.moveUpButton.observeField("buttonSelected", FuncName(OnMoveUpButtonSelected)) m.moveUpButton.observeField("buttonSelected", FuncName(OnMoveUpButtonSelected))
m.moveDownButton.observeField("buttonSelected", FuncName(OnMoveDownButtonSelected)) m.moveDownButton.observeField("buttonSelected", FuncName(OnMoveDownButtonSelected))
@@ -55,17 +56,17 @@ function OnFocusChange() as void
NodeSetFocus(m.checkList, true) NodeSetFocus(m.checkList, true)
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
if key = "options" or key = "play" or key = "pause" or key = "playonly" if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play ' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play
return false return false
end if end if
if key = "back" and press if key = RemoteKeys.Back and press
Close() Close()
return true return true
end if end if
@@ -2,6 +2,7 @@ import "pkg:/components/Dialog/DialogPalette.bs"
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs" import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/components/Services/Invidious/InvidiousService.bs" import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -17,19 +18,19 @@ function Init()
m.testButton.observeField("buttonSelected", FuncName(OnTestButtonSelected)) m.testButton.observeField("buttonSelected", FuncName(OnTestButtonSelected))
m.publicInstances.observeField("instance", FuncName(OnPublicInstanceSelected)) m.publicInstances.observeField("instance", FuncName(OnPublicInstanceSelected))
SetNavigation(m.editButton, "down", m.publicInstances) SetNavigation(m.editButton, RemoteKeys.Down, m.publicInstances)
SetNavigation(m.editButton, "down", m.testButton) SetNavigation(m.editButton, RemoteKeys.Down, m.testButton)
SetNavigation(m.publicInstances, "up", m.editButton) SetNavigation(m.publicInstances, RemoteKeys.Up, m.editButton)
SetNavigation(m.publicInstances, "down", m.testButton) SetNavigation(m.publicInstances, RemoteKeys.Down, m.testButton)
SetNavigation(m.testButton, "up", m.publicInstances) SetNavigation(m.testButton, RemoteKeys.Up, m.publicInstances)
SetNavigation(m.testButton, "up", m.editButton) SetNavigation(m.testButton, RemoteKeys.Up, m.editButton)
SetNavigation(m.saveButton, "up", m.publicInstances) SetNavigation(m.saveButton, RemoteKeys.Up, m.publicInstances)
SetNavigation(m.saveButton, "up", m.editButton) SetNavigation(m.saveButton, RemoteKeys.Up, m.editButton)
SetNavigation(m.saveButton, "left", m.testButton) SetNavigation(m.saveButton, RemoteKeys.Left, m.testButton)
SetNavigation(m.testButton, "right", m.saveButton) SetNavigation(m.testButton, RemoteKeys.Right, m.saveButton)
m.currentNavigtionNode = m.editButton m.currentNavigtionNode = m.editButton
m.textEditBox.hintText = `e.g. ${Invidious.DEFAULT_INSTANCE}` m.textEditBox.hintText = `e.g. ${Invidious.DEFAULT_INSTANCE}`
@@ -65,19 +66,19 @@ function OnFocusChange() as void
NodeSetFocus(m.currentNavigtionNode, true) NodeSetFocus(m.currentNavigtionNode, true)
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
navigation = NavigationKeyHandler(key, press) navigation = NavigationKeyHandler(key, press)
if navigation.handled if navigation.handled
m.currentNavigtionNode = navigation.node m.currentNavigtionNode = navigation.node
return true return true
end if end if
if key = "options" or key = "play" or key = "pause" or key = "playonly" if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play ' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play
return false return false
end if end if
if key = "back" and press if key = RemoteKeys.Back and press
Close() Close()
return true return true
end if end if
@@ -4,6 +4,7 @@ import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs" import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -14,8 +15,8 @@ function Init()
m.closeButton.observeField("buttonSelected", FuncName(Close)) m.closeButton.observeField("buttonSelected", FuncName(Close))
m.testList.observeField("itemSelected", FuncName(ShowTestDetails)) m.testList.observeField("itemSelected", FuncName(ShowTestDetails))
SetNavigation(m.closeButton, "up", m.testList) SetNavigation(m.closeButton, RemoteKeys.Up, m.testList)
SetNavigation(m.testList, "down", m.closeButton) SetNavigation(m.testList, RemoteKeys.Down, m.closeButton)
end function end function
function OnFocusChange() as void function OnFocusChange() as void
@@ -26,17 +27,17 @@ function OnFocusChange() as void
NodeSetFocus(m.closeButton, true) NodeSetFocus(m.closeButton, true)
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
if key = "options" or key = "play" or key = "pause" or key = "playonly" if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play ' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play
return false return false
end if end if
if key = "back" and press if key = RemoteKeys.Back and press
Close() Close()
return true return true
end if end if
@@ -1,6 +1,7 @@
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/MathUtils.bs" import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -14,10 +15,10 @@ function Init()
m.minusButton.observeFieldScoped("buttonSelected", FuncName(OnMinusSelected)) m.minusButton.observeFieldScoped("buttonSelected", FuncName(OnMinusSelected))
m.plusButton.observeFieldScoped("buttonSelected", FuncName(OnPlusSelected)) m.plusButton.observeFieldScoped("buttonSelected", FuncName(OnPlusSelected))
SetNavigation(m.minusButton, "right", m.numberButton) SetNavigation(m.minusButton, RemoteKeys.Right, m.numberButton)
SetNavigation(m.numberButton, "left", m.minusButton) SetNavigation(m.numberButton, RemoteKeys.Left, m.minusButton)
SetNavigation(m.numberButton, "right", m.plusButton) SetNavigation(m.numberButton, RemoteKeys.Right, m.plusButton)
SetNavigation(m.plusButton, "left", m.numberButton) SetNavigation(m.plusButton, RemoteKeys.Left, m.numberButton)
end function end function
function BindPreference(preferences as object, key as string) function BindPreference(preferences as object, key as string)
@@ -55,7 +56,7 @@ function OnFocusChange() as void
NodeSetFocus(m.numberButton, true) NodeSetFocus(m.numberButton, true)
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
@@ -1,6 +1,7 @@
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Navigation/ScrollTo.bs" import "pkg:/components/Navigation/ScrollTo.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -36,22 +37,22 @@ function OnNodeReady()
m.currentNavigtionNode = m.firstCategory m.currentNavigtionNode = m.firstCategory
end if end if
if previousCategory <> invalid if previousCategory <> invalid
SetNavigation(previousCategory.node, "down", category.node) SetNavigation(previousCategory.node, RemoteKeys.Down, category.node)
SetNavigation(category.node, "up", previousCategory.node) SetNavigation(category.node, RemoteKeys.Up, previousCategory.node)
end if end if
controls = CreateControls(item, container, startX + controlsX, startY, controlSpacing) controls = CreateControls(item, container, startX + controlsX, startY, controlSpacing)
if controls <> invalid if controls <> invalid
if controls.nodes.Count() > 0 if controls.nodes.Count() > 0
SetNavigation(category.node, "right", controls.nodes[0]) SetNavigation(category.node, RemoteKeys.Right, controls.nodes[0])
end if end if
for each control in controls.nodes for each control in controls.nodes
SetNavigation(control, "left", category.node) SetNavigation(control, RemoteKeys.Left, category.node)
if previousControl <> invalid if previousControl <> invalid
SetNavigation(previousControl, "down", control) SetNavigation(previousControl, RemoteKeys.Down, control)
SetNavigation(control, "up", previousControl) SetNavigation(control, RemoteKeys.Up, previousControl)
end if end if
previousControl = control previousControl = control
@@ -66,8 +67,8 @@ function OnNodeReady()
previousCategory = category previousCategory = category
end for end for
SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, RemoteKeys.Back, m.navBar)
SetNavigation(invalid, "left", m.navBar) SetNavigation(invalid, RemoteKeys.Left, m.navBar)
end function end function
function CreateCategoryNode(item as object, container as object, startX as integer, startY as integer) as object function CreateCategoryNode(item as object, container as object, startX as integer, startY as integer) as object
@@ -197,7 +198,7 @@ function CreateRokuComponent(item as object, container as object) as object
return node return node
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
navigation = NavigationKeyHandler(key, press) navigation = NavigationKeyHandler(key, press)
if navigation.handled if navigation.handled
m.currentNavigtionNode = navigation.node m.currentNavigtionNode = navigation.node
@@ -313,6 +313,17 @@ class DashManifest
LogWarn("Invalid video stream index, itag:", stream.itag) LogWarn("Invalid video stream index, itag:", stream.itag)
continue for continue for
end if end if
if (stream.width = invalid or stream.height = invalid) and not StringUtils.IsNullOrEmpty(stream.size)
if stream.size.instr("x") > 0
parts = stream.size.Tokenize("x")
if parts.Count() = 2
stream.width = ValidInt(parts[0].toInt())
stream.height = ValidInt(parts[1].toInt())
end if
end if
end if
videoStreams.Push(stream) videoStreams.Push(stream)
end if end if
end for end for
@@ -354,7 +354,20 @@ namespace Invidious
function PlaylistHandler(context as object) as object function PlaylistHandler(context as object) as object
response = context.response response = context.response
if response.StatusCode() = 200 statusCode = response.StatusCode()
if statusCode = 404
response.OverrideStatusCode(200)
return {
isLastPage: true
items: [{
"type": "playlist"
"playlistId": context.feedSource.pathParams.plid
"title": "[Playlist not found]"
}]
}
end if
if statusCode = 200
json = response.Json() json = response.Json()
return { return {
items: json.videos items: json.videos
@@ -391,7 +404,6 @@ namespace Invidious
function VideoInfoHandler(context as object) as object function VideoInfoHandler(context as object) as object
response = context.response response = context.response
feedSource = context.feedSource
statusCode = response.StatusCode() statusCode = response.StatusCode()
if statusCode >= 500 if statusCode >= 500
@@ -403,8 +415,9 @@ namespace Invidious
response.OverrideStatusCode(200) response.OverrideStatusCode(200)
return { return {
items: [{ items: [{
"videoId": feedSource.pathParams.id
"type": "video" "type": "video"
"videoId": context.feedSource.pathParams.id
"title": "[Video not available]"
}] }]
} }
end if end if
@@ -423,7 +436,19 @@ namespace Invidious
function PlaylistInfoHandler(context as object) as object function PlaylistInfoHandler(context as object) as object
response = context.response response = context.response
if response.StatusCode() = 200 statusCode = response.StatusCode()
if statusCode = 404
response.OverrideStatusCode(200)
return {
items: [{
"type": "playlist"
"playlistId": context.feedSource.pathParams.plid
"title": "[Playlist not found]"
}]
}
end if
if statusCode = 200
json = response.Json() json = response.Json()
json.type = "playlist" json.type = "playlist"
return { return {
@@ -9,6 +9,7 @@ import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/DisposableObserve.bs" import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
' TODO:P1 add the option to remove a row if it does not have any content ' TODO:P1 add the option to remove a row if it does not have any content
@@ -20,6 +21,7 @@ end function
function OnNodeReady() function OnNodeReady()
DisposableObserveField(m.top, "itemFocused", FuncName(OnItemFocused)) DisposableObserveField(m.top, "itemFocused", FuncName(OnItemFocused))
DisposableObserveField(m.top, "rowItemFocused", FuncName(OnRowItemFocused)) DisposableObserveField(m.top, "rowItemFocused", FuncName(OnRowItemFocused))
DisposableObserveField(m.top, "rowItemSelected", FuncName(OnRealRowItemSelected))
DisposableObserveField(m.top, "focusedChild", FuncName(OnFocusedChildChange)) DisposableObserveField(m.top, "focusedChild", FuncName(OnFocusedChildChange))
DisposableObserveField(m.top, "visible", FuncName(OnVisibilityChange)) DisposableObserveField(m.top, "visible", FuncName(OnVisibilityChange))
@@ -317,20 +319,28 @@ function OnVideoRowListRowContentTaskResult(output as object) as void
LoadRowsIfNeeded() LoadRowsIfNeeded()
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnRealRowItemSelected()
if LongPressHandler(key, press) ' This is the event that fires when m.top.rowItemSelected changes
return true LongPressHandler(RemoteKeys.Ok, true)
end function
function OnKeyEvent(key as string, press as boolean) as boolean
' This OnKeyEvent should not handle OK/true, because that will block rowItemSelected from firing
' Do not pass OK/true to LongPressHandler, since we did that in OnRealRowItemSelected
if not (key = RemoteKeys.Ok and press)
if LongPressHandler(key, press)
return true
end if
end if end if
if key = OK_LONG_PRESS_KEY and press if key = RemoteKeys.OkLongPress and press
OnRowItemLongPressed(m.top.rowItemFocused) OnRowItemLongPressed(m.top.rowItemFocused)
return true return true
end if end if
if key = "OK" and not press if key = RemoteKeys.Ok and not press
' TODO:P1: rowItemFocused doesn't update fast enough. If direction then Ok are pressed quickly, the wrong item is selected ' item was selected, but was not a long press, this is a request to open the video/channel/playlist
' Use currFocusColumn OnRowItemSelected(m.top.rowItemSelected)
OnRowItemSelected(m.top.rowItemFocused)
return true return true
end if end if
return false return false
@@ -71,9 +71,8 @@ function VideoRowListRowContentTask(input as object) as object
continue while continue while
end if end if
' Invidious returns 400 and "{"error":"Administrator has disabled this endpoint."}" when the Popular feed is disabled if response.error.instr("Administrator has disabled this endpoint.") > -1
if feedSource.endpoint = "popular" and response.error.instr("Administrator has disabled this endpoint.") > -1 LogWarn(feedSource.endpoint, "feedSource not available:", response.error)
LogWarn("Popular feedSource not available:", response.error)
if feedSources.Count() = 1 if feedSources.Count() = 1
parent = feedContentNode.getParent() parent = feedContentNode.getParent()
parent.removeChild(feedContentNode) parent.removeChild(feedContentNode)
@@ -116,7 +115,9 @@ function VideoRowListRowContentTask(input as object) as object
if response.result.items.Count() > 0 if response.result.items.Count() > 0
pageType = feedSource.state.paginationType pageType = feedSource.state.paginationType
if pageType = PaginationType.Continuation and hasContinuation if response.result.isLastPage = true
feedSource.state.loadState = FeedLoadState.Loaded
else if pageType = PaginationType.Continuation and hasContinuation
feedSource.state.loadState = FeedLoadState.LoadedPage feedSource.state.loadState = FeedLoadState.LoadedPage
else if pageType = PaginationType.Pages else if pageType = PaginationType.Pages
feedSource.state.loadState = FeedLoadState.LoadedPage feedSource.state.loadState = FeedLoadState.LoadedPage
@@ -8,6 +8,7 @@ import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
function Init() function Init()
SetPlayerStyle() SetPlayerStyle()
@@ -420,29 +421,29 @@ function HandleOKPress() as boolean
return handled return handled
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if press = false if press = false
return false return false
end if end if
' Unfortunately, a Video node cannot capture the "options" key (because, Roku...) ' Unfortunately, a Video node cannot capture the "options" key (because, Roku...)
' https://community.roku.com/t5/Roku-Developer-Program/Bug-in-10-0-1-Options-key-is-not-being-consumed-by-onKeyEvent-when-Video-node-is-in-focus/m-p/709200/highlight/true#M49312 ' https://community.roku.com/t5/Roku-Developer-Program/Bug-in-10-0-1-Options-key-is-not-being-consumed-by-onKeyEvent-when-Video-node-is-in-focus/m-p/709200/highlight/true#M49312
' Because of that, the button "down" is used to shrink the video for picture in picture mode ' Because of that, the button "down" is used to shrink the video for picture in picture mode
if key = "down" if key = RemoteKeys.Down
if VideoQueueUtils.ToggleVideoPictureInPicture(m.videoQueue) if VideoQueueUtils.ToggleVideoPictureInPicture(m.videoQueue)
return true return true
end if end if
end if end if
if key = "back" if key = RemoteKeys.Back
m.videoQueue.closePlayer = true m.videoQueue.closePlayer = true
return true return true
end if end if
if key = "OK" if key = RemoteKeys.Ok
return HandleOKPress() return HandleOKPress()
end if end if
if key = "left" or key = "right" or key = "rewind" or key = "fastforward" if key = RemoteKeys.Left or key = RemoteKeys.Right or key = RemoteKeys.Rewind or key = RemoteKeys.FastForward
' We're paused and one of the buttons is pressed: left, right ff, rw. ' We're paused and one of the buttons is pressed: left, right ff, rw.
' That means we're seeking position. Check that in HandleOKPress and exit early ' That means we're seeking position. Check that in HandleOKPress and exit early
m.isSeekingPosition = true m.isSeekingPosition = true
@@ -0,0 +1,165 @@
enum MinimizeState
None ' None is not a valid state, but it is the default value pre-initialization
Minimizing
Minimized
Maximizing
Maximized
end enum
function InitializePitctureInPicture()
m.minRect = {
translation: [834, 460]
width: 426
height: 240
}
m.maxRect = {
translation: [0, 0]
width: 1280
height: 720
}
InitializePitctureInPictureAnimation()
InitializePitctureInPictureFullScreenHint()
DisposableObserveField(m.top, "minimizeState", FuncName(OnMinimizeStateChange))
DisposableObserveFieldScoped(m.container, "fullscreen", FuncName(OnFullScreenChange))
if m.container.fullscreen
m.top.minimizeState = MinimizeState.Maximized
else
m.top.minimizeState = MinimizeState.Minimized
end if
end function
function InitializePitctureInPictureAnimation()
m.minimizeAnimation = m.top.findNode("minimizeAnimation")
m.widthInterpolator = m.minimizeAnimation.findNode("widthInterpolator")
m.heightInterpolator = m.minimizeAnimation.findNode("heightInterpolator")
m.translationInterpolator = m.minimizeAnimation.findNode("translationInterpolator")
DisposableObserveFieldScoped(m.minimizeAnimation, "state", FuncName(OnMinimizeAnimationStateChange))
m.widthInterpolator.keyValue = [m.maxRect.width, (m.maxRect.width + m.minRect.width) / 2, m.minRect.width]
m.heightInterpolator.keyValue = [m.maxRect.height, (m.maxRect.height + m.minRect.height) / 2, m.minRect.height]
midTranslation = [(m.maxRect.translation[0] + m.minRect.translation[0]) / 2, (m.maxRect.translation[1] + m.minRect.translation[1]) / 2]
m.translationInterpolator.keyValue = [m.maxRect.translation, midTranslation, m.minRect.translation]
end function
function InitializePitctureInPictureFullScreenHint()
m.fullScreenHint = m.top.findNode("fullScreenHint")
m.fullScreenHintLabel = m.fullScreenHint.findNode("fullScreenHintLabel")
m.fullScreenHintTimer = m.fullScreenHint.findNode("fullScreenHintTimer")
DisposableObserveFieldScoped(m.fullScreenHintTimer, "fire", FuncName(HideFullScreenHint))
m.fullScreenHint.width = m.minRect.width
m.fullScreenHintLabel.width = m.minRect.width
m.fullScreenHint.translation = [0, m.minRect.height - m.fullScreenHint.height]
end function
function OnMinimizeStateChange()
state = m.top.minimizeState
if state = MinimizeState.Minimizing
OnMinimizingState()
else if state = MinimizeState.Minimized
OnMinimizedState()
else if state = MinimizeState.Maximizing
OnMaximizingState()
else if state = MinimizeState.Maximized
OnMaximizedState()
end if
end function
function OnMinimizingState()
m.videoUi.visible = false
m.widthInterpolator.reverse = false
m.heightInterpolator.reverse = false
m.translationInterpolator.reverse = false
m.minimizeAnimation.control = "start"
end function
function OnMinimizedState()
m.top.width = m.minRect.width
m.top.height = m.minRect.height
m.top.translation = m.minRect.translation
m.videoUi.visible = false
ShowFullScreenHint()
end function
function OnMaximizingState()
m.videoUi.visible = true
HideFullScreenHint()
m.widthInterpolator.reverse = true
m.heightInterpolator.reverse = true
m.translationInterpolator.reverse = true
m.minimizeAnimation.control = "start"
end function
function OnMaximizedState()
m.top.width = m.maxRect.width
m.top.height = m.maxRect.height
m.top.translation = m.maxRect.translation
HideFullScreenHint()
m.videoUi.visible = true
end function
function OnFullScreenChange()
if m.container.fullscreen
Maximize()
else
Minimize()
end if
end function
function Minimize() as void
state = m.top.minimizeState
if state = MinimizeState.Minimized
return
end if
m.top.minimizeState = MinimizeState.Minimizing
end function
function Maximize() as void
state = m.top.minimizeState
if state = MinimizeState.Maximized
return
end if
m.top.minimizeState = MinimizeState.Maximizing
end function
function ShowFullScreenHint()
m.fullScreenHint.visible = true
m.fullScreenHintTimer.control = "stop"
m.fullScreenHintTimer.control = "start"
end function
function HideFullScreenHint()
m.fullScreenHint.visible = false
end function
function OnMinimizeAnimationStateChange() as void
' "stopped" Indicates that the animation has either run to completion or has been explicitly stopped.
' Since we don't stop the animation explicitly, we can assume that the animation has run to completion.
' This assumption becomes invalid if we set m.minimizeAnimation.control = "stop"
if m.minimizeAnimation.state <> "stopped"
return
end if
state = m.top.minimizeState
if state = MinimizeState.Minimizing
m.top.minimizeState = MinimizeState.Minimized
else if state = MinimizeState.Maximizing
m.top.minimizeState = MinimizeState.Maximized
end if
end function
function ShutDownPitctureInPicture()
m.fullScreenHintTimer.control = "stop"
end function
@@ -0,0 +1,147 @@
enum PlayerUiState
None ' None is not a valid state, but it is the default value pre-initialization
FadingIn
Visible
FadingOut
Hidden
end enum
function InitializePlayerUi()
m.top.enableUI = false
m.top.enableTrickPlay = false
FindUiNodes()
SetupLoadingSpinner()
DisposableObserveFieldScoped(m.uiFadeAnimation, "state", FuncName(OnUiFadeAnimationStateChange))
DisposableObserveField(m.hideVideoUiTimer, "fire", FuncName(OnHideVideoUiTimer))
DisposableObserveField(m.top, "playerUiState", FuncName(OnPlayerUiState))
m.top.playerUiState = PlayerUiState.Visible
end function
function FindUiNodes()
m.clock = m.top.findNode("Clock")
m.titleLabel = m.top.findNode("TitleLabel")
m.secondaryTitleLabel = m.top.findNode("SecondaryTitleLabel")
m.backgroundPoster = m.top.findNode("BackgroundPoster")
m.backgroundPosterSmall = m.top.findNode("BackgroundPosterSmall")
m.previousButton = m.top.findNode("PreviousButton")
m.playButton = m.top.findNode("PlayButton")
m.nextButton = m.top.findNode("NextButton")
m.minimizeButton = m.top.findNode("MinimizeButton")
m.trickPlayBar = m.top.findNode("TrickPlayBar")
m.videoUi = m.top.findNode("VideoUi")
m.progressTimer = m.top.findNode("ProgressTimer")
m.hideVideoUiTimer = m.top.findNode("HideVideoUiTimer")
m.uiFadeAnimation = m.top.findNode("UiFadeAnimation")
m.uiFadeOpacityInterpolator = m.top.findNode("UiFadeOpacityInterpolator")
m.loadingUi = m.top.findNode("LoadingUi")
m.loadingSpinnerBackground = m.loadingUi.findNode("LoadingSpinnerBackground")
m.loadingSpinner = m.loadingUi.findNode("LoadingSpinner")
m.loadingLabel = m.loadingSpinner.findNode("LoadingLabel")
m.loadingPercentLabel = m.loadingSpinner.findNode("LoadingPercentLabel")
end function
function SetupLoadingSpinner()
poster = m.loadingSpinner.poster
size = 150
poster.width = size
poster.height = size
centerx = (1280 - size) / 2
centery = (720 - size) / 2
m.loadingSpinner.translation = [centerx, centery]
poster.opacity = 0.8
poster.uri = "pkg:/images/spinner.png"
size = 80
centerx = (1280 - size) / 2
centery = (720 - size) / 2
m.loadingSpinnerBackground.translation = [centerx, centery]
end function
function OnPlayerUiState()
state = m.top.playerUiState
if state = PlayerUiState.FadingIn
OnPlayerUiFadingIn()
else if state = PlayerUiState.Visible
OnPlayerUiVisible()
else if state = PlayerUiState.FadingOut
OnPlayerUiFadingOut()
else if state = PlayerUiState.Hidden
OnPlayerUiHidden()
end if
end function
function OnPlayerUiFadingIn()
if m.top.hasFocus()
NodeSetFocus(m.playButton, true)
end if
m.uiFadeOpacityInterpolator.reverse = false
m.uiFadeAnimation.control = "start"
end function
function OnPlayerUiVisible()
if m.top.hasFocus()
NodeSetFocus(m.playButton, true)
end if
StartHideVideoUiTimer()
end function
function OnPlayerUiFadingOut()
m.uiFadeOpacityInterpolator.reverse = true
m.uiFadeAnimation.control = "start"
end function
function OnPlayerUiHidden()
m.videoUi.opacity = 0
if m.top.isInFocusChain() and not m.top.hasFocus()
NodeSetFocus(m.top, false)
NodeSetFocus(m.top, true)
end if
end function
function StartHideVideoUiTimer()
m.hideVideoUiTimer.control = "stop"
m.hideVideoUiTimer.control = "start"
end function
function StopHideVideoUiTimer()
m.hideVideoUiTimer.control = "stop"
end function
function OnHideVideoUiTimer() as void
if m.top.playerUiState = PlayerUiState.Hidden
return
end if
m.top.playerUiState = PlayerUiState.FadingOut
end function
function OnUiFadeAnimationStateChange() as void
' "stopped" Indicates that the animation has either run to completion or has been explicitly stopped.
' Since we don't stop the animation explicitly, we can assume that the animation has run to completion.
' This assumption becomes invalid if we set m.uiFadeAnimation.control = "stop"
if m.uiFadeAnimation.state <> "stopped"
return
end if
state = m.top.playerUiState
if state = PlayerUiState.FadingIn
m.top.playerUiState = PlayerUiState.Visible
else if state = PlayerUiState.FadingOut
m.top.playerUiState = PlayerUiState.Hidden
end if
end function
function ShutDownPlayerUi()
m.hideVideoUiTimer.control = "stop"
m.loadingSpinner.control = "stop"
m.clock.dispose = true
end function
@@ -5,19 +5,25 @@ import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
function VideoContentTaskDev(input as object) as object function VideoContentTaskDev(input as object) as object
titleLabel = input.titleLabel titleLabel = input.titleLabel
secondaryTitleLabel = input.secondaryTitleLabel secondaryTitleLabel = input.secondaryTitleLabel
backgroundPoster = input.backgroundPoster
contentNode = input.content contentNode = input.content
invidiousNode = input.invidious invidiousNode = input.invidious
titleLabel.text = contentNode.title titleLabel.text = contentNode.title
secondaryTitleLabel.text = contentNode.secondaryTitle secondaryTitleLabel.text = contentNode.secondaryTitle
if StringUtils.IsNullOrEmpty(contentNode.videoId) videoId = contentNode.videoId
if StringUtils.IsNullOrEmpty(videoId)
throw "Can't load video information: videoId is missing" throw "Can't load video information: videoId is missing"
end if end if
service = new Invidious.InvidiousService(invidiousNode) service = new Invidious.InvidiousService(invidiousNode)
instance = service.GetInstance()
response = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation }) backgroundPoster.uri = `${instance}/vi/${videoId}/maxresdefault.jpg`
response = service.GetVideoMetadata(videoId, { cancellation: m.top.cancellation })
if m.top.cancel if m.top.cancel
return invalid return invalid
@@ -1,3 +1,4 @@
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -41,12 +42,12 @@ function OnDisabledChange()
m.top.focusable = not disabled m.top.focusable = not disabled
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if not press if not press
return false return false
end if end if
if key = "OK" if key = RemoteKeys.Ok
disabled = m.top.disabled disabled = m.top.disabled
if not disabled if not disabled
m.top.buttonSelected = true m.top.buttonSelected = true
@@ -1,4 +1,6 @@
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/VideoPlayerDev/PictureInPicture.bs"
import "pkg:/components/VideoPlayerDev/PlayerUi.bs"
import "pkg:/components/VideoQueue/VideoQueueUtils.bs" import "pkg:/components/VideoQueue/VideoQueueUtils.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs" import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
@@ -6,35 +8,20 @@ import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
m.top.enableUI = false InitializePlayerUi()
m.top.enableTrickPlay = false
httpAgent = m.top.getHttpAgent() httpAgent = m.top.getHttpAgent()
httpAgent.AddHeader("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0") httpAgent.AddHeader("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0")
m.clock = m.top.findNode("Clock")
m.titleLabel = m.top.findNode("TitleLabel")
m.secondaryTitleLabel = m.top.findNode("SecondaryTitleLabel")
m.previousButton = m.top.findNode("PreviousButton")
m.playButton = m.top.findNode("PlayButton")
m.nextButton = m.top.findNode("NextButton")
m.minimizeButton = m.top.findNode("MinimizeButton")
m.trickPlayBar = m.top.findNode("TrickPlayBar")
m.videoUi = m.top.findNode("VideoUI")
m.progressTimer = m.top.findNode("ProgressTimer")
m.hideVideoUiTimer = m.top.findNode("HideVideoUiTimer")
m.fadeAnimation = m.top.findNode("FadeAnimation")
m.fadeOpacityInterpolator = m.top.findNode("FadeOpacityInterpolator")
SetupLoadingSpinner()
end function end function
function OnNodeReady() function OnNodeReady()
SetupMinimizeAnimation() InitializePitctureInPicture()
DisposableObserveFieldScoped(m.videoQueue, "hasPrevious", FuncName(OnHasPreviousChange)) DisposableObserveFieldScoped(m.videoQueue, "hasPrevious", FuncName(OnHasPreviousChange))
DisposableObserveFieldScoped(m.videoQueue, "hasNext", FuncName(OnHasNextChange)) DisposableObserveFieldScoped(m.videoQueue, "hasNext", FuncName(OnHasNextChange))
@@ -50,17 +37,16 @@ function OnNodeReady()
DisposableObserveField(m.top, "bufferingStatus", FuncName(OnBufferingStatusChange)) DisposableObserveField(m.top, "bufferingStatus", FuncName(OnBufferingStatusChange))
DisposableObserveField(m.progressTimer, "fire", FuncName(OnProgress)) DisposableObserveField(m.progressTimer, "fire", FuncName(OnProgress))
DisposableObserveField(m.hideVideoUiTimer, "fire", FuncName(OnHideVideoUiTimer))
SetNavigation(m.previousButton, "right", m.playButton) SetNavigation(m.previousButton, RemoteKeys.Right, m.playButton)
SetNavigation(m.playButton, "right", m.nextButton) SetNavigation(m.playButton, RemoteKeys.Right, m.nextButton)
SetNavigation(m.nextButton, "right", m.minimizeButton) SetNavigation(m.nextButton, RemoteKeys.Right, m.minimizeButton)
SetNavigation(m.playButton, "right", m.minimizeButton) SetNavigation(m.playButton, RemoteKeys.Right, m.minimizeButton)
SetNavigation(m.minimizeButton, "left", m.nextButton) SetNavigation(m.minimizeButton, RemoteKeys.Left, m.nextButton)
SetNavigation(m.minimizeButton, "left", m.playButton) SetNavigation(m.minimizeButton, RemoteKeys.Left, m.playButton)
SetNavigation(m.nextButton, "left", m.playButton) SetNavigation(m.nextButton, RemoteKeys.Left, m.playButton)
SetNavigation(m.playButton, "left", m.previousButton) SetNavigation(m.playButton, RemoteKeys.Left, m.previousButton)
if m.top.hasFocus() and m.videoUi.visible and m.videoUi.opacity = 1 if m.top.hasFocus() and m.videoUi.visible and m.videoUi.opacity = 1
NodeSetFocus(m.playButton, true) NodeSetFocus(m.playButton, true)
@@ -70,15 +56,24 @@ end function
function PlayWithContent(contentNode as object) function PlayWithContent(contentNode as object)
videoContentNode = CreateObject("roSGNode", "ContentNode") videoContentNode = CreateObject("roSGNode", "ContentNode")
if not StringUtils.IsNullOrEmpty(contentNode.videoId) videoId = contentNode.videoId
videoContentNode.AddFields({ videoId: contentNode.videoId }) title = contentNode.title
author = contentNode._author
thumbnail = contentNode.thumbnail
if not StringUtils.IsNullOrEmpty(videoId)
videoContentNode.AddFields({ videoId: videoId })
end if end if
if not StringUtils.IsNullOrEmpty(contentNode.title) if not StringUtils.IsNullOrEmpty(title)
videoContentNode.title = contentNode.title videoContentNode.title = title
end if end if
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation. ' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
if not StringUtils.IsNullOrEmpty(contentNode._author) if not StringUtils.IsNullOrEmpty(author)
videoContentNode.secondaryTitle = contentNode._author videoContentNode.secondaryTitle = author
end if
if not StringUtils.IsNullOrEmpty(thumbnail)
m.backgroundPosterSmall.uri = thumbnail
end if end if
StartVideoContentTask(videoContentNode) StartVideoContentTask(videoContentNode)
@@ -93,7 +88,7 @@ function StartVideoContentTask(videoContentNode as object)
m.loadingLabel.text = Tr(Locale.VideoPlayer.Loading) m.loadingLabel.text = Tr(Locale.VideoPlayer.Loading)
m.loadingPercentLabel.text = "" m.loadingPercentLabel.text = ""
m.loadingSpinner.visible = true m.loadingUi.visible = true
m.loadingSpinner.control = "start" m.loadingSpinner.control = "start"
m.videoContentTask = AsyncTask.Start(Tasks.VideoContentTaskDev, { m.videoContentTask = AsyncTask.Start(Tasks.VideoContentTaskDev, {
@@ -101,6 +96,7 @@ function StartVideoContentTask(videoContentNode as object)
secondaryTitleLabel: m.secondaryTitleLabel secondaryTitleLabel: m.secondaryTitleLabel
content: videoContentNode content: videoContentNode
invidious: m.top.invidious invidious: m.top.invidious
backgroundPoster: m.backgroundPoster
}, OnVideoContentTaskResults) }, OnVideoContentTaskResults)
end function end function
@@ -145,22 +141,44 @@ function OnClose()
m.top.dispose = true m.top.dispose = true
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
m.hideVideoUiTimer.control = "stop" if press = false
m.hideVideoUiTimer.control = "start" return false
if ShowVideoUi() end if
return true
state = m.top.state
uiState = m.top.playerUiState
if key = RemoteKeys.Play
if state = "paused" and uiState = PlayerUiState.Hidden
' If we pressed play and the state is paused, the player is about to resume.
' Return false to let the default behavior resume video.
return false
end if
end if
if key = RemoteKeys.Play or key = RemoteKeys.PlayOnly
if state = "playing" and uiState = PlayerUiState.Hidden
' If we pressed play and the state is playing, the player is about to pause.
' Return false to let the default behavior pause video.
m.top.playerUiState = PlayerUiState.FadingIn
return false
end if
end if
if uiState = PlayerUiState.Visible
StartHideVideoUiTimer()
end if
if uiState = PlayerUiState.Hidden or uiState = PlayerUiState.FadingOut
m.top.playerUiState = PlayerUiState.FadingIn
end if end if
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
if press = false if key = RemoteKeys.Back
return false
end if
if key = "back"
m.videoQueue.closePlayer = true m.videoQueue.closePlayer = true
return true return true
end if end if
@@ -201,7 +219,7 @@ function OnPlayerStateChange() as void
state = m.top.state state = m.top.state
if state = "stopping" or state = "stopped" if state = "stopping" or state = "stopped"
m.videoUi.Visible = false m.videoUi.visible = false
return return
end if end if
@@ -220,10 +238,14 @@ function OnPlayerStateChange() as void
if state = "buffering" if state = "buffering"
m.loadingLabel.text = Tr(Locale.VideoPlayer.Buffering) m.loadingLabel.text = Tr(Locale.VideoPlayer.Buffering)
m.loadingSpinner.control = "start" m.loadingSpinner.control = "start"
m.loadingSpinner.visible = true m.loadingUi.visible = true
m.backgroundPoster.visible = true
m.backgroundPosterSmall.visible = true
else else
m.loadingSpinner.control = "stop" m.loadingSpinner.control = "stop"
m.loadingSpinner.visible = false m.loadingUi.visible = false
m.backgroundPoster.visible = false
m.backgroundPosterSmall.visible = false
end if end if
end function end function
@@ -246,142 +268,8 @@ function OnProgress() as void
m.trickPlayBar.progress = m.top.position / duration m.trickPlayBar.progress = m.top.position / duration
end function end function
function OnHideVideoUiTimer()
HideVideoUi()
end function
function OnDispose() function OnDispose()
m.fadeAnimation.control = "stop" ShutDownPitctureInPicture()
m.hideVideoUiTimer.control = "stop" ShutDownPlayerUi()
m.fullScreenHintTimer.control = "stop"
m.loadingSpinner.control = "stop"
m.clock.dispose = true
DisposeObservers() DisposeObservers()
end function end function
function SetupLoadingSpinner()
m.loadingSpinner = m.top.findNode("LoadingSpinner")
poster = m.loadingSpinner.poster
size = 150
poster.width = size
poster.height = size
centerx = (1280 - size) / 2
centery = (720 - size) / 2
m.loadingSpinner.translation = [centerx, centery]
poster.opacity = 0.8
poster.uri = "pkg:/images/spinner.png"
m.loadingLabel = m.loadingSpinner.findNode("LoadingLabel")
m.loadingPercentLabel = m.loadingSpinner.findNode("LoadingPercentLabel")
end function
function SetupMinimizeAnimation()
m.fullScreenHint = m.top.findNode("fullScreenHint")
m.fullScreenHintLabel = m.top.findNode("fullScreenHintLabel")
m.fullScreenHintTimer = m.top.findNode("fullScreenHintTimer")
DisposableObserveFieldScoped(m.fullScreenHintTimer, "fire", FuncName(OnFullScreenHintTimer))
m.minimizeAnimation = m.top.findNode("minimizeAnimation")
m.widthInterpolator = m.top.findNode("widthInterpolator")
m.heightInterpolator = m.top.findNode("heightInterpolator")
m.translationInterpolator = m.top.findNode("translationInterpolator")
minRect = m.top.minRect
maxRect = m.top.maxRect
m.widthInterpolator.keyValue = [maxRect.width, (maxRect.width + minRect.width) / 2, minRect.width]
m.heightInterpolator.keyValue = [maxRect.height, (maxRect.height + minRect.height) / 2, minRect.height]
maxTranslation = [maxRect.x, maxRect.y]
minTranslation = [minRect.x, minRect.y]
midTranslation = [(maxRect.x + minRect.x) / 2, (maxRect.y + minRect.y) / 2]
m.translationInterpolator.keyValue = [maxTranslation, midTranslation, minTranslation]
fullscreen = m.container.fullscreen
rect = fullscreen ? maxRect : minRect
m.top.width = rect.width
m.top.height = rect.height
m.top.translation = [rect.x, rect.y]
m.fullScreenHint.width = minRect.width
m.fullScreenHintLabel.width = minRect.width
m.fullScreenHint.translation = [0, minRect.height - m.fullScreenHint.height]
m.top.showFullScreenHint = not fullscreen
m.videoUi.visible = fullscreen
DisposableObserveFieldScoped(m.container, "fullscreen", FuncName(OnFullScreenChange))
end function
function OnFullScreenChange()
fullscreen = m.container.fullscreen
m.widthInterpolator.reverse = fullscreen
m.heightInterpolator.reverse = fullscreen
m.translationInterpolator.reverse = fullscreen
m.minimizeAnimation.control = "start"
m.videoUi.visible = fullscreen
m.top.showFullScreenHint = not fullscreen
end function
function OnFullScreenHintTimer()
showFullScreenHint = m.top.showFullScreenHint
m.fullScreenHint.visible = showFullScreenHint
if showFullScreenHint
m.top.showFullScreenHint = false
end if
end function
function OnShowFullScreenHint() as void
m.fullScreenHintTimer.control = "stop"
if m.container.fullscreen
m.fullScreenHint.visible = false
return
end if
if m.top.showFullScreenHint
' Take 1 second until the shrink animation finishes to show the hint
m.fullScreenHintTimer.duration = 1
else
' Wait 5 seconds then hide the hint
m.fullScreenHintTimer.duration = 5
end if
m.fullScreenHintTimer.control = "start"
end function
function ShowVideoUi() as boolean
if m.fadeAnimation.state = "stopped"
if m.videoUi.opacity = 1
return false
end if
end if
m.fadeAnimation.control = "stop"
m.fadeOpacityInterpolator.reverse = false
m.fadeAnimation.control = "start"
if m.top.hasFocus()
NodeSetFocus(m.playButton, true)
end if
return true
end function
function HideVideoUi() as void
if m.fadeAnimation.state = "stopped"
if m.videoUi.opacity = 0
return
end if
end if
m.fadeAnimation.control = "stop"
m.fadeOpacityInterpolator.reverse = true
m.fadeAnimation.control = "start"
if m.top.isInFocusChain()
NodeSetFocus(m.top, true)
end if
end function
@@ -13,8 +13,9 @@
<field id="previousPlayer" type="node" /> <field id="previousPlayer" type="node" />
<field id="minRect" type="rect2D" value="[834,460,426,240]" /> <field id="minRect" type="rect2D" value="[834,460,426,240]" />
<field id="maxRect" type="rect2D" value="[0,0,1280,720]" /> <field id="maxRect" type="rect2D" value="[0,0,1280,720]" />
<field id="showFullScreenHint" type="boolean" alwaysNotify="true" onChange="OnShowFullScreenHint" />
<field id="close" type="boolean" alwaysNotify="true" onChange="OnClose" /> <field id="close" type="boolean" alwaysNotify="true" onChange="OnClose" />
<field id="minimizeState" type="integer" />
<field id="playerUiState" type="integer" />
<function name="PlayWithContent" /> <function name="PlayWithContent" />
</interface> </interface>
<children> <children>
@@ -25,9 +26,18 @@
horizOrigin="right" horizOrigin="right"
translation="[1280,0]" /> translation="[1280,0]" />
<Group id="VideoUI"> <Group id="VideoUi">
<Poster
<Group id="TopUI"> id="BackgroundPosterSmall"
width="1280"
height="720"
blendColor="0x323232" />
<Poster
id="BackgroundPoster"
width="1280"
height="720"
blendColor="0x323232" />
<Group id="TopUi">
<Poster <Poster
uri="pkg:/images/black-gradient.png" uri="pkg:/images/black-gradient.png"
opacity="0.8" opacity="0.8"
@@ -86,11 +96,19 @@
iconUri="pkg:/images/icons/player/minimize.png" /> iconUri="pkg:/images/icons/player/minimize.png" />
</LayoutGroup> </LayoutGroup>
</Group> </Group>
<Group> <Group
id="LoadingUi"
visible="false">
<Poster
id="LoadingSpinnerBackground"
width="80"
height="80"
uri="pkg:/images/white-circle.png"
opacity="0.4"
blendColor="0x000000" />
<BusySpinner <BusySpinner
id="LoadingSpinner" id="LoadingSpinner"
spinInterval="1" spinInterval="1">
visible="false">
<Label <Label
id="LoadingPercentLabel" id="LoadingPercentLabel"
horizAlign="center" horizAlign="center"
@@ -115,11 +133,11 @@
</Group> </Group>
<Timer id="HideVideoUiTimer" duration="3" /> <Timer id="HideVideoUiTimer" duration="3" />
<Animation id="FadeAnimation" duration="0.3" optional="true"> <Animation id="UiFadeAnimation" duration="0.3" optional="true">
<FloatFieldInterpolator id="FadeOpacityInterpolator" key="[0.0, 0.5, 1.0]" keyValue="[0.0, 0.5, 1.0]" fieldToInterp="VideoUI.opacity" /> <FloatFieldInterpolator id="UiFadeOpacityInterpolator" key="[0.0, 0.5, 1.0]" keyValue="[0.0, 0.5, 1.0]" fieldToInterp="VideoUi.opacity" />
</Animation> </Animation>
<Animation id="minimizeAnimation" duration="0.3" optional="true"> <Animation id="minimizeAnimation" duration="0.2" optional="true">
<FloatFieldInterpolator id="widthInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.width" /> <FloatFieldInterpolator id="widthInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.width" />
<FloatFieldInterpolator id="heightInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.height" /> <FloatFieldInterpolator id="heightInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.height" />
<Vector2DFieldInterpolator id="translationInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.translation" /> <Vector2DFieldInterpolator id="translationInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.translation" />
@@ -5,6 +5,7 @@ import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RemoteKeys.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -16,8 +17,8 @@ function Init()
DisposableObserveField(m.clearButton, "buttonSelected", FuncName(OnClearButtonSelected)) DisposableObserveField(m.clearButton, "buttonSelected", FuncName(OnClearButtonSelected))
DisposableObserveField(m.queueList, "itemSelected", FuncName(OnItemSelected)) DisposableObserveField(m.queueList, "itemSelected", FuncName(OnItemSelected))
SetNavigation(m.queueList, "up", m.clearButton) SetNavigation(m.queueList, RemoteKeys.Up, m.clearButton)
SetNavigation(m.clearButton, "down", m.queueList) SetNavigation(m.clearButton, RemoteKeys.Down, m.queueList)
m.videosDetailsToLoad = [] m.videosDetailsToLoad = []
end function end function
@@ -57,7 +58,7 @@ function OnContentSet() as void
LoadVideoDetailsIfNeeded() LoadVideoDetailsIfNeeded()
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnKeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled if NavigationKeyHandler(key, press).handled
return true return true
end if end if
@@ -66,7 +67,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return false return false
end if end if
if key = "back" if key = RemoteKeys.Back
Close() Close()
return true return true
end if end if
@@ -12,7 +12,7 @@
"Deleting system32...", "Deleting system32...",
"Updating: 3 hours 32 minutes remaining...", "Updating: 3 hours 32 minutes remaining...",
"Asking ChatGPT for humorous loading messages...", "Asking ChatGPT for humorous loading messages...",
"Loading today's sponsor... NordVPN!", "Loading today's sponsor... Just kidding!",
"Don't worry, this is normal...", "Don't worry, this is normal...",
"Don't forget to like and subscribe...", "Don't forget to like and subscribe...",
"Shoveling coal into the server...", "Shoveling coal into the server...",
+2 -2
View File
@@ -2,8 +2,8 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=24 minor_version=25
build_version=00005 build_version=00000
ui_resolutions=hd ui_resolutions=hd
@@ -16,9 +16,9 @@ namespace Tests
node1 = CreateObject("roSGNode", "Node") node1 = CreateObject("roSGNode", "Node")
node2 = CreateObject("roSGNode", "Node") node2 = CreateObject("roSGNode", "Node")
m.top@.SetNavigation(node1, "right", node2) m.top@.SetNavigation(node1, RemoteKeys.Right, node2)
m.assertAAHasKey(m.node._navigation, "right") m.assertAAHasKey(m.node._navigation, RemoteKeys.Right)
end function end function
@it("navigates to the right node") @it("navigates to the right node")
@@ -26,12 +26,12 @@ namespace Tests
node1 = CreateObject("roSGNode", "Node") node1 = CreateObject("roSGNode", "Node")
node2 = CreateObject("roSGNode", "Node") node2 = CreateObject("roSGNode", "Node")
m.top@.SetNavigation(node1, "right", node2) m.top@.SetNavigation(node1, RemoteKeys.Right, node2)
NodeSetFocus(node1, true) NodeSetFocus(node1, true)
node2.focusable = true node2.focusable = true
m.top@.NavigationKeyHandler("right", true) m.top@.NavigationKeyHandler(RemoteKeys.Right, true)
m.assertFalse(node1.hasFocus()) m.assertFalse(node1.hasFocus())
m.assertTrue(node2.hasFocus()) m.assertTrue(node2.hasFocus())
@@ -41,11 +41,11 @@ namespace Tests
function _() function _()
node2 = CreateObject("roSGNode", "Node") node2 = CreateObject("roSGNode", "Node")
m.top@.SetNavigation(invalid, "right", node2) m.top@.SetNavigation(invalid, RemoteKeys.Right, node2)
node2.focusable = true node2.focusable = true
m.top@.NavigationKeyHandler("right", true) m.top@.NavigationKeyHandler(RemoteKeys.Right, true)
m.assertTrue(node2.hasFocus()) m.assertTrue(node2.hasFocus())
end function end function
@@ -0,0 +1,20 @@
' https://developer.roku.com/en-ca/docs/references/scenegraph/component-functions/onkeyevent.md
enum RemoteKeys
Back = "back"
Up = "up"
Down = "down"
Left = "left"
Right = "right"
Ok = "OK"
Replay = "replay"
Play = "play"
PlayOnly = "playonly"
Rewind = "rewind"
FastForward = "fastforward"
Options = "options"
Pause = "pause"
' Long press keys - these are not standard, and used to handle long press events
OkLongPress = "OK_LONG_PRESS"
OptionsLongPress = "OPTIONS_LONG_PRESS"
end enum
+31 -35
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.24.5", "version": "0.25.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-web", "name": "playlet-web",
"version": "0.24.5", "version": "0.25.0",
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.1", "@sveltejs/vite-plugin-svelte": "^3.1.1",
"@tailwindcss/typography": "^0.5.13", "@tailwindcss/typography": "^0.5.13",
@@ -16,15 +16,15 @@
"daisyui": "^4.12.10", "daisyui": "^4.12.10",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"ip": "^2.0.1", "ip": "^2.0.1",
"postcss": "^8.4.38", "postcss": "^8.4.39",
"svelte": "^4.2.18", "svelte": "^4.2.18",
"svelte-check": "^3.8.4", "svelte-check": "^3.8.4",
"svelte-preprocess": "^6.0.1", "svelte-preprocess": "^6.0.2",
"tailwindcss": "^3.4.4", "tailwindcss": "^3.4.6",
"terser": "^5.31.1", "terser": "^5.31.3",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"typescript": "^5.5.2", "typescript": "^5.5.3",
"vite": "^5.3.2", "vite": "^5.3.4",
"vite-tsconfig-paths": "^4.3.2" "vite-tsconfig-paths": "^4.3.2"
} }
}, },
@@ -3625,9 +3625,9 @@
} }
}, },
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
"dev": true "dev": true
}, },
"node_modules/picomatch": { "node_modules/picomatch": {
@@ -3661,9 +3661,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.4.38", "version": "8.4.39",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz",
"integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -3681,7 +3681,7 @@
], ],
"dependencies": { "dependencies": {
"nanoid": "^3.3.7", "nanoid": "^3.3.7",
"picocolors": "^1.0.0", "picocolors": "^1.0.1",
"source-map-js": "^1.2.0" "source-map-js": "^1.2.0"
}, },
"engines": { "engines": {
@@ -4300,15 +4300,11 @@
} }
}, },
"node_modules/svelte-preprocess": { "node_modules/svelte-preprocess": {
"version": "6.0.1", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-6.0.1.tgz", "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-6.0.2.tgz",
"integrity": "sha512-vNgXoyqWwahdpEX9XbQHcAHt41TkXnf8bRDxT5PjISHbZD1dVH4b2OsJ2fVQTBb3qP05x0GuYE9iS5vhD+Dniw==", "integrity": "sha512-OvDTLfaOkkhjprbDKO0SOCkjNYuHy16dbD4SpqbIi6QiabOMHxRT4km5/dzbFFkmW1L0E2INF3MFltG2pgOyKQ==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": {
"detect-indent": "^6.1.0",
"strip-indent": "^3.0.0"
},
"engines": { "engines": {
"node": ">= 18.0.0" "node": ">= 18.0.0"
}, },
@@ -4365,9 +4361,9 @@
"dev": true "dev": true
}, },
"node_modules/tailwindcss": { "node_modules/tailwindcss": {
"version": "3.4.4", "version": "3.4.6",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.4.tgz", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.6.tgz",
"integrity": "sha512-ZoyXOdJjISB7/BcLTR6SEsLgKtDStYyYZVLsUtWChO4Ps20CBad7lfJKVDiejocV4ME1hLmyY0WJE3hSDcmQ2A==", "integrity": "sha512-1uRHzPB+Vzu57ocybfZ4jh5Q3SdlH7XW23J5sQoM9LhE9eIOlzxer/3XPSsycvih3rboRsvt0QCmzSrqyOYUIA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@alloc/quick-lru": "^5.2.0", "@alloc/quick-lru": "^5.2.0",
@@ -4427,9 +4423,9 @@
} }
}, },
"node_modules/terser": { "node_modules/terser": {
"version": "5.31.1", "version": "5.31.3",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz",
"integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@jridgewell/source-map": "^0.3.3", "@jridgewell/source-map": "^0.3.3",
@@ -4525,9 +4521,9 @@
"dev": true "dev": true
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.5.2", "version": "5.5.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz",
"integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
@@ -4614,13 +4610,13 @@
"dev": true "dev": true
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "5.3.2", "version": "5.3.4",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.3.2.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.4.tgz",
"integrity": "sha512-6lA7OBHBlXUxiJxbO5aAY2fsHHzDr1q7DvXYnyZycRs2Dz+dXBWuhpWHvmljTRTpQC2uvGmUFFkSHF2vGo90MA==", "integrity": "sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"esbuild": "^0.21.3", "esbuild": "^0.21.3",
"postcss": "^8.4.38", "postcss": "^8.4.39",
"rollup": "^4.13.0" "rollup": "^4.13.0"
}, },
"bin": { "bin": {
+7 -7
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.24.5", "version": "0.25.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@@ -17,15 +17,15 @@
"daisyui": "^4.12.10", "daisyui": "^4.12.10",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"ip": "^2.0.1", "ip": "^2.0.1",
"postcss": "^8.4.38", "postcss": "^8.4.39",
"svelte": "^4.2.18", "svelte": "^4.2.18",
"svelte-check": "^3.8.4", "svelte-check": "^3.8.4",
"svelte-preprocess": "^6.0.1", "svelte-preprocess": "^6.0.2",
"tailwindcss": "^3.4.4", "tailwindcss": "^3.4.6",
"terser": "^5.31.1", "terser": "^5.31.3",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"typescript": "^5.5.2", "typescript": "^5.5.3",
"vite": "^5.3.2", "vite": "^5.3.4",
"vite-tsconfig-paths": "^4.3.2" "vite-tsconfig-paths": "^4.3.2"
} }
} }
+1
View File
@@ -1,2 +1,3 @@
# Playlet Brighterscript Plugins # Playlet Brighterscript Plugins
This is the folder containing different [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md) used by Playlet. Find their documentation [here](/docs/plugins.md) This is the folder containing different [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md) used by Playlet. Find their documentation [here](/docs/plugins.md)
+1 -1
View File
@@ -155,7 +155,7 @@ export class LocaleValidationPlugin implements CompilerPlugin {
start: { line: 0, character: 0 }, start: { line: 0, character: 0 },
end: { line: 0, character: 0 } end: { line: 0, character: 0 }
}, },
message: `Missing keys in enum from ${translationFile}: ${missingKeys.join(', ')}`, message: `Missing keys in enum from ${translationFile.srcPath}: ${missingKeys.join(', ')}`,
severity: DiagnosticSeverity.Error, severity: DiagnosticSeverity.Error,
code: 'LOCALE_MISSING_ENUM_KEYS', code: 'LOCALE_MISSING_ENUM_KEYS',
}]); }]);