Compare commits

...
125 Commits
Author SHA1 Message Date
Brahim Hadriche bb0a0725d6 Release 0.20.2 (#311) 2024-02-26 18:57:52 -05:00
Brahim Hadriche f2ffb42876 refactor url encoded form requests 2024-02-26 18:44:57 -05:00
Brahim Hadriche edbfc86e56 changelog 2024-02-26 09:47:18 -05:00
Brahim Hadriche b25eaafc82 Fix for sponsorblock highlight label 2024-02-26 09:46:20 -05:00
Brahim Hadriche ef9c653ad7 Device connected notification only show once every half hour per device to avoid spam 2024-02-25 22:16:01 -05:00
Andrey LazarevichandBrahim Hadriche e9f015bb19 OK button as Play/Pause (#307)
* OK button as Play/Pause

First OK press now shows Video UI.
It's achievable via hidden Roku Video node property `showUI`, which allows you to override how trickplay should be displayed by specifying parts of the UI to be rendered (like 'titleAndTime', 'trickplayBar', e.t.c). A timer is started every time custom UI is shown to prevent UI from staying forever.

Second OK press while UI is visible pauses the video (pause poster animation is not added yet).

However, since we shouldn't break default OK button actions, we must track whether user is seeking in video UI and if they do, fallback to Video internal OK handler.

Also, auto-formatted VideoPlayer.xml

* fix comment typo

* move HideUI function slightly higher

* Addressed the feedback:

* Add a workaround to leave Live video behavior intact (no pause, ok simply switches UI back and forth)
* Hide UI when minimizing to avoid a bug where title and time element could stay forver
* More aggressive `isSeeking` detection, so every left/right/ff/rw button press would cause us to fall back to default OK button handler

* More accurate liveNow handling

* Changelog

---------

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-02-25 20:05:11 -05:00
Brahim Hadriche 544671f246 remove old todo 2024-02-25 19:55:13 -05:00
Brahim Hadriche f45ba30979 Colored logs for debugging (#308)
* Colored logs for debugging

* disable colors
2024-02-25 19:06:27 -05:00
Brahim Hadriche 4953e4481f Rename files for consistency 2024-02-24 19:08:43 -05:00
Brahim Hadriche c7b0815768 New focus 9 patch textures 2024-02-24 19:03:12 -05:00
Brahim Hadriche 4ab7f74a4e More adjustments to context menu 2024-02-24 16:58:18 -05:00
Brahim Hadriche 96916f6c37 Formatting 2024-02-24 11:44:03 -05:00
Brahim Hadriche eafad684b6 Small improvement 2024-02-24 11:40:52 -05:00
Brahim Hadriche 14d3e38aeb Tweaks to remote screen UI 2024-02-23 22:21:44 -05:00
afe281c094 [chore] update dependencies (#306)
* update dependencies

* Update package.json

* lock file

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-02-23 20:04:14 -05:00
Brahim Hadriche 436078bdf8 Release 0.20.1 (#305) 2024-02-23 18:24:00 -05:00
Brahim Hadriche 20120538e4 Small perf optm 2024-02-23 17:04:33 -05:00
Brahim Hadriche eec4101d29 Fix for repeated 2024-02-23 12:44:55 -05:00
Brahim Hadriche b135ba2a0a Log connect and disconnect events 2024-02-22 23:40:40 -05:00
Brahim Hadriche 9c9f24cb39 rollback rooibos 2024-02-22 19:37:17 -05:00
Brahim Hadriche 6aeb4bc8b9 Changelog 2024-02-22 19:16:55 -05:00
Brahim Hadriche 4beb7fbf3c humor 2024-02-22 19:16:23 -05:00
Brahim Hadriche 4f3512023f Move devices array to lounge api class 2024-02-22 18:58:47 -05:00
Brahim Hadriche f38115171b Error handling for registry script 2024-02-22 17:11:51 -05:00
Brahim Hadriche 7456917cec fix rale tracker warnings 2024-02-22 13:30:51 -05:00
Brahim Hadriche 4482d3333f Update info and screenshots 2024-02-21 19:52:40 -05:00
Brahim Hadriche 1112070f63 Release v0.20.0 (#301) 2024-02-21 19:39:53 -05:00
Brahim Hadriche 37dde57c67 Adjust lounge notification 2024-02-21 19:27:54 -05:00
Brahim Hadriche b52cd6f01b silence unused var warnings 2024-02-21 18:40:42 -05:00
Brahim Hadriche aa5be75e06 changelog typo 2024-02-21 12:57:05 -05:00
Brahim Hadriche 188463c6a7 queue fix 2024-02-20 22:43:02 -05:00
Brahim Hadriche 793842f4dd Do not add entire playlist if it already exists 2024-02-20 22:28:54 -05:00
Brahim Hadriche 7ca98e7ef2 remove region arg from video fetch job 2024-02-20 21:47:49 -05:00
Brahim Hadriche 77204c4449 randomize zx 2024-02-20 16:23:29 -05:00
Brahim Hadriche 190548245a changelog 2024-02-20 12:10:03 -05:00
Brahim Hadriche 71f9820ed6 Improve video queue caching 2024-02-20 11:47:48 -05:00
Brahim Hadriche 87e50e713f Add a TODO 2024-02-19 22:20:55 -05:00
Brahim Hadriche 2d55569614 another small adjustment 2024-02-19 16:32:09 -05:00
Brahim Hadriche 83a59a5e9c small adjustment 2024-02-19 16:31:47 -05:00
Brahim Hadricheandgithub-action linter 7d1ba07286 Cast using Youtube app (DIAL/LoungeAPI) (#276)
* Dial+Lounge API PoC

* format

* Fix for chrome

* comments

* Rate limit and logger stuff

* rename route

* remove invalid routes

* remove device image

* Simplify device description

* command test

* Lint fix

* register pairing code

* tv code UI

* Lint fix

* Avoid creating lots of objects

* dpad command

* small refactor

* tweak

* validation

* timer

* fix

* Revert "timer"

This reverts commit e349565910882408898c9bddda55dadaa9d743de.

* Commands

* setVolume command

* lounge service timer

* Some state messages

* Lint fix

* player state sync

* voice handler

* Adjustments, and add a TODO list

* Lint fix

* comment

* play at timestamp

* Remote screen UI

* UI adjustment

* Small refactor

* Refactor long polling

* Add TODO

* Manage logging a bit better to avoid spam in DIAL server

* cache dial file

* logging

* comment

* Join lounge lazily

* long poller tweak

* ui tweak

* set shouldQuit field

* remote connect notification

* Lint fix

* Randomize device id, new device on start

* Lint fix

* Lounge disconnect on start

* Speed up lounge by not blocking on sent messages

* add version to lounge data saved

* dial server fix rendezvous

* todo

* no message

* Display network name

* playlist changes

* Lint fix

* tweak params

* tweak

* player state

* comments

* Refactor Video Queue (#295)

* Refactor Video Queue

* Video queue and playlists

* Web app casting

* queue playlist notification

* VideoQueueView work

* restore properties

* changes

* queue notification and previous/next state

* Lint fix

* very basic error handling

* Update changelog and privacy policy

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-02-19 16:30:48 -05:00
github-actions[bot]andiBicha ec9178d687 update dependencies (#294)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-02-16 21:56:38 -05:00
Brahim Hadriche 84c6d822e2 load embedded lib if libs are not being served in dev mode 2024-02-16 12:24:28 -05:00
Brahim Hadriche 7503c2dbd6 handle live links 2024-02-16 12:22:17 -05:00
Brahim Hadriche ca3cad4058 Adjust filters button 2024-02-13 18:34:04 -05:00
Brahim Hadriche c7f14dfc38 Removed fields from Invidious requests 2024-02-12 22:35:59 -05:00
Brahim Hadriche ac3d1cea17 Small logger optimization 2024-02-12 12:33:39 -05:00
Brahim Hadriche 93ea822f27 Release v0.19.2 (#291) 2024-02-11 10:51:42 -05:00
Brahim Hadriche d73a03d3bf Bug fixes 2024-02-11 10:45:08 -05:00
Brahim Hadriche 45736dd8ec Missed one 2024-02-10 12:57:57 -05:00
Brahim Hadriche 90565ccb07 Name fix 2024-02-10 12:42:34 -05:00
Brahim Hadriche b72173f588 Update transpiled files 2024-02-09 19:49:02 -05:00
github-actions[bot]andiBicha 2d759c1c39 update dependencies (#285)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-02-09 19:45:13 -05:00
Brahim Hadricheandgithub-action linter 11fb644fc6 Fix queue notification hint (#284)
* Fix queue notification hint

* Lint fix

* duplicate import

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-02-09 19:34:48 -05:00
Brahim Hadriche b076517c1b Logging fix 2024-02-05 15:20:18 -05:00
Brahim Hadriche 74082f406a Number control (#282) 2024-02-05 10:36:14 -05:00
Brahim Hadriche f3aeb58b38 Misc. (#281)
* Logger

* etag cache fix

* xml refactor

* whitespace

* NodePathUtils

* Http2
2024-02-05 09:56:22 -05:00
github-actions[bot]andiBicha 44ee6681c5 update dependencies (#278)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-02-02 23:19:46 -05:00
Brahim Hadriche 85e30c8b22 Add additional logs to token verification (#279) 2024-02-02 20:23:06 -05:00
Brahim Hadriche 80d3d24e39 Loop context menu items 2024-01-28 19:00:01 -05:00
Brahim Hadriche a7bdab30bc Plugin fix 2024-01-26 21:12:15 -05:00
github-actions[bot]andiBicha 3858681b80 update dependencies (#274)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-01-26 21:02:15 -05:00
Brahim Hadriche e0cf59d90f Use POST for search history 2024-01-26 15:52:36 -05:00
Brahim Hadriche d9b8aaa222 Fix dialog not closing on load failure 2024-01-24 16:29:22 -05:00
Brahim Hadriche b1a373f98d Adjust image mask 2024-01-23 16:36:13 -05:00
Brahim Hadricheandgithub-action linter 1078459eb7 Registry router (#273)
* Registry router

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-01-22 20:36:47 -05:00
Brahim Hadriche 14cc537032 Clarify that Invidious account is different from Youtube 2024-01-22 18:02:11 -05:00
Brahim Hadriche db755c4158 [skip ci] tweak 2024-01-22 13:51:52 -05:00
Brahim Hadriche ed068f6599 Add a null check 2024-01-22 08:00:19 -05:00
github-actions[bot]andiBicha 45011a54f0 update dependencies (#272)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-01-20 12:15:16 -05:00
Brahim Hadriche 8c71a5be88 [skip ci] comment 2024-01-17 14:52:04 -05:00
Brahim Hadriche d059fced58 adjust config 2024-01-16 21:44:42 -05:00
Brahim Hadriche ea2be153b0 bug fix 2024-01-16 11:26:09 -05:00
Brahim Hadriche 7e5b2246fa [refactor] web server routing system (#270)
* [refactor] web server routing system

* regex literal

* Docs
2024-01-15 19:25:13 -05:00
Brahim Hadriche a710a23444 Update spinner asset 2024-01-15 12:13:26 -05:00
Brahim Hadriche a3b3a143a5 Add colorInfo to dash 2024-01-13 14:49:10 -05:00
Brahim Hadriche 1172a82a26 Release v0.19.1 (#266) 2024-01-13 11:42:59 -05:00
Brahim Hadriche c002028727 bug fix in retry code 2024-01-13 10:54:22 -05:00
github-actions[bot]andiBicha 3ab65587df update dependencies (#265)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-01-12 23:04:15 -05:00
Brahim Hadriche 4d4fab4e06 Update README.md 2024-01-12 16:51:02 -05:00
Brahim Hadriche 9cfe14e87e Update README.md 2024-01-12 16:50:45 -05:00
Brahim Hadriche e80a41ca72 [skip ci] various small changes 2024-01-12 10:26:06 -05:00
Brahim Hadriche 4e8dfe1a23 [skip ci] rename 2024-01-11 21:19:05 -05:00
Brahim Hadriche e6302e48fe Full screen hint (#264) 2024-01-11 14:56:41 -05:00
Brahim Hadriche 7796c63291 Change for the search keyboard layout (#262) 2024-01-11 12:19:33 -05:00
Brahim Hadriche dc148a7c59 Bookmark groups added to top of list (#263)
* Bookmark groups added to top of list

* changelog
2024-01-11 11:58:26 -05:00
Brahim Hadriche 9df1b70e49 Release v0.19.0 (#258) 2024-01-10 17:12:53 -05:00
Brahim Hadriche bb471a5cde Sponsorblock tweak 2024-01-09 23:09:47 -05:00
Brahim Hadriche b68aad7d4a Add links to internal state 2024-01-09 22:08:23 -05:00
Brahim Hadriche 73b6314ec7 Add app logs to log file
Refactor a new functions by adding name spaces
Startup times are now logged
2024-01-09 14:19:54 -05:00
Brahim Hadriche 29969db3e4 use location hash to store current tab 2024-01-08 20:42:39 -05:00
Brahim Hadriche 5335a0273b Feature/optimize task imports (#257)
* Prune empty code files

* delete file

* Restore

* refactor

* fix warnings

* Fix tasks

* Add diag

* tweak

* Log load times

* changelog
2024-01-08 19:38:39 -05:00
Brahim Hadriche 641c9ef5bf setting description tweak 2024-01-07 22:39:27 -05:00
Brahim Hadriche b0257d97e0 [skip ci] docs 2024-01-07 22:24:20 -05:00
Brahim Hadriche 5c9c1c204f [skip ci] plugin docs 2024-01-07 22:16:14 -05:00
Brahim Hadriche 11afc34ecc [skip ci] typo 2024-01-07 19:06:13 -05:00
Brahim Hadriche 3edfce1366 Fix for bookmarked invalid videos (#255)
* Fix for bookmarked invalid videos

* Update InvidiousService.bs

* Change status code
2024-01-07 16:48:58 -05:00
Brahim Hadriche 5ff02af7ac Remove deprecated related channels leftover 2024-01-07 16:40:55 -05:00
Brahim Hadriche 0cc8cdf2be [skip ci] add close button to layout editor in web app 2024-01-07 11:48:00 -05:00
Brahim Hadriche 3ecac831bf [skip ci] warn on failed requests 2024-01-07 11:21:07 -05:00
Brahim Hadriche 86d5710969 Fix HTTP/0.9 when not allowed errors (#253)
* Fix `HTTP/0.9 when not allowed` errors

* tweak retry callback

* throw ex in debug mode
2024-01-07 11:17:05 -05:00
Brahim Hadriche 575935f5ac Generate type validation functions (#254) 2024-01-07 11:08:03 -05:00
Brahim Hadriche 7eb20dfe2c [skip ci] comment 2024-01-06 18:55:59 -05:00
Brahim Hadriche 0b01830ad9 changelog edit 2024-01-06 18:31:46 -05:00
33fdf796a2 update dependencies (#251)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-01-06 18:24:51 -05:00
Brahim Hadricheandgithub-action linter fd7bdde733 Customize home screen (#250)
* Customize home screen

* remove logs

* Lint fix

* move func

* Fix for checklist

* Fix save state

* open api

* Fix spec

* Changelog

* Add TODO

* Button size

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-01-06 18:17:29 -05:00
Brahim Hadriche e7324495fe [skip ci] add MathUtils 2024-01-06 10:01:59 -05:00
Brahim Hadriche 2e7b3d0aa5 Add curl error codes 2024-01-06 10:00:17 -05:00
Brahim Hadriche 20f345593e [skip ci] small tweak in http client 2024-01-02 21:05:16 -05:00
Brahim Hadriche 754da7e836 [skip ci] typo 2024-01-02 18:08:33 -05:00
Brahim Hadriche 85c3eb8321 Screenshots (#249) 2024-01-02 13:45:57 -05:00
Brahim Hadriche e59e45e310 Release v0.18.1 (#248) 2024-01-02 12:48:57 -05:00
Brahim Hadriche 2548fb9097 Fix/invalid subs (#247)
* Sort

* Remove invalid

* Fix for unsupported subtitles

* Actually disable unsupported subs
2024-01-02 12:34:44 -05:00
Brahim Hadriche 1cb80f71b5 Use asyncStopSemantics to prevent execution timeout crashes (#246)
* Use asyncStopSemantics to prevent execution timeout crashes

* Clarify

* Changelog

* no message
2024-01-02 11:05:47 -05:00
Brahim Hadriche 0a7a6c65e2 Bug fix 2024-01-02 10:57:14 -05:00
Brahim Hadriche 529b915d7f [skip ci] Add comment with supported subtitle languages 2024-01-01 15:15:21 -05:00
Brahim Hadriche a76a2cb77f [skip ci] typo 2024-01-01 13:01:49 -05:00
Brahim Hadriche 707739b901 small refactor 2024-01-01 10:52:14 -05:00
Brahim Hadriche 8c72258879 Add TODO 2024-01-01 10:40:13 -05:00
Brahim Hadriche d245c072e9 Remove Funny and News from home screen (#245) 2023-12-30 22:47:06 -05:00
Brahim Hadriche 0f000590a0 Fixes for RowList cells (#244)
* Fixes for RowList cells

* typo
2023-12-30 22:32:43 -05:00
Brahim Hadriche 93c1e48d39 Add TODO 2023-12-30 19:21:21 -05:00
d6c7d81347 [chore] update dependencies (#243)
* Add TODO

* update dependencies

* plugin fix

---------

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2023-12-29 22:46:52 -05:00
Brahim Hadriche 331f2ff3cb Add playlist updated field in web app 2023-12-29 17:58:30 -05:00
Brahim Hadriche 6c42fbe056 Add tab titles in web app 2023-12-29 11:04:19 -05:00
Brahim Hadriche 7e8c828007 Remove legacy stuff 2023-12-28 18:17:42 -05:00
253 changed files with 8140 additions and 3067 deletions

No files matched your search

+113 -3
View File
@@ -5,6 +5,116 @@ 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.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.20.2] - 2024-02-26
### Added
- Small improvement in the context menu of the Playlist view
- Videos can be paused and resumed using the `Ok` remote button
### Fixed
- `Device connected` notification only show once every 30 minutes per device to avoid spam
- SponsorBlock category "highlight" was not visible in chapter label
### Changed
- UI focus images are now with rounded corners, and with a slight glow
## [0.20.1] - 2024-02-23
### Fixed
- `Device connected` notification showing repeatedly
## [0.20.0] - 2024-02-21
### Added
- Support for casting from the YouTube app (also known as Lounge API, or LeanBack)
- Connect to Playlet from the YouTube mobile app or from certain browsers (such as Chrome)
- Connect to Playlet from local network, or through the TV code.
- On the cast dialog in your YouTube mobile app, you might see two listings for the same device. E.g. `Roku TV` and `Playlet on Roku TV`. Use the `Playlet on` one to cast to Playlet, and the other one to cast to the regular YouTube TV app.
- The functionality is still experiemntal, and has some limitations. To name a few:
- The queue does not perfectly sync between the mobile app and Playlet, espeically if it gets modified by the web app or in Playlet.
- Many functions (such as d-pad controls or setting the volume) are not working due to OS limitations
- Many functions (such as changing the subtitle settings) are not currently implemented
- **ATTENTION**: This feature is not very privacy friendly. When connected to a lounge, all network traffic (videos played, queued, etc) go through YouTube servers. For this reason, certain measures are taken:
- While Playlet broadcasts its casting capabilities to the local network, it does not connect to a lounge for the first time until:
- A device connects to Playlet (using DIAL/Connect using Wi-Fi)
- A `Link with TV code` is generated, by visiting the `Remote` -> `Link with TV code` tab.
- Playlet disconnects from previous lounge sessions on start, and joins a new one instead of one continous session. In other words, restarting Playlet will disconnect your second device. This is a feature, not a bug.
- Playlet does not expose device details, and uses a randomly generated id on each start, instead of consistent device id.
### Changed
- The queue no longer contains playlists. When a playlist is added to the queue, the entire playlist is loaded.
- It can take a few seconds to load large playlist before it can be added to the queue
- This is done to be more compatible more the lounge, which does not contain "Playlists in the queue" concept.
- The `Web App` tab is now called `Remote`. It can be used to open the web app, or connect using Lounge (cast from YouTube)
- Removed `fields` from Invidious requests, as per [https://github.com/iv-org/invidious/pull/4276](https://github.com/iv-org/invidious/pull/4276)
- The `POST /api/queue/` no longer returns the current queue. Instead it returns a 204.
### Fixed
- [Perf] improved some caching of videos in the queue
## [0.19.2] - 2024-02-11
### Fixed
- [Attempt #2] to fix a crash caused by execution timeout when stopping a video takes too long
- Wrong hint on the "added to queue" notification when in fullscreen
- A rare crash when listing Invidious public instances
- Restoring video to full screen not working when on certain screens
## [0.19.1] - 2024-01-13
### Added
- A hint on how to restore video to full screen
### Changed
- Bookmarks are now added to the top of the list
- The search screen keyboard to make it easier to clear the search field
### Fixed
- A bug with request retry mechanism introduced in 0.19.0
## [0.19.0] - 2024-01-10
### Added
- A home screen editor allowing to enable/disable feeds, and change their order.
- The editor can be accessed from the Settings screen.
### Fixed
- `HTTP/0.9 when not allowed` errors by adding a retry to web requests
- Issue where a bookmarked video is no longer valid (such as a video made private, or a live stream that ended)
- [Perf] App loads slightly faster (~500ms)
## [0.18.1] - 2024-01-02
### Fixed
- A rare bug that causes the app to crash when displaying video cells
- A rare bug where a long press can cause a crash
- [Attempt] to fix a crash caused by execution timeout when stopping a video takes too long
- Unsupported subtitles (subtitles that can't be rendered will not be used)
### Removed
- `Funny` and `News` from the Home screen.
- These are not standard feeds (like `Trending`), and are just search results for `Funny` and `News`. They were added in earlier Playlet versions to have more content in the Home screen.
- If you like to add these two feeds to your bookmarks:
- Search for `Funny` (or `News`)
- Set the `Sort by` filter to `Upload date`
- Press and hold the `Ok` button while a video from the search result is selected
- Choose the `Add to "Search - Funny"` option
## [0.18.0] - 2023-12-28
### Added
@@ -301,7 +411,7 @@ This version went through a major refactor, which resulted in a different arcite
- Dark mode
- Also includes a dev menu
- Hidden by default, use `dev=1` in the browser to show it
- Improved drag and drop functionality (drag and drop a link from Youtube into the web app)
- Improved drag and drop functionality (drag and drop a link from YouTube into the web app)
- New settings page, available on TV and web app
- New preferences system
- Unified settings between TV and web app
@@ -358,7 +468,7 @@ This version went through a major refactor, which resulted in a different arcite
### Added
- A script to sync between Youtube profile and and Invidious profile
- A script to sync between YouTube profile and and Invidious profile
- Moved most of Playlet logic to Playlet Lib
- Support for multiple caption languages
@@ -406,7 +516,7 @@ This version went through a major refactor, which resulted in a different arcite
- Loading spinner
- Picture in picture support
- [Deep linking support](https://developer.roku.com/en-ca/docs/developer-program/discovery/implementing-deep-linking.md)
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the Youtube video id
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the YouTube video id
- Error and Exit dialogs
### Fixed
+24 -11
View File
@@ -1,39 +1,52 @@
# PRIVACY POLICY
## Playlet
Playlet, the Roku app, does not collect any user information whatsoever.
In fact, it does not have any servers capable of collecting any form of data.
Playlet does not show advertising, whether personalized or non personalized.
## Invidious
Playlet may request information from one or more [Invidious](https://invidious.io/)
servers, depending on user configuration. With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
servers, depending on user configuration. With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
is sent, which is used to enable the viewing of content.
Please note that some of the [Invidious](https://invidious.io/) servers used
could be public instances hosted by volenteers. These instances are available
[here](https://api.invidious.io/).
[here](https://api.invidious.io/).
While invidious does no data collection by default, and it is in fact built to
be privacy driven, but in theory, from a playlet request it is possible to
know the IP address of a user, the identifiers of watched video, and search
be privacy driven, but in theory, from a playlet request it is possible to
know the IP address of a user, the identifiers of watched video, and search
keywords. In case the user has privacy concerns, they can host their own
Invidious instance and use it from Playlet.
## SponsorBlock
Playlet may request information from a [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
server, in order to get sponsor sections for requested videos to watch.
With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
is sent, which is used to enable the viewing of content.
Playlet uses hashing when requesting video metadata, which obfuscates
Playlet uses hashing when requesting video metadata, which obfuscates
the video id requested. This is a SponsorBlock privacy feature that protects
user privacy.
Additionally, Playlet may send a "skipped" event to SponsorBlock, to indicate
that a section of a video has been skipped. This event does not have any
tracking information attached to it, and it is anonymous. It is merely to
indicate to contributers how much their contributions are being used in the wild.
that a section of a video has been skipped. This event does not have any
tracking information attached to it, and it is anonymous. It is merely to
indicate to contributers how much their contributions are being used in the wild.
## LeanBack
LeanBack, also known as Lounge API, also known as "cast from phone". Is a feature that Playlet implmements as a convenience to allow users to use a separate device to browse and cast videos.
When this feature is used, all traffic related to the videos being watched, added to the queue, and the video player state is routed through YouTube servers.
Playlet tries to preserve user privacy, to the best of its ability, by implementing several techniques, such as randomizing device id, using a fresh session on each start, and only providing necessary fields for the feature to function.
Additionally, Playlet does not join a session/lounge, until a device is attempting to connect using DIAL (**DI**scovery **A**nd **L**aunch spec), or when a `Link with TV code` is generated, by visiting the appropriate settings page.
If you have privacy concerns and do not wish to use this functionality, simply do not connect from a local network using the YouTube app or the browser, and do not visit the `Link with TV code` tab.
+13 -12
View File
@@ -19,7 +19,7 @@
# Playlet
Playlet is an unofficial Youtube client for Roku 📺
Playlet is an unofficial YouTube client for Roku 📺
## Screenshots
@@ -42,16 +42,16 @@ More under [Screenshots](./docs/screenshots/README.md)
- 🕵️ No Tracking
- 🛡️ Privacy driven (uses Invidious backend)
- ⚔️ SponsorBlock integration (skips undesirable sections in videos)
- 📱 Browse, search, and cast from phone using the web app
- 📱 Browse, search, and cast from phone using the YouTube app or the browser
- 🔮 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)
### Cast from phone
1. Open "Web app" tab in Playlet
1. Scan QR Code with Phone
1. Browse or search videos
1. Click the video and choose the "Play on TV" option
- Open "Remote" tab in Playlet
- Scan QR Code with Phone, and use the browser; OR
- Use the YouTube app to connect using the same Wi-Fi; OR
- Use the `Link with TV code` to connect
### Picture-in-picture
@@ -63,7 +63,7 @@ More under [Screenshots](./docs/screenshots/README.md)
1. Open settings in Playlet
1. Select Invidious -> Instance
1. Set a custom instance, or choose a public one hosted by volunteers (from https://api.invidious.io/)
1. Set a custom instance, or choose a public one hosted by volunteers (from [api.invidious.io](https://api.invidious.io/))
1. Optionally, Select `Test instance` to make sure it works
1. Hit save
@@ -76,7 +76,7 @@ For everything related to Playlet app development, please see the [documentation
## Analytics and reporting
We do not collect any usage data, anonymous or not. But Roku does, and you can find the data made available to Playlet in the [Wiki](https://github.com/iBicha/playlet/wiki).
Most software in the wild collect some data to make sure things work, and to prioritize features.
Most software in the wild collect some data to make sure things work, and to prioritize features.
Because we don't do that, we wouldn't know if people using Playlet are facing issues, unless these issues get reported.
Playlet could run on variaty of devices, with different capabilities and screen sizes, and different Invidious instances.
That's why it's important to report any issues you encouter using Playlet, otherwise it's unlikely that they get addressed.
@@ -89,10 +89,10 @@ play•let /ˈplālət/
: a short play
```
**Playlet** is about keeping the time you spend on Youtube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
**Playlet** is about keeping the time you spend on YouTube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
There's a cliché about how a lot of open source software is **`"Made with ♡"`**. This project in particular is **not**.<br/>
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable Youtube ads for a lifetime.
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable YouTube ads for a lifetime.
By removing all the bloat, the ads, the tracking, we could end up with an even faster app than the official one.
@@ -101,6 +101,7 @@ In any case, I hope you find **Playlet** useful, and pleasant to use.
## Disclaimer
**Playlet** does not serve or distribute any material from unauthorized sources.<br/>
**Playlet** is simply a frontend to other systems (such as [Invidious](https://github.com/iv-org/invidious)), bringing the watching experience to the TV, as opposed to the existing frontends that are web and mobile focused.
**Playlet** is simply a frontend to other systems (such as [Invidious](https://github.com/iv-org/invidious)), bringing the watching experience to the TV, as opposed to the existing frontends that are web and mobile focused.<br/>
**Playlet** authors acknowledge that all trademarks and registered trademarks mentioned in this repository and related pages are the property of their respective owners. The use of these trademarks or trade names is for identification purposes only and does not imply any endorsement, affiliation, or sponsorship by the trademark owner.
<!-- markdownlint-configure-file {"MD024": { "siblings_only": true } } -->
+8 -4
View File
@@ -3,7 +3,7 @@
"createPackage": false,
"diagnosticFilters": [
{
"src": "**/*.part.xml",
"src": "components/**/*.part.xml",
"codes": [
// 1067 - Cannot find function with name '${name}' in component scope
// This is to prevent errors where the onChange function is not found in the component scope
@@ -45,10 +45,11 @@
"files": [
"source/**",
"components/**",
"!components/**/*.part.xml",
"images/**",
"!**/*.psd",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"config/**",
"lib/**",
"www/**",
@@ -70,11 +71,14 @@
"../tools/bs-plugins/json-yaml-plugin.ts",
"../tools/bs-plugins/validation-plugin.ts",
"../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts"
"../tools/bs-plugins/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts"
],
"retainStagingDir": true,
"require": [
"ts-node/register"
],
"sourceMap": true
"sourceMap": true,
"pruneEmptyCodeFiles": true
}
+5 -2
View File
@@ -3,10 +3,11 @@
"files": [
"source/**",
"components/**",
"!components/**/*.part.xml",
"images/**",
"!**/*.psd",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"config/**",
"lib/**",
"www/**",
@@ -26,7 +27,9 @@
"../tools/bs-plugins/json-yaml-plugin.ts",
"../tools/bs-plugins/validation-plugin.ts",
"../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts"
"../tools/bs-plugins/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts"
],
"rooibos": {
"logLevel": 2,
+2 -2
View File
@@ -142,7 +142,7 @@ That's pretty much it.
There are a few reasons we made this separation:
- Playlet relies on [Invidious](https://github.com/iv-org/invidious). Invidious tries to keep up with Youtube making changes to their platform, but sometimes, a breaking change happens that requires Playlet to react quickly. Releasing through the Roku Channel store can take days, or a week. During this time, Playlet would be not functional, and that's not acceptable.
- Playlet relies on [Invidious](https://github.com/iv-org/invidious). Invidious tries to keep up with YouTube making changes to their platform, but sometimes, a breaking change happens that requires Playlet to react quickly. Releasing through the Roku Channel store can take days, or a week. During this time, Playlet would be not functional, and that's not acceptable.
- The ability to roll back: Sometimes an app breaking bug gets released. Allowing users to choose a seperate version is a flexible way to keep things working. For example, it's possible to choose a different verrsion from the developer settings in the web app.
- It is simply easier to release: Releasing Playlet Lib on Github, and everyone receives the latest version immediately, is very conveninct and less of a hassle, than going through the Roku Channel store.
- I've had instances where I was trying to pass the certfication for Playlet to publish it. One of the criterias is to pass a some automated tests. But the tests were failing because their system could not connect to their Roku test devices (connection keeps timing out). My only option was to keep trying over and over until it worked.
@@ -163,7 +163,7 @@ Playlet lib comes equipped with a web server that runs on port 8888 when the app
- Allows remotely casting videos, change preferences, etc.
- Authentication using Invidious
The web server runs on a continiously running [Task](https://developer.roku.com/en-ca/docs/references/scenegraph/control-nodes/task.md) and uses a middeware system to manage routes, serve static files, [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), and more.
The web server runs on a continuously running [Task](https://developer.roku.com/en-ca/docs/references/scenegraph/control-nodes/task.md) and uses a middeware system to manage routes, serve static files, [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), and more.
The server's API enpoints are described through the Open API spec file [playlet-web-api.yml](./playlet-web-api.yml)
+2 -3
View File
@@ -4,8 +4,7 @@ This is an automated release. It is generated when new code is pushed to the mai
To test this release:
- Open Playlet web app in a browser (`http://ROKU_IP_ADDRESS:8888/index.html`)
- Go to settings, and scroll down to `Developer settings`
- Set `Playlet Library version` to `canary` and click `Apply`
- Open Playlet web app settings in a browser (`http://ROKU_IP_ADDRESS:8888/index.html#settings`)
- Scroll down to `Developer settings` and set `Playlet Library version` to `canary` and click `Apply`
- Restart Playlet
- You can verify that you're testing the `canary` release in the `Info` tab in Playlet or the web app
+56 -34
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Playlet Web API
version: 0.18.0
version: 0.20.2
description:
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
@@ -106,7 +106,7 @@ paths:
type: array
items:
type: string
put:
post:
summary: Add to search history
description: |
Add a query to the search history.
@@ -140,9 +140,9 @@ paths:
description: No Content
/api/queue:
get:
summary: Get play queue
summary: Get video queue
description: Get the current videos in the queue.
operationId: getPlayQueue
operationId: getVideoQueue
responses:
"200":
description: OK
@@ -151,56 +151,43 @@ paths:
schema:
type: object
properties:
index:
type: integer
playlistIndex
type: integer
items:
type: array
items:
$ref: "#/components/schemas/PlayQueueObject"
$ref: "#/components/schemas/VideoQueueObject"
index:
type: integer
nowPlaying:
$ref: "#/components/schemas/VideoQueueObject"
post:
summary: Add to play queue
summary: Add to video queue
description: Add a video or a playlist to the queue.
operationId: addToPlayQueue
operationId: addToVideoQueue
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PlayQueueObject"
$ref: "#/components/schemas/VideoQueueObject"
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
index:
type: integer
playlistIndex
type: integer
items:
type: array
items:
$ref: "#/components/schemas/PlayQueueObject"
"204":
description: No Content
delete:
summary: Clear play queue
description: Clear the play queue.
operationId: clearPlayQueue
summary: Clear video queue
description: Clear the video queue.
operationId: clearVideoQueue
responses:
"204":
description: No Content
/api/queue/play:
post:
summary: Play video or playlist
summary: Play video
description: Play a video or playlist. This adds the video or playlist to the current position in the queue and plays it.
operationId: playPlayQueue
operationId: playVideoQueue
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PlayQueueObject"
$ref: "#/components/schemas/VideoQueueObject"
responses:
"204":
description: No Content
@@ -227,6 +214,41 @@ paths:
description: No Content
"400":
description: Bad Request
/api/home-layout:
get:
summary: Get home layout
description: Get the current home layout. This is the layout of the home screen, based on user preferences.
operationId: getHomeLayout
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: string
title:
type: string
feedSources:
type: array
items:
type: object
properties:
apiType:
type: string
endpoint:
type: string
id:
type: string
queryParams:
type: object
additionalProperties: true
title:
type: string
/api/playlet-lib-urls:
get:
summary: Get Playlet lib URLs
@@ -539,7 +561,7 @@ components:
sponsorblock.show_notifications:
type: boolean
# TODO:P1 add the rest of properties
PlayQueueObject:
VideoQueueObject:
type: object
properties:
videoId:
+68 -3
View File
@@ -10,6 +10,8 @@
- [Async Task Generator](#async-task-generator)
- [Tracking transpilied files](#tracking-transpilied-files)
- [Logger](#logger)
- [Type Gen](#type-gen)
- [Web Server](#web-server)
Playlet implements a few [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md). The plugins inject themselves in the compilation process, allowing the modification of bs scripts, xml components, and even assets or the app manifest. Let's start with a simple one:
@@ -469,7 +471,10 @@ end function
And use the function like so
```brighterscript
StartAsyncTask(MyBackgroundTask, {myVar: "some input"}, function(output as object) as void
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
AsyncTask.Start(Tasks.MyBackgroundTask, {myVar: "some input"}, function(output as object) as void
if output.success
print(output.result.value)
end if
@@ -478,7 +483,7 @@ end function)
The rest will be taken care of by the plugin, which will generate an `xml` file containing the task component, and a script that handles calling the function.
Although very useful, this pattern might not be the best for long running tasks (like the Web Server) or other tasks that require task reuse. This is because `StartAsyncTask` create a new instance of the task every time.
Although very useful, this pattern might not be the best for long running tasks (like the Web Server) or other tasks that require task reuse. This is because `AsyncTask.Start` create a new instance of the task every time.
## Tracking transpilied files
@@ -517,7 +522,7 @@ The logger plugin searches for calls to the predefined functions `LogError`, `Lo
- For example, it replaces `LogError("Cannot complete operation:", error)` with `LogError2("Cannot complete operation:", error)`
- Based on usage, it generates `LogErrorX` functions used. Example:
```
```brs
function LogError2(arg0, arg1) as void
logger = m.global.logger
if logger.logLevel < 0
@@ -537,3 +542,63 @@ This is implemented to make it easy to identify where logs came from, and to gen
To understand more about what's being generated, download `playlet-lib.zip` from [releases](https://github.com/iBicha/playlet/releases), extract, and inspect the file `source/utils/Logging.brs`. You will see it contains log functions in the form `LogVerbX`, that are generated based on usage.
To give credit where credit is due, some of the ideas here (like adding the source location to the log) came from [roku-log](https://github.com/georgejecook/roku-log)
## Type Gen
**[Source](/tools/bs-plugins/type-gen-plugin.ts)**
### Why
I found myself implementing type checking functions like `IsBool`, `IsInt`, and `IsString`, and functions for getting a valid type, like `ValidBool`, `ValidInt`, and `ValidString`. The implementation is the same, why not generate them?
### How
Simply we declare them in an object describing the type, the interface, and the default value, and generate all corresponding functions.
Sample output:
```brs
' Returns true if the given object is of type Bool, false otherwise
function IsBool(obj as dynamic) as boolean
return obj <> invalid and GetInterface(obj, "ifBoolean") <> invalid
end function
' Returns the given object if it is of type Bool, otherwise returns the default value `false`
function ValidBool(obj as dynamic) as boolean
if obj <> invalid and GetInterface(obj, "ifBoolean") <> invalid
return obj
else
return false
end if
end function
```
## Web Server
**[Source](/tools/bs-plugins/web-server-plugin.ts)**
### Why
Handles routing annotations (e.g. `@get("/api/something")) so that they are handled by the routers/middlewares. It's nicer than having to register things by hand.
### How
Routers need to inherit from `Http.HttpRouter`. Then, once a request handled is annotated, e.g.
```bs
@get("/")
function GoHome(context as object) as boolean
response = context.response
response.Redirect("/index.html")
return true
end function
```
The route and the handler are added to the router. In this example, the `/` route redirects to `index/html`.
There one special annotation, and one special route:
- `@all` matches all methods
- `*` matches all paths
So `@all(*)` would be a middleware that will be matched with any request.
+27 -20
View File
@@ -1,30 +1,37 @@
# Screenshots
## Home
## Playlet
![Home](./home.jpg)
| Home | Search |
| ------------------- | ----------------------- |
| ![Home](./home.jpg) | ![Search](./search.jpg) |
## Search
| Bookmarks | Queue + Picture-in-picture |
| ----------------------------- | ----------------------------------------------------- |
| ![Bookmarks](./bookmarks.jpg) | ![Queue + Picture-in-picture](./queue-pic-in-pic.jpg) |
![Search](./search.jpg)
| Channel | Playlist |
| ------------------------- | --------------------------- |
| ![Channel](./channel.jpg) | ![Playlist](./playlist.jpg) |
## Settings
| Settings | Invidious instances | Invidious testing |
| --------------------------- | ------------------------------------------------ | --------------------------------------------- |
| ![Settings](./settings.jpg) | ![Invidious instances](./invidious-settings.jpg) | ![Invidious testing](./invidious-testing.jpg) |
![Settings](./settings.jpg)
| Remote | App info |
| ----------------------- | --------------------------- |
| ![Remote](./remote.jpg) | ![App info](./app-info.jpg) |
## Playlist
## Playlet web app
![Playlist](./playlist.jpg)
## Link to web app
![Link to web app](./webapp-qr.jpg)
## App info
![App info](./app-info.jpg)
## Web app
| ![Web app home](./webapp-home.png) | ![Web app search](./webapp-search.png) | ![Web app settings](./webapp-settings.png) |
| Home | Search | Settings |
| ---------------------------------- | -------------------------------------- | ------------------------------------------ |
| ![Web app home](./webapp-home.png) | ![Web app search](./webapp-search.png) | ![Web app settings](./webapp-settings.png) |
| Bookmarks | Remote | Cast video |
| ------------------------------------ | ------------------------------ | -------------------------------- |
| ![Bookmarks](./webapp-bookmarks.png) | ![Remote](./webapp-remote.png) | ![Cast video](./webapp-cast.png) |
| App info | | |
| ------------------------------ | --- | --- |
| ![App info](./webapp-info.png) | | |
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 KiB

After

Width:  |  Height:  |  Size: 751 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 256 KiB

+60 -133
View File
@@ -1,36 +1,36 @@
{
"name": "playlet",
"version": "0.18.0",
"version": "0.20.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.18.0",
"version": "0.20.2",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.13",
"@types/crypto-js": "^4.2.1",
"@rokucommunity/bslint": "^0.8.17",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.10.5",
"@types/node": "^20.11.20",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.65.14",
"brighterscript-formatter": "^1.6.36",
"brighterscript": "0.65.22",
"brighterscript-formatter": "^1.6.40",
"convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.2.0",
"dotenv": "^16.3.1",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"imap": "^0.8.19",
"ip": "^1.1.8",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.6.5",
"mailparser": "^3.6.7",
"roku-deploy": "^3.11.2",
"rooibos-roku": "^5.8.0",
"semver": "^7.5.4",
"rooibos-roku": "5.10.0",
"semver": "^7.6.0",
"shelljs": "^0.8.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
@@ -276,9 +276,9 @@
"dev": true
},
"node_modules/@rokucommunity/bslint": {
"version": "0.8.13",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.13.tgz",
"integrity": "sha512-EC5tQdtRFTJxOo+9lnZz6yLcsyctuchCzUNJX391ZgCN0EKJTjGigyqTsdsFprINmr0pBojUiys/ZpS/Bv3ROQ==",
"version": "0.8.17",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.17.tgz",
"integrity": "sha512-e0ksPVYnN+QkhzuV97yPTf1NxSkBQZNMJRhlCFnMJf6gfps+VdY1HwYn3IlqDz3XJxfYcRSDa3v3fQ5dQynVEA==",
"dev": true,
"dependencies": {
"fs-extra": "^10.0.0",
@@ -345,9 +345,9 @@
"dev": true
},
"node_modules/@types/crypto-js": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.1.tgz",
"integrity": "sha512-FSPGd9+OcSok3RsM0UZ/9fcvMOXJ1ENE/ZbLfOPlBWj7BgXtEAM8VYfTtT760GiLbQIMoVozwVuisjvsVwqYWw==",
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz",
"integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==",
"dev": true
},
"node_modules/@types/fs-extra": {
@@ -370,9 +370,9 @@
}
},
"node_modules/@types/node": {
"version": "20.10.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz",
"integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==",
"version": "20.11.20",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz",
"integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
@@ -728,9 +728,9 @@
}
},
"node_modules/brighterscript": {
"version": "0.65.14",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.14.tgz",
"integrity": "sha512-DVbFFp/ESu3Ow1LNsELTrmf4S/8bmXUTP9Z3R3VW21WRed392pur9ZU+tiz8w0Z0BaKjPOi+JD13P+PWkEq8zw==",
"version": "0.65.22",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.22.tgz",
"integrity": "sha512-rDSdO33xRnFGB9nr54awTUucpd4oZpZmDMvVUSAb6jmFU1jz+SYhwV9ezc8U5m3Kswap7uV+BmS1O69QZ9MuSw==",
"dev": true,
"dependencies": {
"@rokucommunity/bslib": "^0.1.1",
@@ -740,7 +740,6 @@
"chevrotain": "^7.0.1",
"chokidar": "^3.5.1",
"clear": "^0.1.0",
"coveralls-next": "^4.2.0",
"cross-platform-clear-console": "^2.3.0",
"debounce-promise": "^3.1.0",
"eventemitter3": "^4.0.0",
@@ -771,12 +770,12 @@
}
},
"node_modules/brighterscript-formatter": {
"version": "1.6.36",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.36.tgz",
"integrity": "sha512-f9Y3Re6egB1MCUftph8AT8RxWTtXmeMjwigRv1biNGmEuGeSOipoBnCbwY4U1CFz46L7W39/TL4n1JMV9URD6w==",
"version": "1.6.40",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.40.tgz",
"integrity": "sha512-cxvGGluNfxy6p3khtcMt/3AschwqEnERjLRIEt3XVU0R0l2QgwXelDp8ViqgnQ2hQYa8LnfnOiV1u7OCqbiZPA==",
"dev": true,
"dependencies": {
"brighterscript": "^0.65.12",
"brighterscript": "^0.65.19",
"glob-all": "^3.3.0",
"jsonc-parser": "^3.0.0",
"source-map": "^0.7.3",
@@ -1479,25 +1478,6 @@
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"dev": true
},
"node_modules/coveralls-next": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/coveralls-next/-/coveralls-next-4.2.0.tgz",
"integrity": "sha512-zg41a/4QDSASPtlV6gp+6owoU43U5CguxuPZR3nPZ26M5ZYdEK3MdUe7HwE+AnCZPkucudfhqqJZehCNkz2rYg==",
"dev": true,
"dependencies": {
"form-data": "4.0.0",
"js-yaml": "4.1.0",
"lcov-parse": "1.0.0",
"log-driver": "1.2.7",
"minimist": "1.2.7"
},
"bin": {
"coveralls": "bin/coveralls.js"
},
"engines": {
"node": ">=14"
}
},
"node_modules/create-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
@@ -1726,15 +1706,15 @@
}
},
"node_modules/dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
"version": "16.4.5",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/motdotla/dotenv?sponsor=1"
"url": "https://dotenvx.com"
}
},
"node_modules/eastasianwidth": {
@@ -2103,20 +2083,6 @@
"node": "*"
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dev": true,
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@@ -2626,9 +2592,9 @@
}
},
"node_modules/ip": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz",
"integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",
"integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==",
"dev": true
},
"node_modules/ipaddr.js": {
@@ -2745,18 +2711,6 @@
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
@@ -2838,15 +2792,6 @@
"setimmediate": "^1.0.5"
}
},
"node_modules/lcov-parse": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz",
"integrity": "sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==",
"dev": true,
"bin": {
"lcov-parse": "bin/cli.js"
}
},
"node_modules/leac": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/leac/-/leac-0.6.0.tgz",
@@ -2902,12 +2847,12 @@
}
},
"node_modules/linkify-it": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz",
"integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
"integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
"dev": true,
"dependencies": {
"uc.micro": "^1.0.1"
"uc.micro": "^2.0.0"
}
},
"node_modules/locate-path": {
@@ -2940,15 +2885,6 @@
"integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==",
"dev": true
},
"node_modules/log-driver": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz",
"integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==",
"dev": true,
"engines": {
"node": ">=0.8.6"
}
},
"node_modules/long": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
@@ -2980,9 +2916,9 @@
}
},
"node_modules/mailparser": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.5.tgz",
"integrity": "sha512-nteTpF0Khm5JLOnt4sigmzNdUH/6mO7PZ4KEnvxf4mckyXYFFhrtAWZzbq/V5aQMH+049gA7ZjfLdh+QiX2Uqg==",
"version": "3.6.7",
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.7.tgz",
"integrity": "sha512-/3x8HW70DNehw+3vdOPKdlLuxOHoWcGB5jfx5vJ5XUbY9/2jUJbrrhda5Si8Dj/3w08U0y5uGAkqs5+SPTPKoA==",
"dev": true,
"dependencies": {
"encoding-japanese": "2.0.0",
@@ -2990,10 +2926,10 @@
"html-to-text": "9.0.5",
"iconv-lite": "0.6.3",
"libmime": "5.2.1",
"linkify-it": "4.0.1",
"linkify-it": "5.0.0",
"mailsplit": "5.4.0",
"nodemailer": "6.9.3",
"tlds": "1.240.0"
"nodemailer": "6.9.9",
"tlds": "1.248.0"
}
},
"node_modules/mailparser/node_modules/iconv-lite": {
@@ -3140,15 +3076,6 @@
"node": "*"
}
},
"node_modules/minimist": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
@@ -3200,9 +3127,9 @@
}
},
"node_modules/nodemailer": {
"version": "6.9.3",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.3.tgz",
"integrity": "sha512-fy9v3NgTzBngrMFkDsKEj0r02U7jm6XfC3b52eoNV+GCrGj+s8pt5OqhiJdWKuw51zCTdiNR/IUD1z33LIIGpg==",
"version": "6.9.9",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.9.tgz",
"integrity": "sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==",
"dev": true,
"engines": {
"node": ">=6.0.0"
@@ -3994,9 +3921,9 @@
}
},
"node_modules/rooibos-roku": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.8.0.tgz",
"integrity": "sha512-mPAszwOH1VdxMgSaoXQ/CgpAZ3RQ0A+d3BoxyY8axMsYS5kPO/8dL8fa7iFTGEZYA7803Ur52zlyN8GXqV5nLg==",
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.10.0.tgz",
"integrity": "sha512-Idiv3nWQOEr5V8z8oHcIovjcoBffgqRtTQ5B6K+x/cGAouKxyVJp0fsZ80xQvUul9IwHQ0XIPUYbNWCR3RQ3sA==",
"dev": true,
"dependencies": {
"source-map": "^0.7.3",
@@ -4110,9 +4037,9 @@
}
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@@ -4477,9 +4404,9 @@
"dev": true
},
"node_modules/tlds": {
"version": "1.240.0",
"resolved": "https://registry.npmjs.org/tlds/-/tlds-1.240.0.tgz",
"integrity": "sha512-1OYJQenswGZSOdRw7Bql5Qu7uf75b+F3HFBXbqnG/ifHa0fev1XcG+3pJf3pA/KC6RtHQzfKgIf1vkMlMG7mtQ==",
"version": "1.248.0",
"resolved": "https://registry.npmjs.org/tlds/-/tlds-1.248.0.tgz",
"integrity": "sha512-noj0KdpWTBhwsKxMOXk0rN9otg4kTgLm4WohERRHbJ9IY+kSDKr3RmjitaQ3JFzny+DyvBOQKlFZhp0G0qNSfg==",
"dev": true,
"bin": {
"tlds": "bin.js"
@@ -4612,9 +4539,9 @@
}
},
"node_modules/uc.micro": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.0.0.tgz",
"integrity": "sha512-DffL94LsNOccVn4hyfRe5rdKa273swqeA5DJpMOeFmEn1wCDc7nAbbB0gXlgBCL7TNzeTv6G7XVWzan7iJtfig==",
"dev": true
},
"node_modules/unbzip2-stream": {
+16 -13
View File
@@ -1,30 +1,30 @@
{
"name": "playlet",
"version": "0.18.0",
"description": "Unofficial Youtube client for Roku",
"version": "0.20.2",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.13",
"@types/crypto-js": "^4.2.1",
"@rokucommunity/bslint": "^0.8.17",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.10.5",
"@types/node": "^20.11.20",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.65.14",
"brighterscript-formatter": "^1.6.36",
"brighterscript": "0.65.22",
"brighterscript-formatter": "^1.6.40",
"convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.2.0",
"dotenv": "^16.3.1",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"imap": "^0.8.19",
"ip": "^1.1.8",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.6.5",
"mailparser": "^3.6.7",
"roku-deploy": "^3.11.2",
"rooibos-roku": "^5.8.0",
"semver": "^7.5.4",
"rooibos-roku": "5.10.0",
"semver": "^7.6.0",
"shelljs": "^0.8.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
@@ -65,6 +65,9 @@
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
"update-deps": "npx npm-check-updates -u && cd playlet-app && npx npm-check-updates -u && cd ../playlet-lib && npx npm-check-updates -u && cd ../playlet-web && npx npm-check-updates -u"
"update-deps": "npx npm-check-updates -u && cd playlet-app && npx npm-check-updates -u && cd ../playlet-lib && npx npm-check-updates -u && cd ../playlet-web && npx npm-check-updates -u",
"registry:write": "node tools/registry.js --input registry.json",
"registry:read": "node tools/registry.js --output registry.json",
"registry:clear": "node tools/registry.js --clear"
}
}
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.18.0",
"version": "0.20.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.18.0"
"version": "0.20.2"
}
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "playlet-app",
"version": "0.18.0",
"description": "Unofficial Youtube client for Roku",
"version": "0.20.2",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-app",
"prebuild:dev": "npm run prebuild",
@@ -1,4 +1,5 @@
import "LoadingMessages.bs"
import "pkg:/source/Logger.bs"
function Init() as void
m.scene = m.top.getScene()
@@ -21,17 +22,22 @@ end function
function GetPlayletLibUrls() as object
#if DEBUG
debug = { type: "debug", link: ReadManifestValue("playlet_lib_debug_url") }
return [debug]
debug = { type: "debug", link: Manifest.ReadValue("playlet_lib_debug_url") }
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") }
#if DEBUG_FALLBACK_TO_EMBEDDED
return [debug, embedded]
#else
return [debug]
#end if
#else
savedUrls = GetPlayletLibUrlsFromRegistry()
savedUrls = Registry.GetPlayletLibUrlsFromRegistry()
if savedUrls <> invalid
m.shouldClearRegistryOnLoadFail = true
return savedUrls
end if
github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") }
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
github = { type: "github", link: Manifest.ReadValue("playlet_lib_remote_url") }
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") }
return [github, embedded]
#end if
end function
@@ -40,7 +46,7 @@ function LoadPlayletLib() as void
if m.playletLibUrlIndex >= m.playletLibUrls.Count()
m.loadingIndicator.visible = false
if m.shouldClearRegistryOnLoadFail = true
DeleteRegistryKey("playlet_lib_urls", "Playlet")
Registry.DeleteKey("playlet_lib_urls", "Playlet")
end if
ShowPlayletLibLoadErrorDialog()
return
@@ -55,8 +61,8 @@ function OnLoadStatusChanged() as void
libUrl = m.playletLibUrls[m.playletLibUrlIndex]
if m.lib.loadStatus = "ready"
RemoveComponentLibrary()
' bs:disable-next-line LINT3012
?"Playlet lib loaded from " libUrl.link
Logger.Log(`Playlet lib loaded from ${libUrl.link} in ${m.timer.TotalMilliseconds()} ms`)
m.timer = invalid
m.scene.playletLibLoadedUrl = libUrl
container = m.scene.findNode("MainSceneContainer")
container.createChild("PlayletLib:MainScene")
@@ -64,8 +70,7 @@ function OnLoadStatusChanged() as void
end if
if m.lib.loadStatus = "failed"
' bs:disable-next-line LINT3012
?"Playlet lib failed to load from " libUrl.link
Logger.Log(`Playlet lib failed to load from ${libUrl.link}`)
' Try next url
m.playletLibUrlIndex += 1
LoadPlayletLib()
@@ -83,11 +88,14 @@ function RemoveComponentLibrary() as void
end function
function LoadComponentLibrary(uri as string)
m.timer = CreateObject("roTimespan")
m.timer.mark()
m.lib = m.scene.createChild("ComponentLibrary")
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
m.lib.observeField("loadStatus", "OnLoadStatusChanged")
' bs:disable-next-line LINT3012
?"Loading Playlet lib from " uri
Logger.Log(`Loading Playlet lib from ${uri}`)
m.lib.uri = uri
end function
@@ -106,5 +114,5 @@ function ShowPlayletLibLoadErrorDialog()
"If the problem persist, contact Playlet authors."
]
ShowErrorDialog(message, bulletText, bottomText)
DialogShowError(message, bulletText, bottomText)
end function
@@ -20,6 +20,11 @@ function GetLoadingMessage() as string
"Don't forget to like and subscribe...",
"Shoveling coal into the server...",
"Counting down from infinity...",
"Unfortunately, the internet is closed today...",
"Unfortunately, we have no ads to show you...",
"Looking for the remote...",
"Finding that song that goes 'La la lala la'...",
"Waiting for the spinny thing to finish...",
]
end if
index = GetRandom(0, messages.count() - 1)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.
+3 -3
View File
@@ -2,8 +2,8 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=18
build_version=00000
minor_version=20
build_version=00002
ui_resolutions=hd
@@ -33,4 +33,4 @@ playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
git_commit_sha=unknown
bs_const=DEBUG=false
bs_const=DEBUG=false;DEBUG_FALLBACK_TO_EMBEDDED=true
+15 -17
View File
@@ -1,22 +1,22 @@
function ShowErrorDialog(message as object, bulletText as object, bottomMessage as object)
function DialogShowError(message as object, bulletText as object, bottomMessage as object)
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
dialog = CreateObject("roSGNode", "StandardMessageDialog")
SetPalette(dialog)
dialog.message = message
dialog.bulletText = bulletText
dialog.bottomMessage = bottomMessage
dialog.title = "Error loading Playlet"
dialog.buttons = ["Exit"]
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
DialogSetPalette(msgDialog)
msgDialog.message = message
msgDialog.bulletText = bulletText
msgDialog.bottomMessage = bottomMessage
msgDialog.title = "Error loading Playlet"
msgDialog.buttons = ["Exit"]
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
dialog.observeField("buttonSelected", "OnButtonSelected")
msgDialog.observeField("buttonSelected", "DialogOnButtonSelected")
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
dialog.observeField("wasClosed", "OnDialogClosed")
msgDialog.observeField("wasClosed", "DialogOnClosed")
m.top.getScene().dialog = dialog
m.top.getScene().dialog = msgDialog
end function
function SetPalette(dialog as object)
function DialogSetPalette(msgDialog as object)
palette = createObject("roSGNode", "RSGPalette")
palette.colors = {
DialogBackgroundColor: "#242424FF"
@@ -26,15 +26,13 @@ function SetPalette(dialog as object)
DialogSecondaryItemColor: "#FF1C30FF"
DialogTextColor: "#DBDBDBFF"
}
dialog.palette = palette
msgDialog.palette = palette
end function
function OnButtonSelected()
function DialogOnButtonSelected()
m.top.getScene().dialog.close = true
end function
function OnDialogClosed()
' TODO:P1 throw an exception to cause a crash report to be generated
' Should include which playlet lib failed to load
function DialogOnClosed()
m.top.getScene().exitChannel = true
end function
+20
View File
@@ -0,0 +1,20 @@
namespace Logger
' Put the file at the root directry to avoid needing to create a folder
const LOGS_FILE_PATH = "cachefs:/playlet_startup_logs.txt"
function Init()
DeleteFile(LOGS_FILE_PATH)
end function
function Log(msg as string)
msg = "[APP] " + msg
' bs:disable-next-line LINT3012
print(msg)
buffer = CreateObject("roByteArray")
buffer.FromAsciiString(msg + `\n`)
buffer.AppendFile(LOGS_FILE_PATH)
end function
end namespace
+7 -6
View File
@@ -1,5 +1,5 @@
' Playlet (App to play videos from an Invidious server on Roku TVs)
' Copyright (C) 2023 Brahim Hadriche
' Copyright (C) 2024 Brahim Hadriche
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as published by
@@ -19,8 +19,9 @@ function Main(args as object) as void
port = CreateObject("roMessagePort")
screen.setMessagePort(port)
m.global = screen.getGlobalNode()
Logger.Init()
ClearPlayletLibUrlsIfNeeded(args)
Registry.ClearPlayletLibUrlsIfNeeded(args)
scene = screen.CreateScene("BootstrapScene")
screen.show()
@@ -32,9 +33,9 @@ function Main(args as object) as void
' These vars are needed to pass certification.
' The actual work is done in Playlet Lib
' bs:disable-next-line LINT1005
contentId = args.contentId
_contentId = args.contentId
' bs:disable-next-line LINT1005
mediaType = args.mediaType
_mediaType = args.mediaType
' Do not signal app launch complete here, we're doing it over at Playlet Lib
' This is needed to pass cetification
@@ -44,7 +45,7 @@ function Main(args as object) as void
input = CreateObject("roInput")
input.setMessagePort(port)
' TODO:P1 follow up on bug where roSystemLog does not fire for a video player in ComponentLibrary
' TODO:P2 follow up on bug where roSystemLog does not fire for a video player in ComponentLibrary
' https://community.roku.com/t5/Roku-Developer-Program/BUG-roSystemLog-not-firing-with-ComponentLibrary/td-p/906075
systemLog = CreateObject("roSystemLog")
systemLog.SetMessagePort(port)
@@ -77,7 +78,7 @@ function Main(args as object) as void
field = msg.getField()
data = msg.getData()
if field = "exitChannel" and data = true
END
return
end if
else if msgType = "roInputEvent"
scene.inputArgs = msg.getInfo()
+9 -4
View File
@@ -1,4 +1,9 @@
function ReadManifestValue(key as string) as string
appInfo = CreateObject("roAppInfo")
return appInfo.GetValue(key)
end function
namespace Manifest
function ReadValue(key as string) as string
appInfo = CreateObject("roAppInfo")
return appInfo.GetValue(key)
end function
end namespace
+1 -1
View File
@@ -11,7 +11,7 @@ namespace Tests
@params("playlet_lib_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
@params("playlet_lib_embedded_url", "pkg:/lib/playlet-lib.zip")
function _(key as string, expectedValue as string)
m.assertEqual(ReadManifestValue(key), expectedValue)
m.assertEqual(Manifest.ReadValue(key), expectedValue)
end function
end class
+31 -26
View File
@@ -1,29 +1,34 @@
function ReadRegistryKey(key as string, section as string) as dynamic
sec = CreateObject("roRegistrySection", section)
if not sec.Exists(key)
return invalid
end if
return sec.Read(key)
end function
namespace Registry
function DeleteRegistryKey(key as string, section as string)
sec = CreateObject("roRegistrySection", section)
sec.Delete(key)
sec.Flush()
end function
function ReadKey(key as string, section as string) as dynamic
sec = CreateObject("roRegistrySection", section)
if not sec.Exists(key)
return invalid
end if
return sec.Read(key)
end function
function GetPlayletLibUrlsFromRegistry() as object
urlsJson = ReadRegistryKey("playlet_lib_urls", "Playlet")
if urlsJson = invalid
return invalid
end if
urls = ParseJson(urlsJson)
return urls
end function
function DeleteKey(key as string, section as string)
sec = CreateObject("roRegistrySection", section)
sec.Delete(key)
sec.Flush()
end function
function ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
return
end if
DeleteRegistryKey("playlet_lib_urls", "Playlet")
end function
function GetPlayletLibUrlsFromRegistry() as object
urlsJson = ReadKey("playlet_lib_urls", "Playlet")
if urlsJson = invalid
return invalid
end if
urls = ParseJson(urlsJson)
return urls
end function
function ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
return
end if
DeleteKey("playlet_lib_urls", "Playlet")
Logger.Log("Cleared key playlet_lib_urls from registry")
end function
end namespace
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.18.0",
"version": "0.20.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.18.0"
"version": "0.20.2"
}
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "playlet-lib",
"version": "0.18.0",
"description": "Unofficial Youtube client for Roku",
"version": "0.20.2",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-lib",
"prebuild:dev": "npm run prebuild",
@@ -1,7 +1,7 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/LongPress.bs"
import "pkg:/components/PlayQueue/PlayQueueViewUtils.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/components/VideoQueue/VideoQueueUtils.bs"
import "pkg:/components/VideoQueue/VideoQueueViewUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
@@ -86,13 +86,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
if key = OPTIONS_LONG_PRESS_KEY and press
LogInfo("Opening PlayQueueView")
PlayQueueViewUtils.Open(m.top.playQueue, m.top)
LogInfo("Opening VideoQueueView")
VideoQueueViewUtils.Open(m.top.videoQueue, m.top)
return true
end if
if key = "options" and not press
if VideoUtils.ToggleVideoPictureInPicture()
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
return true
end if
end if
@@ -102,26 +102,26 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
if key = "play"
if VideoUtils.TogglePause()
if VideoQueueUtils.TogglePause(m.top.videoQueue)
return true
end if
end if
if key = "pause"
if VideoUtils.PauseVideo()
if VideoQueueUtils.Pause(m.top.videoQueue)
return true
end if
end if
if key = "playonly"
if VideoUtils.ResumeVideo()
if VideoQueueUtils.Play(m.top.videoQueue)
return true
end if
end if
if key = "back"
if VideoUtils.IsVideoPlayerOpen() and not VideoUtils.IsVideoPlayerFullScreen()
if VideoUtils.ToggleVideoPictureInPicture()
if VideoQueueUtils.IsVideoPlayerOpen(m.top.videoQueue) and not VideoQueueUtils.IsVideoPlayerFullScreen(m.top.videoQueue)
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
return true
end if
end if
@@ -2,7 +2,7 @@
<interface>
<field id="root" type="node" />
<field id="stack" type="node" />
<field id="playQueue" type="node" />
<field id="videoQueue" type="node" />
<function name="PushScreen" />
<function name="PopScreen" />
<function name="FocusTopScreen" />
@@ -1,11 +1,11 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
import "SubscribeTask.bs"
function Init()
m.container = m.top.findNode("container")
@@ -134,7 +134,7 @@ function OnSubscribeButtonSelected()
end if
isSubbed = IsSubscribed()
m.subscribeTask = StartAsyncTask(SubscribeTask, {
m.subscribeTask = AsyncTask.Start(Tasks.SubscribeTask, {
invidious: m.invidious
ucid: m.authorId
subscribe: not isSubbed
@@ -185,9 +185,6 @@ function InitializeTabs()
playlists: function(authorId as string, author as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author)
end function
channels: function(authorId as string, author as string) as object
return CreateChannelFeed("Channels", "channel_channels", authorId, author)
end function
}
end function
@@ -23,7 +23,7 @@
translation="[115,20]"
width="104"
height="104"
uri="pkg:/images/circle-mask-500.png">
uri="pkg:/images/white-circle.png">
<CirclePoster
id="thumbnail"
@@ -61,7 +61,7 @@
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png" />
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
<Animation
id="scrollAnimation"
@@ -10,13 +10,13 @@
<field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" />
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
<field id="maskUri" type="uri" value="pkg:/images/circle-mask-500.png" alias="MaskGroup.maskuri" />
<field id="maskUri" type="uri" value="pkg:/images/white-circle.png" alias="MaskGroup.maskuri" />
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
</interface>
<children>
<MaskGroup
id="MaskGroup"
maskuri="pkg:/images/circle-mask-500.png">
maskuri="pkg:/images/white-circle.png">
<Poster
id="Poster" />
</MaskGroup>
@@ -1,10 +1,9 @@
import "pkg:/components/ContentNode/ChannelContentTask.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs"
function Init()
end function
import "pkg:/source/utils/Logging.bs"
function LoadChannel(invidiousNode as object) as void
if m.contentTask <> invalid
@@ -17,7 +16,7 @@ function LoadChannel(invidiousNode as object) as void
end if
m.top.loadState = FeedLoadState.Loading
m.contentTask = StartAsyncTask(ChannelContentTask, {
m.contentTask = AsyncTask.Start(Tasks.ChannelContentTask, {
content: m.top
invidious: invidiousNode
}, OnChannelContentTaskResult)
@@ -0,0 +1,55 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Logging.bs"
function LoadPlaylistPage(invidiousNode as object) as void
LoadPlaylist(invidiousNode, true)
end function
function LoadPlaylistAll(invidiousNode as object) as void
LoadPlaylist(invidiousNode, false)
end function
function LoadPlaylist(invidiousNode as object, singlePage as boolean) as void
if m.contentTask <> invalid
m.contentTask.cancel = true
end if
loadState = m.top.loadState
if loadState = FeedLoadState.Loading or loadState = FeedLoadState.Loaded
return
end if
m.top.loadState = FeedLoadState.Loading
m.contentTask = AsyncTask.Start(Tasks.PlaylistContentTask, {
content: m.top
invidious: invidiousNode
singlePage: singlePage
}, OnPlaylistContentTaskResult)
end function
function OnPlaylistContentTaskResult(output as object) as void
m.contentTask = invalid
if output.cancelled
return
end if
if not output.success or not output.result.success
' output.error for unhandled exception
error = output.error
if error = invalid
' output.result.error for network errors
error = output.result.error
end if
error = ErrorUtils.Format(error)
LogError(error)
playlistId = output.task.input.content.playlistId
message = `Failed to load playlist ${playlistId}\n${error}`
DialogUtils.ShowDialog(message, "Playlist load fail", true)
return
end if
end function
@@ -1,5 +1,8 @@
<component name="PlaylistContentNode" extends="ContentNode">
<interface>
<function name="LoadPlaylistPage" />
<function name="LoadPlaylistAll" />
<field id="type" type="string" value="playlist" />
<field id="loadState" type="string" />
<!-- index in a feed -->
@@ -0,0 +1,57 @@
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
@asynctask
function PlaylistContentTask(input as object) as object
contentNode = input.content
invidiousNode = input.invidious
singlePage = input.singlePage
if m.top.cancel
contentNode.loadState = FeedLoadState.None
return invalid
end if
service = new Invidious.InvidiousService(invidiousNode)
instance = service.GetInstance()
while true
index = contentNode.getChildCount()
response = service.GetPlaylist(contentNode.playlistId, index, m.top.cancellation)
if m.top.cancel
contentNode.loadState = FeedLoadState.None
return invalid
end if
metadata = response.Json()
if not response.IsSuccess() or metadata = invalid
contentNode.loadState = FeedLoadState.Error
return {
success: false
error: response.ErrorMessage()
}
end if
InvidiousContent.ToPlaylistContentNode(contentNode, metadata, instance)
childCount = contentNode.getChildCount()
if metadata.videos.Count() = 0 or childCount >= metadata.videoCount
contentNode.loadState = FeedLoadState.Loaded
return {
success: true
}
else
contentNode.loadState = FeedLoadState.LoadedPage
if singlePage
return {
success: true
}
end if
end if
end while
return invalid
end function
@@ -5,8 +5,11 @@
<field id="index" type="integer" value="-1" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<!-- index in the queue -->
<field id="queueIndex" type="integer" value="-1" />
<field id="author" type="string" />
<!-- NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation -->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="isUpcoming" type="boolean" />
<field id="lengthSeconds" type="integer" />
@@ -71,8 +71,6 @@ import "pkg:/source/utils/Types.bs"
' - "Remove group from Bookmarks"
' - "Reload bookmarks" - DONE
'
' TODO:P1 Playlist item seletected from the bookmarks need to play as a playlist, not as a single video
' TODO:P1 Context menu might need to be scrollable (both horizontally and vertically)
' TODO:P1 Context menu might need sections. Example:
' In a Channel view, while selecting a playlist:
' - Channel
@@ -163,6 +161,17 @@ function OnkeyEvent(key as string, press as boolean) as boolean
Close()
return true
end if
if key = "up"
m.optionsList.jumpToItem = m.optionsList.content.getChildCount() - 1
return true
end if
if key = "down"
m.optionsList.jumpToItem = 0
return true
end if
return false
end function
@@ -31,7 +31,7 @@ namespace ContextMenuUtils
if item.type = "video"
LogInfo("Opening context menu for video:", item.videoId)
title = item.title
subtitle = item.author
subtitle = item._author
thumbnail = item.thumbnail
else if item.type = "playlist"
LogInfo("Opening context menu for playlist:", item.playlistId)
@@ -1,6 +1,6 @@
import "DialogPalette.bs"
import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
@@ -33,7 +33,7 @@ function OnUrlSet()
url = m.top.url
m.urlLabel.text = url
StartAsyncTask(GenerateQrCodeTask, {
AsyncTask.Start(Tasks.GenerateQrCodeTask, {
poster: m.qrCode
text: url
size: m.qrCode.loadWidth
@@ -8,7 +8,7 @@
<StdDlgTitleArea primaryTitle="Login to Invidious" />
<StdDlgContentArea>
<StdDlgTextItem
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history." />
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history.&#xA;&#xA;Please note that an Invidious account is different from a YouTube account." />
</StdDlgContentArea>
<StdDlgButtonArea id="buttonArea">
<StdDlgButton text="OK" />
+2 -3
View File
@@ -1,10 +1,9 @@
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function InitEcpArgs()
m.playQueue = m.top.findNode("PlayQueue")
m.videoQueue = m.top.findNode("VideoQueue")
LaunchArgumentsReceived()
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
@@ -46,6 +45,6 @@ function ProcessArguments(args as object) as void
if args.timestamp <> invalid
node.timestamp = args.timestamp
end if
m.playQueue@.Play(node, -1)
m.videoQueue.playVideo = node
end if
end function
+17 -3
View File
@@ -1,5 +1,5 @@
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/StringUtils.bs"
function Init()
m.top.functionName = "LoggerLoop"
@@ -15,7 +15,11 @@ function Init()
m.port = port
StartLogger(m.top)
#if DEBUG
StartLogger(m.top, LogLevel.Debug)
#else
StartLogger(m.top, LogLevel.Info)
#end if
end function
function StartLogger(logger as object, logLevel = LogLevel.Info as LogLevel) as void
@@ -32,13 +36,23 @@ function LoggerLoop()
port = m.port
buffer = CreateObject("roByteArray")
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
logsFile = m.top.folder + "/" + m.top.filename
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
filenameStartup = m.top.filenameStartup
CreateDirectory(m.top.folder)
DeleteFile(previousLogsFile)
MoveFile(logsFile, previousLogsFile)
startUpLogs = ReadAsciiFile(filenameStartup)
if not StringUtils.IsNullOrEmpty(startUpLogs)
line = `************* Startup Logs *************\n${startUpLogs}*********** End Startup Logs ***********\n`
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line)
buffer.AppendFile(logsFile)
end if
while true
msg = wait(0, port)
msgType = type(msg)
@@ -5,5 +5,6 @@
<field id="folder" type="string" value="cachefs:/logs" />
<field id="filename" type="string" value="app_logs.txt" />
<field id="filenamePrevious" type="string" value="app_logs_previous.txt" />
<field id="filenameStartup" type="string" value="cachefs:/playlet_startup_logs.txt" />
</interface>
</component>
+6
View File
@@ -21,6 +21,12 @@ function MainSceneContainerChanged()
end function
function StartWebServer()
m.loungeService = m.top.findNode("LoungeService")
m.loungeService@.StartService()
m.webServer = m.top.findNode("WebServer")
m.webServer@.StartServer()
m.dialServer = m.top.findNode("DialServer")
m.dialServer@.StartServer()
end function
@@ -22,6 +22,11 @@ function MainSceneContainerChanged()
end function
function StartWebServer()
m.loungeService = m.top.findNode("LoungeService")
m.loungeService.callfunc("StartService", invalid)
m.webServer = m.top.findNode("WebServer")
m.webServer.callfunc("StartServer", invalid)
end function'//# sourceMappingURL=./MainScene.bs.map
m.dialServer = m.top.findNode("DialServer")
m.dialServer.callfunc("StartServer", invalid)
end function
'//# sourceMappingURL=./MainScene.brs.map
@@ -8,6 +8,7 @@
</interface>
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/NodePathUtils.brs" />
<script type="text/brightscript" uri="pkg:/components/MainScene.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/LoadingScreen.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/OnNodeReadyNoOp.brs" />
@@ -15,9 +16,6 @@
<script type="text/brightscript" uri="pkg:/source/utils/Types.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
<script type="text/brightscript" uri="pkg:/components/VideoPlayer/VideoUtils.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/FocusManagement.brs" />
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
<children>
<Logger id="Logger" />
@@ -30,7 +28,7 @@
<NavBarItem screen="HomeScreen" text="Home" icon="pkg:/images/icons/home.png" />
<NavBarItem screen="BookmarksScreen" text="Bookmarks" icon="pkg:/images/icons/star.png" />
<NavBarItem screen="SettingsScreen" text="Settings" icon="pkg:/images/icons/settings.png" />
<NavBarItem screen="WebAppScreen" text="Web App" icon="pkg:/images/icons/phone.png" />
<NavBarItem screen="RemoteScreen" text="Remote" icon="pkg:/images/icons/phone.png" />
<NavBarItem screen="AppInfoScreen" text="Info" icon="pkg:/images/icons/info.png" />
</ContentNode>
</NavBar>
@@ -38,13 +36,15 @@
</Group>
<VideoContainer id="VideoContainer" />
<Group id="Notifications" />
<PlayQueue id="PlayQueue" />
<VideoQueue id="VideoQueue" />
<ApplicationInfo id="ApplicationInfo" />
<Preferences id="Preferences" />
<Bookmarks id="Bookmarks" />
<SearchHistory id="SearchHistory" />
<Invidious id="Invidious" />
<PlayletWebServer id="WebServer" port="8888" />
<DialServer id="DialServer" />
<LoungeService id="LoungeService" />
</AppController>
</children>
</component>
+21 -9
View File
@@ -5,7 +5,7 @@
<AppController id="AppController"
root="bind:./AppRoot"
stack="bind:./Stack"
playQueue="bind:./PlayQueue">
videoQueue="bind:./VideoQueue">
<Group id="Stack">
<AppRoot id="AppRoot">
<NavBar id="NavBar" focusIndex="1" appController="bind:/AppController">
@@ -31,8 +31,8 @@
icon="pkg:/images/icons/settings.png">
</NavBarItem>
<NavBarItem
screen="WebAppScreen"
text="Web App"
screen="RemoteScreen"
text="Remote"
icon="pkg:/images/icons/phone.png">
</NavBarItem>
<NavBarItem
@@ -49,10 +49,14 @@
<Group id="Notifications" />
<!-- No render nodes -->
<PlayQueue id="PlayQueue"
<VideoQueue id="VideoQueue"
appController="bind:/AppController"
videoContainer="bind:../VideoContainer"
invidious="bind:../Invidious"
notifications="bind:../Notifications"
preferences="bind:../Preferences" />
preferences="bind:../Preferences"
loungeService="bind:../LoungeService" />
<ApplicationInfo id="ApplicationInfo" />
<Preferences id="Preferences" />
<Bookmarks id="Bookmarks" />
@@ -64,15 +68,23 @@
applicationInfo="bind:../ApplicationInfo"
preferences="bind:../Preferences" />
<PlayletWebServer
id="WebServer"
<!-- Tasks -->
<PlayletWebServer id="WebServer"
port="8888"
appController="bind:/AppController"
applicationInfo="bind:../ApplicationInfo"
invidious="bind:../Invidious"
preferences="bind:../Preferences"
playQueue="bind:../PlayQueue"
bookmarks="bind:../Bookmarks" />
videoQueue="bind:../VideoQueue"
bookmarks="bind:../Bookmarks"
loungeService="bind:../LoungeService" />
<DialServer id="DialServer"
webServer="bind:../WebServer"
loungeService="bind:../LoungeService" />
<LoungeService id="LoungeService"
videoQueue="bind:../VideoQueue"
notifications="bind:../Notifications"
invidious="bind:../Invidious" />
</AppController>
</children>
</component>
@@ -8,15 +8,18 @@ function InitializeBindings()
"AppController": {
"root": "./AppRoot",
"stack": "./Stack",
"playQueue": "./PlayQueue"
"videoQueue": "./VideoQueue"
},
"NavBar": {
"appController": "/AppController"
},
"PlayQueue": {
"VideoQueue": {
"appController": "/AppController",
"videoContainer": "../VideoContainer",
"invidious": "../Invidious",
"notifications": "../Notifications",
"preferences": "../Preferences"
"preferences": "../Preferences",
"loungeService": "../LoungeService"
},
"SearchHistory": {
"preferences": "../Preferences"
@@ -31,9 +34,20 @@ function InitializeBindings()
"applicationInfo": "../ApplicationInfo",
"invidious": "../Invidious",
"preferences": "../Preferences",
"playQueue": "../PlayQueue",
"bookmarks": "../Bookmarks"
"videoQueue": "../VideoQueue",
"bookmarks": "../Bookmarks",
"loungeService": "../LoungeService"
},
"DialServer": {
"webServer": "../WebServer",
"loungeService": "../LoungeService"
},
"LoungeService": {
"videoQueue": "../VideoQueue",
"notifications": "../Notifications",
"invidious": "../Invidious"
}
}
}
end function'//# sourceMappingURL=./MainScene_bindings.bs.map
end function
'//# sourceMappingURL=./MainScene_bindings.brs.map
@@ -1,3 +1,4 @@
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs"
' Based on https://github.com/jellyfin/jellyfin-roku/blob/unstable/components/IconButton.brs
@@ -40,16 +41,11 @@ function setIconSize()
height = m.top.height
width = m.top.width
if height > 0 and width > 0
' TODO: Use smallest number between them
m.buttonIcon.height = m.top.height
iconSize = MathUtils.Min(height, width) - m.top.padding
m.buttonIcon.height = iconSize
m.buttonIcon.width = iconSize
if m.top.padding > 0
m.buttonIcon.height = m.buttonIcon.height - m.top.padding
end if
m.buttonIcon.width = m.buttonIcon.height
m.buttonIcon.translation = [((width - m.buttonIcon.width) / 2), ((height - m.buttonIcon.height) / 2)]
m.buttonIcon.translation = [((width - iconSize) / 2), ((height - iconSize) / 2)]
m.buttonText.translation = [-5, height]
m.buttonText.width = width + 10
end if
@@ -1,5 +0,0 @@
<component name="ContentNodeReference" extends="ContentNode">
<interface>
<field id="refNode" type="node" />
</interface>
</component>
@@ -1,41 +0,0 @@
' NodeByRef: these functions provides the ability to "wrap" a node in
' another node, so it can be passed by reference. This is useful for
' when a node is required to be a child of multiple nodes at once,
' which is not possible.
' Instead, the node is wrapped, passed around, and unwrapped when needed.
import "pkg:/source/utils/StringUtils.bs"
namespace NodeByRef
function Wrap(node as object) as object
if node = invalid
return invalid
end if
if node.refNode <> invalid
return node
end if
ref = CreateObject("roSGNode", "ContentNodeReference")
ref.refNode = node
if not StringUtils.IsNullOrEmpty(node.id)
ref.id = node.id + "-ref"
end if
return ref
end function
function Unwrap(node as object) as object
if node = invalid
return invalid
end if
loopGuard = 0
while node.refNode <> invalid and loopGuard < 10
node = node.refNode
loopGuard += 1
end while
return node
end function
end namespace
@@ -1,240 +0,0 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/NodeByRef/NodeByRef.bs"
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
import "pkg:/components/PlayQueue/Notifications/PlayQueueNotificationUtils.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/utils/ArrayUtils.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RingBuffer.bs"
import "pkg:/source/utils/Types.bs"
' TODO:P1 prevent adding duplicates of the same video/playlist
function Init()
m.pendingLoadTasks = {}
m.content = m.top.findNode("Content")
m.top.content = m.content
m.content.addField("index", "integer", false)
m.content.index = m.top.index
' TODO:P2 use actual queue nodes instead of internal buffer
m.watchedVideos = new RingBuffer(100)
end function
function Play(node as object, playlistIndex as integer)
m.top.index += 1
m.top.playlistIndex = playlistIndex
node = WrapWithIndexField(node)
if m.top.index >= m.content.getChildCount()
m.content.appendChild(node)
m.top.index = m.content.getChildCount() - 1
else
m.content.insertChild(node, m.top.index)
end if
PlayItemAtCurrentIndex()
end function
function AddToQueue(node as object)
node = WrapWithIndexField(node)
m.content.appendChild(node)
queueNotifications = m.top.preferences["misc.queue_notifications"]
if queueNotifications
PlayQueue.ShowNotifcation(m.top.notifications, node)
end if
end function
function WrapWithIndexField(node as object) as object
node = NodeByRef.Wrap(node)
if not node.hasField("index")
node.addField("index", "integer", false)
end if
node.index = m.top.index
return node
end function
' TODO:P0 better model of the queue (Now playing, etc)
function GetQueue(_unused as dynamic) as object
queueNodes = m.content.getChildren(-1, 0)
items = []
for each node in queueNodes
node = NodeByRef.Unwrap(node)
if node = invalid
continue for
end if
nodeType = node.type
if nodeType = "video"
items.push({
type: nodeType
videoId: node.videoId
title: node.title
author: node.author
thumbnail: node.thumbnail
})
else if node.type = "playlist"
items.push({
type: nodeType
playlistId: node.playlistId
title: node.title
thumbnail: node.thumbnail
videoCountText: node.videoCountText
})
end if
end for
return {
index: m.top.index
playlistIndex: m.top.playlistIndex
items: items
}
end function
function Clear(_unused as dynamic)
m.content.removeChildrenIndex(m.content.getChildCount(), 0)
m.top.index = -1
m.top.playlistIndex = -1
end function
function PlayNextItem(_unused as dynamic) as boolean
childCount = m.content.getChildCount()
if childCount = 0
return false
end if
index = m.top.index
if index <> -1
if index >= childCount
return false
end if
node = m.content.getChild(index)
node = NodeByRef.Unwrap(node)
if node.type = "playlist"
m.top.playlistIndex += 1
if PlayPlaylistAtCurrentIndex(node)
return true
end if
end if
end if
m.top.index += 1
m.top.playlistIndex = -1
if m.top.index >= childCount
return false
end if
return PlayItemAtCurrentIndex()
end function
function PlayItemAtIndex(index as integer) as boolean
m.top.index = index
m.top.playlistIndex = -1
return PlayItemAtCurrentIndex()
end function
function PlayItemAtCurrentIndex() as boolean
node = m.content.getChild(m.top.index)
node = NodeByRef.Unwrap(node)
if node = invalid
return false
end if
if node.type = "video"
PlayVideo(node)
return true
else if node.type = "playlist"
if m.top.playlistIndex = -1
m.top.playlistIndex = 0
end if
return PlayPlaylistAtCurrentIndex(node)
end if
return false
end function
function PlayPlaylistAtCurrentIndex(playlist as object) as boolean
playlist = NodeByRef.Unwrap(playlist)
if playlist.videoCount < 0
LoadPlaylist(playlist)
return true
end if
playlistIndex = m.top.playlistIndex
if playlistIndex < 0 or playlistIndex >= playlist.videoCount
return false
end if
if playlistIndex < playlist.getChildCount()
child = playlist.getChild(playlistIndex)
PlayVideo(child)
return true
end if
LoadPlaylist(playlist)
return true
end function
function PlayVideo(node as object)
videoId = node.videoId
if not m.watchedVideos.Contains(videoId)
m.watchedVideos.Push(videoId)
end if
VideoUtils.PlayVideo(node)
end function
function LoadPlaylist(playlist as object) as void
if playlist.loadState = FeedLoadState.Loading
return
end if
playlist.loadState = FeedLoadState.Loading
task = StartAsyncTask(PlaylistContentTask, {
content: playlist
invidious: m.top.invidious
}, OnPlaylistContentTaskResult)
m.pendingLoadTasks[task.id] = task
end function
function OnPlaylistContentTaskResult(output as object) as void
m.pendingLoadTasks.Delete(output.task.id)
if output.cancelled
return
end if
playlist = output.task.input.content
if not output.success or not output.result.success
' output.error for unhandled exception
error = output.error
if error = invalid
' output.result.error for network errors
error = output.result.error
end if
error = ErrorUtils.Format(error)
LogError(error)
playlistId = playlist.playlistId
message = `Failed to load playlist ${playlistId}\n${error}`
' TODO:P1 play next upon closing the dialog
DialogUtils.ShowDialog(message, "Playlist load fail", true)
return
end if
PlayPlaylistAtCurrentIndex(playlist)
end function
function OnIndexChange()
index = m.top.index
m.content.index = index
children = m.top.content.getChildren(-1, 0)
for each child in children
child.index = index
end for
end function
function watchedVideosContain(videoId as string) as boolean
return m.watchedVideos.Contains(videoId)
end function
function watchedVideosClear(_unused as dynamic)
m.watchedVideos = new RingBuffer(100)
end function
@@ -1,21 +0,0 @@
<component name="PlayQueue" extends="Node">
<interface>
<field id="content" type="node" />
<field id="index" type="integer" value="-1" onChange="OnIndexChange" />
<field id="playlistIndex" type="integer" value="-1" />
<field id="invidious" type="node" />
<field id="notifications" type="node" />
<field id="preferences" type="node" />
<function name="Play" />
<function name="AddToQueue" />
<function name="GetQueue" />
<function name="Clear" />
<function name="PlayNextItem" />
<function name="PlayItemAtIndex" />
<function name="watchedVideosContain" />
<function name="watchedVideosClear" />
</interface>
<children>
<ContentNode id="Content" />
</children>
</component>
@@ -1,83 +0,0 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.queueList = m.top.findNode("queueList")
m.queueLabel = m.top.findNode("queueLabel")
m.clearButton = m.top.findNode("clearButton")
m.showAnimation = m.top.findNode("showAnimation")
m.clearButton.ObserveField("buttonSelected", FuncName(OnClearButtonSelected))
m.queueList.ObserveField("itemSelected", FuncName(OnItemSelected))
SetNavigation(m.queueList, "up", m.clearButton)
SetNavigation(m.clearButton, "down", m.queueList)
end function
function Show(unsued as dynamic)
m.showAnimation.control = "start"
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.queueList, true)
end function
function OnContentSet() as void
content = m.top.content
if content = invalid
return
end if
if not content.isSameNode(m.queueList.content)
m.queueList.content = content
end if
index = content.index
if IsInt(index) and index <> -1
m.queueLabel.text = `Queue (${index + 1}/${content.getChildCount()})`
else
m.queueLabel.text = `Queue (${content.getChildCount()})`
end if
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled
return true
end if
if press = false
return false
end if
if key = "back"
Close()
return true
end if
return false
end function
function Close()
m.top.appController@.PopScreen()
end function
function OnClearButtonSelected()
m.top.playQueue@.Clear()
end function
function OnItemSelected() as void
content = m.queueList.content
if content = invalid
return
end if
index = m.queueList.itemSelected
if index < 0 or index >= content.getChildCount()
return
end if
m.top.playQueue@.PlayItemAtIndex(index)
end function
@@ -1,23 +0,0 @@
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
namespace PlayQueueViewUtils
function Open(playQueue as object, appController as object) as object
playQueueView = CreateObject("roSGNode", "PlayQueueView")
playQueueView.appController = appController
playQueueView.playQueue = playQueue
appController@.PushScreen(playQueueView)
content = playQueue.content
index = playQueue.index
playQueueView.content = content
if index > -1 and index < content.GetChildCount()
playQueueView.jumpToItem = index
end if
playQueueView@.Show()
return playQueueView
end function
end namespace
@@ -1,48 +0,0 @@
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
' TODO:P1 this should only be called from PlaylistContentNode.bs
@asynctask
function PlaylistContentTask(input as object) as object
contentNode = input.content
invidiousNode = input.invidious
if m.top.cancel
contentNode.loadState = FeedLoadState.None
return invalid
end if
service = new Invidious.InvidiousService(invidiousNode)
index = contentNode.getChildCount()
response = service.GetPlaylist(contentNode.playlistId, index, m.top.cancellation)
if m.top.cancel
contentNode.loadState = FeedLoadState.None
return invalid
end if
metadata = response.Json()
if not response.IsSuccess() or metadata = invalid
contentNode.loadState = FeedLoadState.Error
return {
success: false
error: response.ErrorMessage()
}
end if
instance = service.GetInstance()
InvidiousContent.ToPlaylistContentNode(contentNode, metadata, instance)
childCount = contentNode.getChildCount()
if metadata.videos.Count() > 0 or childCount < metadata.videoCount
contentNode.loadState = FeedLoadState.LoadedPage
else
contentNode.loadState = FeedLoadState.Loaded
end if
return {
success: true
}
end function
@@ -2,10 +2,10 @@ import "pkg:/components/ChannelView/ChannelUtils.bs"
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/LongPress.bs"
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
@@ -116,7 +116,10 @@ function OnItemSelected(index as integer) as void
videoId = video.videoId
if not StringUtils.IsNullOrEmpty(videoId)
LogInfo("Play playlist:", playlistId, "video:", videoId)
m.playQueue@.Play(playlist, index)
m.videoQueue.playPlaylist = {
playlistNode: playlist
playlistIndex: index
}
end if
end function
@@ -140,9 +143,6 @@ function OnItemLongPressed(index as integer) as void
LogInfo("Long press: playlist:", playlistId, "video:", videoId)
' TODO:P1 handle case of opening the channel
' - Owner of a video
' - Owner of a playlist
contextMenuProviders = [m.top]
ContextMenuUtils.Open(contextMenuProviders, m.appController, video)
end function
@@ -164,14 +164,26 @@ function GetContextMenuOptionsForItem(video as object) as object
end if
options = [
ContextMenuUtils.CreateOption("Play", m.playQueue, "Play", [playlist, index]),
ContextMenuUtils.CreateOption("Queue", m.playQueue, "AddToQueue", [playlist])
ContextMenuUtils.CreateOption("Play video", m.playQueue, "Play", [video, -1]),
ContextMenuUtils.CreateOption("Queue video", m.playQueue, "AddToQueue", [video]),
ContextMenuUtils.CreateOption("Play", m.videoQueue, "FuncPlayPlaylist", [playlist, index]),
ContextMenuUtils.CreateOption("Queue", m.videoQueue, "FuncAddToQueuePlaylist", [playlist])
ContextMenuUtils.CreateOption("Play video", m.videoQueue, "FuncPlayVideo", [video]),
ContextMenuUtils.CreateOption("Queue video", m.videoQueue, "FuncAddToQueueVideo", [video]),
]
if not StringUtils.IsNullOrEmpty(playlist.authorId)
options.push(ContextMenuUtils.CreateOption("Open channel", m.top, "OpenPlaylistChannel", [playlist]))
playlistAuthorId = playlist.authorId
videoAuthorId = video.authorId
if not StringUtils.IsNullOrEmpty(playlistAuthorId) or not StringUtils.IsNullOrEmpty(videoAuthorId)
if playlistAuthorId = videoAuthorId
options.push(ContextMenuUtils.CreateOption("Open channel", m.top, "OpenPlaylistChannel", [playlist]))
else
if not StringUtils.IsNullOrEmpty(playlistAuthorId)
options.push(ContextMenuUtils.CreateOption("Open playlist channel", m.top, "OpenPlaylistChannel", [playlist]))
end if
if not StringUtils.IsNullOrEmpty(videoAuthorId)
options.push(ContextMenuUtils.CreateOption("Open video channel", m.top, "OpenVideoChannel", [video]))
end if
end if
end if
options.append(m.bookmarks@.GetMenuForPlaylist(playlist))
@@ -190,6 +202,16 @@ function OpenPlaylistChannel(playlist as object) as void
ChannelUtils.Open(channel)
end function
function OpenVideoChannel(video as object) as void
authorId = video.authorId
if StringUtils.IsNullOrEmpty(authorId)
LogWarn("Invalid authorId:", authorId)
return
end if
channel = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId }, invalid)
ChannelUtils.Open(channel)
end function
'TODO:P1 a playlist could have been opened from the bookmarks, which can be as old as 3 days
' We should make a request in this case, and let the cache handle freshness.
function LoadPlaylistIfNeeded() as void
@@ -213,42 +235,5 @@ function LoadPlaylistIfNeeded() as void
return
end if
LoadPlaylist()
end function
function LoadPlaylist() as void
if m.playlistLoadTask <> invalid
m.playlistLoadTask.cancel = true
end if
m.top.content.loadState = FeedLoadState.Loading
m.playlistLoadTask = StartAsyncTask(PlaylistContentTask, {
content: m.top.content
invidious: m.top.invidious
}, OnPlaylistContentTaskResult)
end function
function OnPlaylistContentTaskResult(output as object) as void
m.playlistLoadTask = invalid
if output.cancelled
return
end if
if not output.success or not output.result.success
' output.error for unhandled exception
error = output.error
if error = invalid
' output.result.error for network errors
error = output.result.error
end if
error = ErrorUtils.Format(error)
LogError(error)
playlistId = output.task.input.content.playlistId
message = `Failed to load playlist ${playlistId}\n${error}`
DialogUtils.ShowDialog(message, "Playlist load fail", true)
return
end if
LoadPlaylistIfNeeded()
m.top.content@.LoadPlaylistPage(m.top.invidious)
end function
@@ -3,9 +3,10 @@
<field id="content" type="node" onChange="OnContentSet" />
<field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="playQueue" type="node" bind="/PlayQueue" />
<field id="videoQueue" type="node" bind="/VideoQueue" />
<field id="bookmarks" type="node" bind="/Bookmarks" />
<function name="OpenPlaylistChannel" />
<function name="OpenVideoChannel" />
</interface>
<children>
<Rectangle
@@ -56,8 +57,8 @@
numColumns="1"
numRows="5"
vertFocusAnimationStyle="floatingFocus"
translation="[620,90]" />
translation="[620,90]"
focusBitmapUri="pkg:/images/focus-glow-padding-27.9.png" />
</Poster>
</children>
</component>
@@ -14,7 +14,8 @@ function OnContentSet() as void
end if
m.top.title = content.title
m.top.author = content.author
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.top.author = content._author
m.top.thumbnailUri = content.thumbnail
if ValidInt(content.lengthSeconds) <> 0
@@ -1,4 +1,4 @@
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
function Init()
' TODO:P2 Add tooltip to each field with description of what it means
@@ -31,7 +31,7 @@
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png"
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png"
/>
</Group>
</children>
@@ -1,3 +1,4 @@
import "HomeScreenUtils.bs"
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs"
@@ -14,7 +15,15 @@ function OnNodeReady()
SetNavigation(invalid, "left", m.navBar)
m.rowList@.BindNode()
m.rowList.feeds = ParseJson(ReadAsciiFile(m.top.feedFile))
' TODO:P1 home screen should only be refreshed when the user navigates to it
' (similar to bookmarks screen)
m.preferences.observeFieldScoped("misc.home_screen_layout", FuncName(OnHomeLayoutChange))
OnHomeLayoutChange()
end function
function OnHomeLayoutChange() as void
m.rowList.feeds = HomeScreenUtils.GetFeed(m.top.feedFile, m.preferences)
end function
function OnFocusChange() as void
@@ -2,6 +2,7 @@
<interface>
<field id="navBar" type="node" bind="/NavBar" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="preferences" type="node" bind="/Preferences" />
<field id="feedFile" type="string" value="libpkg:/config/default_home_layout.yaml" />
</interface>
<children>
@@ -19,7 +20,7 @@
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png"
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png"
/>
</children>
</component>
@@ -0,0 +1,28 @@
import "pkg:/source/utils/Types.bs"
namespace HomeScreenUtils
function GetFeed(feedFileName as string, preferences as object) as object
feed = ParseJson(ReadAsciiFile(feedFileName))
homeLayout = preferences["misc.home_screen_layout"]
if not IsArray(homeLayout) or homeLayout.Count() = 0
return feed
end if
feedItems = {}
for each item in feed
feedItems[item["id"]] = item
end for
filteredFeed = []
for each item in homeLayout
if item.enabled = true
filteredFeed.push(feedItems[item.id])
end if
end for
return filteredFeed
end function
end namespace
@@ -0,0 +1,200 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/Navigation.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/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
function Init()
m.webAppButton = m.top.findNode("WebAppButton")
m.linkWithWifiButton = m.top.findNode("LinkWithWiFiButton")
m.linkWithTvButton = m.top.findNode("LinkWithTvButton")
m.webAppPanel = m.top.findNode("WebAppPanel")
m.linkWithWifiPanel = m.top.findNode("LinkWithWiFiPanel")
m.linkWithTvPanel = m.top.findNode("LinkWithTvPanel")
m.wifiNameLabel = m.top.findNode("WifiNameLabel")
m.wifiInstructionWithDeviceNameLabel = m.top.findNode("WifiInstructionWithDeviceNameLabel")
m.linkCodeLabel = m.top.findNode("LinkCodeLabel")
end function
function OnNodeReady()
SetNavigation(m.webAppButton, "down", m.linkWithWifiButton)
SetNavigation(m.linkWithWifiButton, "down", m.linkWithTvButton)
SetNavigation(m.linkWithTvButton, "up", m.linkWithWifiButton)
SetNavigation(m.linkWithWifiButton, "up", m.webAppButton)
SetNavigation(invalid, "back", m.navBar)
SetNavigation(invalid, "left", m.navBar)
address = m.webserver@.GetServerAddress()
isValidAddress = not StringUtils.IsNullOrEmpty(address)
if isValidAddress
m.top.url = address
end if
m.top.findNode("noInternet").visible = not isValidAddress
m.top.findNode("yesInternet").visible = isValidAddress
m.top.focusable = isValidAddress
m.top.observeField("visible", FuncName(OnVisibleChanged))
m.linkWithWifiPanel.observeField("visible", FuncName(OnLinkWithWifiPanelVisibleChanged))
m.linkWithWifiPanel.visible = false
m.linkWithTvPanel.observeField("visible", FuncName(OnLinkWithTvPanelVisibleChanged))
m.linkWithTvPanel.visible = false
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
if m.currentNavigtionNode = invalid
m.currentNavigtionNode = m.webAppButton
end if
NodeSetFocus(m.currentNavigtionNode, true)
ShowTab(m.currentNavigtionNode)
end function
function OnUrlSet()
url = m.top.url
urlLabel = m.top.findNode("urlLabel")
urlLabel.text = url
qrCodePoster = m.top.findNode("QrCodePoster")
AsyncTask.Start(Tasks.GenerateQrCodeTask, {
poster: qrCodePoster
text: url
size: qrCodePoster.loadWidth
padding: 20
})
end function
function OnkeyEvent(key as string, press as boolean) as boolean
navigation = NavigationKeyHandler(key, press)
if navigation.handled
ShowTab(navigation.node)
return true
end if
return false
end function
function ShowTab(button as object)
if button.isSameNode(m.webAppButton)
m.webAppPanel.visible = true
m.linkWithWifiPanel.visible = false
m.linkWithTvPanel.visible = false
m.currentNavigtionNode = button
else if button.isSameNode(m.linkWithWifiButton)
m.linkWithWifiPanel.visible = true
m.webAppPanel.visible = false
m.linkWithTvPanel.visible = false
m.currentNavigtionNode = button
else if button.isSameNode(m.linkWithTvButton)
m.linkWithTvPanel.visible = true
m.webAppPanel.visible = false
m.linkWithWifiPanel.visible = false
m.currentNavigtionNode = button
end if
end function
function OnVisibleChanged()
if not m.top.visible
m.currentNavigtionNode = invalid
m.webAppPanel.visible = true
m.linkWithWifiPanel.visible = false
m.linkWithTvPanel.visible = false
end if
end function
function OnLinkWithWifiPanelVisibleChanged() as void
if not m.linkWithWifiPanel.visible
return
end if
deviceInfo = CreateObject("roDeviceInfo")
connectionInfo = deviceInfo.GetConnectionInfo()
if connectionInfo.type = "WiFiConnection"
m.wifiNameLabel.text = connectionInfo.ssid
else if connectionInfo.type = "WiredConnection"
m.wifiNameLabel.text = "Wired connection"
else
m.wifiNameLabel.text = "N/A"
end if
m.wifiInstructionWithDeviceNameLabel.text = `Tap the cast icon and select "${m.loungeService.deviceName}"`
end function
function OnLinkWithTvPanelVisibleChanged()
if m.linkWithTvPanel.visible
GeneratePairingCode()
else
if m.linkCodeTask <> invalid
m.linkCodeTask.cancel = true
m.linkCodeTask = invalid
end if
m.linkCodeLabel.text = ""
end if
end function
function GeneratePairingCode()
if m.linkCodeTask <> invalid
m.linkCodeTask.cancel = true
end if
m.linkCodeLabel.text = "Loading..."
m.linkCodeTask = AsyncTask.Start(Tasks.LoungeGenerateManualPairingCodeTask, {
loungeService: m.loungeService
loungeToken: m.loungeService.loungeToken
screenId: m.loungeService.screenId
' Use deviceName as screenName
screenName: m.loungeService.deviceName
deviceId: m.loungeService.deviceId
}, OnLoungeGenerateManualPairingCodeTaskResult)
end function
function OnLoungeGenerateManualPairingCodeTaskResult(output as object) as void
m.linkCodeTask = invalid
if output.cancelled
return
end if
if not output.success or not output.result.success
' output.error for unhandled exception
error = output.error
if error = invalid
' output.result.error for network errors
error = output.result.error
end if
error = ErrorUtils.Format(error)
LogError(error)
message = `Failed to generate manual pairing code\n${error}`
DialogUtils.ShowDialog(message, "Get TV code fail", true)
return
end if
manualLinkCode = output.result.code
if StringUtils.IsNullOrEmpty(manualLinkCode)
m.linkCodeLabel.text = ""
return
end if
' insert a space every 3 characters.
parts = []
for i = 0 to manualLinkCode.Len() - 1 step 3
parts.Push(manualLinkCode.Mid(i, 3))
end for
linkCode = parts.Join(" ")
m.linkCodeLabel.text = linkCode
end function
@@ -0,0 +1,160 @@
<component name="RemoteScreen" extends="Group" includes="AutoBind,Focus">
<interface>
<field id="navBar" type="node" bind="/NavBar" />
<field id="webServer" type="node" bind="/WebServer" />
<field id="loungeService" type="node" bind="/LoungeService" />
<field id="url" type="string" onChange="OnUrlSet" />
<field id="qrCodeUrl" type="string" onChange="OnUrlSet" />
</interface>
<children>
<Group id="noInternet" visible="false">
<Label
height="720"
width="1280"
font="font:MediumBoldSystemFont"
horizAlign="center"
vertAlign="center"
text="Could not get IP address: are we connected to the internet?"
/>
</Group>
<Group id="yesInternet" visible="false">
<SettingCategory
id="WebAppButton"
displayText="Playlet Web App"
description="Use Playlet Remote in the browser"
minimumWidth="350"
translation="[150,178]" />
<SettingCategory
id="LinkWithWiFiButton"
displayText="Link with Wi-Fi"
description="Cast from the YouTube app to Playlet"
minimumWidth="350"
translation="[150,314]" />
<SettingCategory
id="LinkWithTvButton"
displayText="Link with TV code"
description="Cast from the YouTube app to Playlet"
minimumWidth="350"
translation="[150,450]" />
<Group id="WebAppPanel"
translation="[700,115]">
<Label
height="30"
width="400"
font="font:SmallBoldSystemFont"
horizAlign="center"
text="Scan the QR code" />
<Poster
id="QrCodePoster"
height="400"
width="400"
loadHeight="400"
loadWidth="400"
translation="[0,40]" />
<Label
id="UrlLabel"
height="30"
width="400"
font="font:SmallBoldSystemFont"
horizAlign="center"
translation="[0,460]" />
</Group>
<Group id="LinkWithWiFiPanel"
translation="[700,220]">
<LayoutGroup itemSpacings="[12]">
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label
font="font:SmallSystemFont"
text="1." />
<Label
font="font:SmallSystemFont"
width="380"
wrap="true"
text="On your phone, connect to the same Wi-Fi network as this device." />
</LayoutGroup>
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label
font="font:SmallSystemFont"
text="2." />
<Label
font="font:SmallSystemFont"
width="380"
wrap="true"
text="Open the YouTube app on your phone." />
</LayoutGroup>
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label
font="font:SmallSystemFont"
text="3." />
<Label
id="WifiInstructionWithDeviceNameLabel"
font="font:SmallSystemFont"
width="380"
wrap="true"
text="Tap the cast icon and select this device." />
</LayoutGroup>
</LayoutGroup>
<Label
text="Roku connected to:"
translation="[0,220]">
<Font role="font" uri="font:SystemFontFile" size="20" />
</Label>
<Label
id="WifiNameLabel"
color="#4287f5"
translation="[0,250]">
<Font role="font" uri="font:BoldSystemFontFile" size="28" />
</Label>
</Group>
<Group id="LinkWithTvPanel"
translation="[700,220]">
<LayoutGroup itemSpacings="[12]">
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label
font="font:SmallSystemFont"
text="1." />
<Label
font="font:SmallSystemFont"
width="380"
wrap="true"
text="On your phone, open the YouTube app." />
</LayoutGroup>
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label
font="font:SmallSystemFont"
text="2." />
<Label
font="font:SmallSystemFont"
width="380"
wrap="true"
text="Tap the Chromecast icon." />
</LayoutGroup>
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label
font="font:SmallSystemFont"
text="3." />
<Label
font="font:SmallSystemFont"
width="380"
wrap="true"
text="Tap &quot;Link with TV code&quot; and enter the code below." />
</LayoutGroup>
</LayoutGroup>
<Label
id="LinkCodeLabel"
font="font:LargeBoldSystemFont"
color="#4287f5"
translation="[-30,180]"
width="460"
horizAlign="center">
<Font role="font" uri="font:BoldSystemFontFile" size="48" />
</Label>
</Group>
</Group>
</children>
</component>
@@ -252,7 +252,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return true
end if
if key = "options" and press
if key = "options"
' A pass-through to the app controller, so it can toggle picture-in-picture
return false
end if
@@ -1,7 +1,8 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Screens/SearchScreen/SearchSuggestionsTask.bs"
import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/CryptoUtils.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/LoadingScreen.bs"
@@ -20,6 +21,8 @@ function Init()
m.rowList.screen = m.top
m.keyboard.keyGrid.keyDefinitionUri = "libpkg:/config/search-keyboard-layout.json5"
textEditBox = m.keyboard.textEditBox
textEditBox.voiceEntryType = "generic"
textEditBox.voiceEnabled = true
@@ -98,7 +101,7 @@ function OnTextChange() as void
m.searchSuggestionsTask.cancel = true
end if
m.searchSuggestionsTask = StartAsyncTask(SearchSuggestionsTask, {
m.searchSuggestionsTask = AsyncTask.Start(Tasks.SearchSuggestionsTask, {
q: m.keyboard.text
invidious: m.invidious
preferences: m.preferences
@@ -300,6 +303,10 @@ function OnkeyEvent(key as string, press as boolean) as boolean
if m.currentNavigtionNode.isSameNode(m.suggestions)
OnSearchButtonFocused()
end if
if m.currentNavigtionNode.isSameNode(m.keyboard)
' First section, grid, row and key
m.keyboard.keyGrid.jumpToKey = [0, 0, 0, 0]
end if
return true
end if
return false
@@ -10,9 +10,9 @@
<Group id="container">
<Button
id="filtersButton"
translation="[160,40]"
minWidth="240"
height="48"
translation="[160,35]"
minWidth="0"
height="58"
showFocusFootprint="true"
iconUri="pkg:/images/icons/filters-white.png"
focusedIconUri="pkg:/images/icons/filters-black.png"
@@ -46,7 +46,7 @@
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png"
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png"
/>
<Animation
id="scrollAnimation"
@@ -0,0 +1,58 @@
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.top.focusable = true
m.top.itemSpacings = [8]
m.button = m.top.findNode("button")
m.button.observeField("buttonSelected", FuncName(OpenHomeScreenEditor))
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.button, true)
end function
function BindPreference(preferences as object, key as string)
if m.preferences <> invalid and m.key <> invalid
m.preferences.unobserveFieldScoped(m.key)
end if
m.preferences = preferences
m.key = key
if preferences <> invalid and key <> invalid
preferences.observeFieldScoped(key, FuncName(OnPreferenceChange))
OnPreferenceChange()
end if
end function
function OpenHomeScreenEditor()
editor = CreateObject("roSGNode", "HomeScreenEditor")
m.appController@.PushScreen(editor)
editor@.BindNode()
editor.value = m.top.value
editor.observeField("save", FuncName(OnSaveHomeScreenEditor))
end function
function OnSaveHomeScreenEditor(event as object)
editor = event.GetRoSGNode()
m.top.value = editor.value
end function
function OnPreferenceChange()
m.top.value = m.preferences[m.key]
end function
function OnValueChange() as void
if m.preferences = invalid or m.key = invalid
return
end if
m.preferences[m.key] = m.top.value
end function
@@ -0,0 +1,21 @@
<component name="EditHomeScreenControl" extends="LayoutGroup" includes="AutoBind,Focus">
<interface>
<field id="displayText" type="string" alias="Button.text" />
<field id="description" type="string" alias="DescriptionLabel.text" />
<field id="value" type="array" onChange="OnValueChange" />
<field id="appController" type="node" bind="/AppController" />
<function name="BindPreference" />
</interface>
<children>
<Button
id="button"
minWidth="300"
showFocusFootprint="true" />
<Label id="DescriptionLabel"
width="450"
color="0xb4b4b4ff"
wrap="true">
<Font role="font" uri="font:SystemFontFile" size="18" />
</Label>
</children>
</component>
@@ -0,0 +1,161 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.homeLayout = {}
homeLayout = ParseJson(ReadAsciiFile("libpkg:/config/default_home_layout.yaml"))
for each item in homeLayout
m.homeLayout[item.id] = item
end for
m.checkList = m.top.findNode("checkList")
m.moveUpButton = m.top.findNode("moveUpButton")
m.moveDownButton = m.top.findNode("moveDownButton")
m.closeButton = m.top.findNode("closeButton")
m.saveButton = m.top.findNode("saveButton")
SetNavigation(m.checkList, "down", m.saveButton)
SetNavigation(m.saveButton, "up", m.checkList)
SetNavigation(m.closeButton, "up", m.checkList)
SetNavigation(m.saveButton, "right", m.closeButton)
SetNavigation(m.closeButton, "left", m.saveButton)
SetNavigation(m.moveUpButton, "left", m.checkList)
SetNavigation(m.moveDownButton, "left", m.checkList)
SetNavigation(m.checkList, "right", m.moveUpButton)
SetNavigation(m.moveUpButton, "down", m.moveDownButton)
SetNavigation(m.moveDownButton, "up", m.moveUpButton)
SetNavigation(m.moveDownButton, "down", m.closeButton)
m.moveUpButton.observeField("buttonSelected", FuncName(OnMoveUpButtonSelected))
m.moveDownButton.observeField("buttonSelected", FuncName(OnMoveDownButtonSelected))
m.saveButton.observeField("buttonSelected", FuncName(OnSaveButtonSelected))
m.closeButton.observeField("buttonSelected", FuncName(Close))
m.checkList.observeField("checkedState", FuncName(OnCheckedStateChange))
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.checkList, true)
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled
return true
end if
if key = "options"
' A pass-through to the app controller, so it can toggle picture-in-picture
return false
end if
if key = "back" and press
Close()
return true
end if
return true
end function
function OnValueChange()
content = m.checkList.content
value = m.top.value
nodes = []
checkedState = []
for each item in value
feed = m.homeLayout[item.id]
if feed = invalid
LogWarn("unknown feed id:", item.id)
continue for
end if
node = CreateObject("roSGNode", "ContentNode")
node.id = feed.id
node.title = feed.title
nodes.push(node)
checkedState.push(item.enabled)
end for
labelCount = content.getChildCount()
if labelCount > 0
content.removeChildrenIndex(labelCount, 0)
end if
content.appendChildren(nodes)
m.checkList.checkedState = checkedState
end function
function OnCheckedStateChange() as void
content = m.checkList.content
if content = invalid or content.getChildCount() = 0
return
end if
checkedState = m.checkList.checkedState
if checkedState = invalid or checkedState.Count() = 0
return
end if
value = []
checkboxes = content.getChildren(-1, 0)
for i = 0 to checkboxes.Count() - 1
checkbox = checkboxes[i]
value.push({
id: checkbox.id
enabled: checkedState[i]
})
end for
m.top.value = value
end function
function OnMoveUpButtonSelected() as void
MoveItem(-1)
end function
function OnMoveDownButtonSelected() as void
MoveItem(1)
end function
function MoveItem(offset as integer) as void
content = m.checkList.content
if content = invalid or content.getChildCount() = 0
return
end if
itemCount = content.getChildCount()
index = m.checkList.itemFocused
newIndex = MathUtils.Clamp(index + offset, 0, itemCount - 1)
if index = newIndex
return
end if
checkedState = m.checkList.checkedState
node = content.getChild(index)
content.insertChild(node, newIndex)
tmp = checkedState[index]
checkedState[index] = checkedState[newIndex]
checkedState[newIndex] = tmp
m.checkList.itemFocused = newIndex
m.checkList.jumpToItem = newIndex
m.checkList.checkedState = checkedState
end function
function OnSaveButtonSelected()
' Save the new layout to m.top.value
OnCheckedStateChange()
m.top.save = true
Close()
end function
function Close()
m.appController@.PopScreen()
end function
@@ -0,0 +1,53 @@
<component name="HomeScreenEditor" extends="Group" includes="AutoBind,Focus">
<interface>
<field id="value" type="array" onChange="OnValueChange" />
<field id="save" type="boolean" alwaysNotify="true" />
<field id="appController" type="node" bind="/AppController" />
</interface>
<children>
<Rectangle
width="1280"
height="720"
color="#000000"
opacity="0.5">
</Rectangle>
<Rectangle
width="960"
height="600"
translation="[160,60]"
color="#242424">
<CheckList
id="checkList"
vertFocusAnimationStyle="floatingFocus"
translation="[164,70]">
<ContentNode role="content" />
</CheckList>
<Button
id="moveUpButton"
text="Move up"
showFocusFootprint="true"
minWidth="220"
translation="[640,183]" />
<Button
id="moveDownButton"
text="Move down"
showFocusFootprint="true"
minWidth="220"
translation="[640,273]" />
<Button
id="closeButton"
text="Close"
showFocusFootprint="true"
minWidth="150"
translation="[500,500]" />
<Button
id="saveButton"
text="Save"
showFocusFootprint="true"
minWidth="150"
translation="[320,500]" />
</Rectangle>
</children>
</component>
@@ -50,7 +50,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return true
end if
if key = "options" and press
if key = "options"
' A pass-through to the app controller, so it can toggle picture-in-picture
return false
end if
@@ -1,9 +1,10 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTestingTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
@@ -30,7 +31,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return true
end if
if key = "options" and press
if key = "options"
' A pass-through to the app controller, so it can toggle picture-in-picture
return false
end if
@@ -58,7 +59,7 @@ function RunTestsTask()
m.testingTask.cancel = true
end if
m.testingTask = StartAsyncTask(InvidiousInstanceTestingTask, {
m.testingTask = AsyncTask.Start(Tasks.InvidiousInstanceTestingTask, {
instance: m.top.instance
listNode: m.testList
})
@@ -1,6 +1,6 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Screens/SettingsScreen/InvidiousInstance/InvidiousPublicInstances/InvidiousPublicInstancesTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
@@ -43,7 +43,7 @@ function Refresh()
m.invidiousPublicInstancesTask.cancel = true
end if
m.invidiousPublicInstancesTask = StartAsyncTask(InvidiousPublicInstancesTask, {
m.invidiousPublicInstancesTask = AsyncTask.Start(Tasks.InvidiousPublicInstancesTask, {
listNode: m.instances
}, OnInvidiousPublicInstancesTaskResults)
@@ -30,12 +30,13 @@
<MarkupGrid
id="instances"
itemComponentName="InvidiousPublicInstancesListItem"
itemSize="[860,16]"
itemSize="[810,16]"
itemSpacing="[0,20]"
numColumns="1"
numRows="7"
vertFocusAnimationStyle="floatingFocus"
translation="[0,46]" />
translation="[0,46]"
focusBitmapUri="pkg:/images/white-border.9.png" />
</children>
</component>
@@ -1,22 +1,11 @@
function Init()
m.nameLabel = m.top.findNode("nameLabel")
m.versionLabel = m.top.findNode("versionLabel")
m.usersLabel = m.top.findNode("usersLabel")
m.signupLabel = m.top.findNode("signupLabel")
m.locationLabel = m.top.findNode("locationLabel")
m.flagEmoji = m.top.findNode("flagEmoji")
m.healthLabel = m.top.findNode("healthLabel")
end function
function OnContentSet() as void
content = m.top.itemContent
m.nameLabel.text = content.name
m.versionLabel.text = content.version
m.usersLabel.text = content.users
m.signupLabel.text = content.signup
m.locationLabel.text = content.location
m.flagEmoji.uri = content.flag
m.healthLabel.text = content.health
m.top.name = content.name
m.top.version = content.version
m.top.users = content.users
m.top.signup = content.signup
m.top.location = content.location
m.top.flag = content.flag
m.top.health = content.health
end function
@@ -1,6 +1,13 @@
<component name="InvidiousPublicInstancesListItem" extends="Group">
<interface>
<field id="itemContent" type="node" onChange="OnContentSet" />
<field id="name" type="string" alias="nameLabel.text" />
<field id="version" type="string" alias="versionLabel.text" />
<field id="users" type="string" alias="usersLabel.text" />
<field id="signup" type="string" alias="signupLabel.text" />
<field id="location" type="string" alias="locationLabel.text" />
<field id="flag" type="string" alias="flagEmoji.uri" />
<field id="health" type="string" alias="healthLabel.text" />
</interface>
<children>
<Label
@@ -35,7 +42,7 @@
<Label
id="healthLabel"
font="font:SmallestSystemFont"
width="100"
width="60"
translation="[750,0]" />
</children>
</component>
@@ -0,0 +1,71 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.top.focusable = true
m.top.itemSpacings = [10]
m.minusButton = m.top.findNode("MinusButton")
m.numberButton = m.top.findNode("NumberButton")
m.plusButton = m.top.findNode("PlusButton")
m.minusButton.observeFieldScoped("buttonSelected", FuncName(OnMinusSelected))
m.plusButton.observeFieldScoped("buttonSelected", FuncName(OnPlusSelected))
SetNavigation(m.minusButton, "right", m.numberButton)
SetNavigation(m.numberButton, "left", m.minusButton)
SetNavigation(m.numberButton, "right", m.plusButton)
SetNavigation(m.plusButton, "left", m.numberButton)
end function
function BindPreference(preferences as object, key as string)
if m.preferences <> invalid and m.key <> invalid
m.preferences.unobserveFieldScoped(m.key)
end if
m.preferences = preferences
m.key = key
if preferences <> invalid and key <> invalid
preferences.observeFieldScoped(key, FuncName(OnPreferenceChange))
OnPreferenceChange()
end if
end function
function OnPreferenceChange()
m.top.value = MathUtils.Clamp(m.preferences[m.key], m.top.min, m.top.max)
end function
function OnValueChange() as void
m.numberButton.text = `${m.top.value}`
if m.preferences = invalid or m.key = invalid
return
end if
m.preferences[m.key] = m.top.value
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.numberButton, true)
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled
return true
end if
return false
end function
function OnMinusSelected()
m.top.value = MathUtils.Max(m.top.value - 1, m.top.min)
end function
function OnPlusSelected()
m.top.value = MathUtils.Min(m.top.value + 1, m.top.max)
end function
Loaded 100 of 253 files, more files were not shown because too many files have changed in this diff. Show more