Compare commits

...
12 Commits
Author SHA1 Message Date
Brahim Hadriche 9201b8dfe0 Release v0.17.0 (#205) 2023-11-17 16:37:01 -05:00
Brahim Hadriche cf17fed02e adjust remote repeat keys 2023-11-15 21:13:01 -05:00
Brahim Hadriche f8d202be56 Fix icon, fix ok button long press 2023-11-15 21:03:45 -05:00
Brahim Hadriche af091fe8f7 remote power button 2023-11-15 20:50:10 -05:00
Brahim Hadriche d89b1c519d support long press and touch 2023-11-15 16:22:22 -05:00
Brahim Hadriche dca3e42c79 add keyboard support 2023-11-15 13:32:27 -05:00
Brahim Hadriche 2f72c6471a Adjust remote 2023-11-15 12:05:16 -05:00
Brahim Hadriche 413e73c1c0 [PoC] Web app remote control (#203)
* [PoC] Web app remote control

* Remote UI cleanup

* changelog
2023-11-15 11:49:54 -05:00
Brahim Hadriche 2a57cc99c7 Launch Playlet from web app 2023-11-14 18:49:17 -05:00
Brahim Hadriche d65f930247 Small tweak 2023-11-13 23:13:43 -05:00
Brahim Hadriche ed632a7a62 tweak job 2023-11-13 23:10:08 -05:00
Brahim Hadriche 89ea45ed54 Add update deps job 2023-11-13 23:07:11 -05:00
38 changed files with 602 additions and 23 deletions

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
name: Update Dependencies
on:
schedule:
- cron: "0 0 * * 6"
workflow_dispatch: {}
jobs:
update_deps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Update dependencies
run: npm run update-deps
- name: Install dependencies
run: npm ci
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "update dependencies"
branch: shore/update-deps
title: "[shore] update dependencies"
body: "Weekly pull request to update dependencies."
+8
View File
@@ -5,6 +5,14 @@ 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.17.0] - 2023-11-17
### Added
- Playlet logo in web app is clickable, and launches app if not already on
- Remote control in web app
- Clickable buttons and keyboard support
## [0.16.0] - 2023-11-13
### Added
+1 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Playlet Web API
version: 0.16.0
version: 0.17.0
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
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet",
"version": "0.16.0",
"version": "0.17.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.16.0",
"version": "0.17.0",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.12",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet",
"version": "0.16.0",
"version": "0.17.0",
"description": "Unofficial Youtube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.12",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.16.0",
"version": "0.17.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.16.0"
"version": "0.17.0"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.16.0",
"version": "0.17.0",
"description": "Unofficial Youtube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-app",
+1 -1
View File
@@ -2,7 +2,7 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=16
minor_version=17
build_version=00000
ui_resolutions=hd
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.16.0",
"version": "0.17.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.16.0"
"version": "0.17.0"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.16.0",
"version": "0.17.0",
"description": "Unofficial Youtube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-lib",
+1 -1
View File
@@ -2,7 +2,7 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=16
minor_version=17
build_version=00000
ui_resolutions=hd
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-web",
"version": "0.16.0",
"version": "0.17.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.16.0",
"version": "0.17.0",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.6",
"@tailwindcss/typography": "^0.5.10",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.16.0",
"version": "0.17.0",
"type": "module",
"scripts": {
"dev": "vite",
+3
View File
@@ -20,6 +20,7 @@
import InfoScreen from "lib/Screens/InfoScreen.svelte";
import LinkDragDrop from "lib/LinkDragDrop.svelte";
import BookmarksScreen from "lib/Screens/BookmarksScreen.svelte";
import RemoteControlScreen from "lib/Screens/RemoteControlScreen.svelte";
onMount(async () => {
PlayletApi.getState().then((value) => {
@@ -71,6 +72,8 @@
<SettingsScreen visibility={currentScreen == "settings"} />
<RemoteControlScreen visibility={currentScreen == "remote"} />
<InfoScreen visibility={currentScreen == "info"} />
</div>
<BottomNavigation />
@@ -0,0 +1,47 @@
<svg
width="24px"
height="24px"
viewBox="0 0 24 24"
version="1.1"
id="svg27"
xmlns="http://www.w3.org/2000/svg"
>
<g class="fill-current">
<path
d="M 17.101562 0 L 6.898438 0 C 5.722656 0 4.765625 0.957031 4.765625 2.132812 L 4.765625 21.867188 C 4.765625 23.042969 5.722656 24 6.898438 24 L 17.101562 24 C 18.277344 24 19.234375 23.042969 19.234375 21.867188 L 19.234375 2.132812 C 19.234375 0.957031 18.277344 0 17.101562 0 Z M 17.8125 21.867188 C 17.8125 22.257812 17.492188 22.578125 17.101562 22.578125 L 6.898438 22.578125 C 6.507812 22.578125 6.1875 22.257812 6.1875 21.867188 L 6.1875 2.132812 C 6.1875 1.742188 6.507812 1.421875 6.898438 1.421875 L 17.101562 1.421875 C 17.492188 1.421875 17.8125 1.742188 17.8125 2.132812 Z M 17.8125 21.867188 "
/>
<path
d="M 10.375 13.164062 L 8.863281 13.164062 C 8.472656 13.164062 8.152344 13.484375 8.152344 13.875 C 8.152344 14.269531 8.472656 14.585938 8.863281 14.585938 L 10.375 14.585938 C 10.769531 14.585938 11.085938 14.269531 11.085938 13.875 C 11.085938 13.484375 10.769531 13.164062 10.375 13.164062 Z M 10.375 13.164062 "
/>
<path
d="M 10.375 16.105469 L 8.863281 16.105469 C 8.472656 16.105469 8.152344 16.425781 8.152344 16.816406 C 8.152344 17.210938 8.472656 17.527344 8.863281 17.527344 L 10.375 17.527344 C 10.769531 17.527344 11.085938 17.210938 11.085938 16.816406 C 11.085938 16.425781 10.769531 16.105469 10.375 16.105469 Z M 10.375 16.105469 "
/>
<path
d="M 10.375 19.046875 L 8.863281 19.046875 C 8.472656 19.046875 8.152344 19.367188 8.152344 19.757812 C 8.152344 20.152344 8.472656 20.46875 8.863281 20.46875 L 10.375 20.46875 C 10.769531 20.46875 11.085938 20.152344 11.085938 19.757812 C 11.085938 19.367188 10.769531 19.046875 10.375 19.046875 Z M 10.375 19.046875 "
/>
<path
d="M 15.136719 13.164062 L 13.625 13.164062 C 13.230469 13.164062 12.914062 13.484375 12.914062 13.875 C 12.914062 14.269531 13.230469 14.585938 13.625 14.585938 L 15.136719 14.585938 C 15.527344 14.585938 15.847656 14.269531 15.847656 13.875 C 15.847656 13.484375 15.527344 13.164062 15.136719 13.164062 Z M 15.136719 13.164062 "
/>
<path
d="M 15.136719 16.105469 L 13.625 16.105469 C 13.230469 16.105469 12.914062 16.425781 12.914062 16.816406 C 12.914062 17.210938 13.230469 17.527344 13.625 17.527344 L 15.136719 17.527344 C 15.527344 17.527344 15.847656 17.210938 15.847656 16.816406 C 15.847656 16.425781 15.527344 16.105469 15.136719 16.105469 Z M 15.136719 16.105469 "
/>
<path
d="M 15.136719 19.046875 L 13.625 19.046875 C 13.230469 19.046875 12.914062 19.367188 12.914062 19.757812 C 12.914062 20.152344 13.230469 20.46875 13.625 20.46875 L 15.136719 20.46875 C 15.527344 20.46875 15.847656 20.152344 15.847656 19.757812 C 15.847656 19.367188 15.527344 19.046875 15.136719 19.046875 Z M 15.136719 19.046875 "
/>
<path
d="M 11.246094 6.660156 C 10.929688 6.660156 10.675781 6.914062 10.675781 7.226562 C 10.675781 7.542969 10.929688 7.796875 11.246094 7.796875 L 12.753906 7.796875 C 13.070312 7.796875 13.324219 7.542969 13.324219 7.226562 C 13.324219 6.914062 13.070312 6.660156 12.753906 6.660156 Z M 11.246094 6.660156 "
/>
<path
d="M 10.914062 5.3125 C 11.0625 5.3125 11.207031 5.257812 11.316406 5.148438 L 12.027344 4.4375 L 12.683594 5.089844 C 12.902344 5.3125 13.265625 5.3125 13.488281 5.089844 C 13.710938 4.867188 13.710938 4.507812 13.488281 4.285156 L 12.496094 3.296875 C 12.238281 3.039062 11.816406 3.039062 11.558594 3.296875 L 10.511719 4.34375 C 10.289062 4.5625 10.289062 4.925781 10.511719 5.148438 C 10.625 5.257812 10.769531 5.3125 10.914062 5.3125 Z M 10.914062 5.3125 "
/>
<path
d="M 13.488281 9.308594 C 13.265625 9.085938 12.902344 9.085938 12.683594 9.308594 L 11.972656 10.019531 L 11.316406 9.363281 C 11.097656 9.140625 10.734375 9.140625 10.511719 9.363281 C 10.292969 9.585938 10.292969 9.945312 10.511719 10.167969 L 11.503906 11.160156 C 11.632812 11.289062 11.800781 11.351562 11.972656 11.351562 C 12.140625 11.351562 12.3125 11.289062 12.441406 11.160156 L 13.488281 10.113281 C 13.710938 9.890625 13.710938 9.53125 13.488281 9.308594 Z M 13.488281 9.308594 "
/>
<path
d="M 14.886719 5.742188 C 14.664062 5.519531 14.304688 5.519531 14.082031 5.742188 C 13.859375 5.960938 13.859375 6.324219 14.082031 6.546875 L 14.792969 7.253906 L 14.136719 7.910156 C 13.914062 8.132812 13.914062 8.492188 14.136719 8.714844 C 14.25 8.824219 14.394531 8.882812 14.539062 8.882812 C 14.683594 8.882812 14.832031 8.824219 14.941406 8.714844 L 15.929688 7.726562 C 16.191406 7.464844 16.191406 7.046875 15.929688 6.785156 Z M 14.886719 5.742188 "
/>
<path
d="M 9.515625 8.882812 C 9.664062 8.882812 9.808594 8.824219 9.917969 8.714844 C 10.140625 8.492188 10.140625 8.132812 9.917969 7.910156 L 9.207031 7.199219 L 9.863281 6.546875 C 10.085938 6.324219 10.085938 5.964844 9.863281 5.742188 C 9.640625 5.519531 9.28125 5.519531 9.058594 5.742188 L 8.070312 6.730469 C 7.808594 6.988281 7.808594 7.410156 8.070312 7.667969 L 9.113281 8.714844 C 9.226562 8.824219 9.371094 8.882812 9.515625 8.882812 Z M 9.515625 8.882812 "
/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

@@ -0,0 +1,18 @@
<svg
name="arrow-back"
class="ret-icon arrow-back remote-arrow-back"
width="14px"
height="14px"
viewBox="0 0 17 14"
><g
><g fill="#FFF" transform="translate(-183 -616)"
><g transform="translate(111 553)"
><g transform="translate(15 49)"
><path
d="M72.115 19.39l.025.006H61.433l3.366-3.374a.876.876 0 00.255-.622.874.874 0 00-.255-.62l-.524-.524a.868.868 0 00-.618-.256.868.868 0 00-.618.255l-5.77 5.77a.867.867 0 00-.255.619c0 .235.09.456.255.62l5.77 5.77a.868.868 0 00.618.255c.234 0 .454-.09.618-.255l.524-.524a.867.867 0 00.255-.618.84.84 0 00-.255-.606l-3.404-3.392h10.732a.907.907 0 00.887-.898v-.74c0-.483-.417-.866-.9-.866z"
/></g
></g
></g
></g
>
</svg>

After

Width:  |  Height:  |  Size: 744 B

@@ -0,0 +1,12 @@
<svg
name="arrow_down"
class="ret-icon arrow_down remote-arrow-down"
width="14px"
height="14px"
viewBox="0 0 18 12"
><polygon
fill="#FFF"
transform="translate(-68.000000, -1097.000000) translate(68.000000, 1097.000000) translate(9.000000, 5.928571) rotate(90.000000) translate(-9.000000, -5.928571) "
points="5.58223573 -3.07142857 3.5 -0.969991371 10.3355285 5.92857143 3.5 12.8252596 5.58223573 14.9285714 14.5 5.92857143"
/></svg
>

After

Width:  |  Height:  |  Size: 461 B

@@ -0,0 +1,12 @@
<svg
name="arrow_left"
class="ret-icon arrow_left remote-arrow-down"
width="14px"
height="14px"
viewBox="0 0 13 18"
><polygon
fill="#FFF"
transform="translate(-426.000000, -1322.000000) translate(427.000000, 1322.000000) translate(5.500000, 9.000000) scale(-1, 1) translate(-5.500000, -9.000000) "
points="2.08223573 0 0 2.1014372 6.83552854 9 0 15.8966882 2.08223573 18 11 9"
/></svg
>

After

Width:  |  Height:  |  Size: 413 B

@@ -0,0 +1,12 @@
<svg
name="arrow_right"
class="ret-icon arrow_right remote-arrow-down"
width="14px"
height="14px"
viewBox="0 0 13 18"
><polygon
fill="#FFF"
points="2.08223573 0 0 2.1014372 6.83552854 9 0 15.8966882 2.08223573 18 11 9"
transform="translate(-360.000000, -809.000000) translate(361.000000, 809.000000)"
/></svg
>

After

Width:  |  Height:  |  Size: 337 B

@@ -0,0 +1,12 @@
<svg
name="arrow_up"
class="ret-icon arrow_up remote-arrow-down"
width="14px"
height="14px"
viewBox="0 0 18 12"
><polygon
fill="#FFF"
transform="translate(-423.000000, -1139.000000) translate(423.000000, 1139.000000) translate(9.000000, 6.071429) scale(1, -1) rotate(90.000000) translate(-9.000000, -6.071429) "
points="5.58223573 -2.92857143 3.5 -0.827134228 10.3355285 6.07142857 3.5 12.9681168 5.58223573 15.0714286 14.5 6.07142857"
/></svg
>

After

Width:  |  Height:  |  Size: 472 B

@@ -0,0 +1,16 @@
<svg name="fast-forward-left" width="14px" height="14px" viewBox="0 0 21 15"
><g
><g fill="#FFF" transform="translate(-158 -886)"
><g transform="translate(111 553)"
><g transform="translate(15 49)"
><g transform="translate(0 270)"
><path
d="M51.919 20.73l-9.474-6.666a.35.35 0 00-.552.287v6.237l-9.272-6.52a.352.352 0 00-.553.287V27.68a.351.351 0 00.553.287l9.272-6.52v6.237a.351.351 0 00.552.287l9.474-6.667a.35.35 0 000-.573z"
transform="matrix(-1 0 0 1 84.136 0)"
/></g
></g
></g
></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 614 B

@@ -0,0 +1,15 @@
<svg name="fast-forward-right" width="14px" height="14px" viewBox="0 0 21 15"
><g
><g fill="#FFF" transform="translate(-344 -886)"
><g transform="translate(111 553)"
><g transform="translate(15 49)"
><g transform="translate(185.1 270)"
><path
d="M53.449 20.73l-9.474-6.666a.35.35 0 00-.553.287v6.237l-9.272-6.52a.352.352 0 00-.552.287V27.68a.351.351 0 00.552.287l9.272-6.52v6.237a.351.351 0 00.553.287l9.474-6.667a.35.35 0 000-.573z"
/></g
></g
></g
></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 567 B

@@ -0,0 +1,20 @@
<svg
name="home"
class="ret-icon home remote-home"
width="14px"
height="14px"
viewBox="0 0 16 14"
><g
><g fill="#FFF" transform="translate(-323 -615)"
><g transform="translate(111 553)"
><g transform="translate(15 49)"
><g transform="translate(139.972)"
><path
d="M59.0141643 27L64.013762 27 64.013762 23 66.0141643 23 66.0141643 27 71.0143655 27 71.0143655 21 73.0141643 21 65.0143655 13 57.0141643 21 59.0141643 21z"
/></g
></g
></g
></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 562 B

@@ -0,0 +1,15 @@
<svg name="repeat" width="15px" height="15px" viewBox="0 0 16 17" version="1.1">
<g transform="matrix(-1,0,0,1,16.794,0)">
<g fill="#FFF" transform="translate(-183,-830)" id="g10">
<g transform="translate(111,553)" id="g8">
<g transform="translate(15,49)" id="g6">
<g transform="translate(0,216)" id="g4">
<path
d="m 57.887742,20.527863 c -0.01443,-4.135974 3.340802,-7.511707 7.475774,-7.52614 4.134976,-0.01444 7.513698,3.337791 7.528138,7.473764 10e-4,0.274999 -0.01404,0.552055 -0.04411,0.828162 l 1.211993,-0.0042 c 0.156,-4.77e-4 0.298335,0.09496 0.358829,0.236747 a 0.393,0.393 0 0 1 -0.08553,0.423301 l -2.653708,2.667279 a 0.385,0.385 0 0 1 -0.545994,0.0019 L 68.45488,21.98201 a 0.392,0.392 0 0 1 -0.08548,-0.424706 0.392,0.392 0 0 1 0.356171,-0.239241 l 1.34499,-0.0047 a 4.757,4.757 0 0 0 -4.69745,-5.563635 4.759,4.759 0 0 0 -4.735383,4.768557 c 0.0091,2.619984 2.150567,4.742521 4.768552,4.733384 0.212996,-6.83e-4 0.387608,0.172645 0.388357,0.387644 l 0.0069,1.972989 c 7.66e-4,0.213998 -0.172644,0.388607 -0.385644,0.38935 -4.134973,0.01444 -7.513706,-3.340793 -7.528134,-7.473769 z"
/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1 @@
<span class="font-semibold text-sm select-none">OK</span>
@@ -0,0 +1,15 @@
<svg name="asterisc" width="14px" height="14px" viewBox="0 0 16 17"
><g
><g fill="#FFF" transform="translate(-323 -830)"
><g transform="translate(111 553)"
><g transform="translate(15 49)"
><g transform="translate(139.972 216)"
><path
d="M72.132 17.016c0 .738-.864 1.46-2.59 2.166-1.743.707-2.63 1.123-2.661 1.248-.032.173.8.55 2.496 1.13 1.68.597 2.52 1.327 2.52 2.19 0 .22-.048.448-.142.683-.267.707-.683 1.06-1.248 1.06-.33 0-.726-.134-1.19-.4-.462-.267-1.016-.66-1.66-1.178-1.145-.957-1.789-1.381-1.93-1.271-.063.047-.094.164-.094.353 0 .157.07.69.211 1.601.142.926.212 1.64.212 2.143 0 1.444-.51 2.19-1.53 2.237-1.1.016-1.649-.714-1.649-2.19 0-.251.02-.557.06-.918.039-.361.097-.77.176-1.225.173-.957.259-1.523.259-1.695 0-.22-.055-.37-.165-.448-.173-.125-.761.306-1.766 1.295-1.115 1.1-2.033 1.649-2.755 1.649-.361 0-.707-.118-1.036-.353-.346-.267-.518-.55-.518-.848 0-.644.832-1.42 2.496-2.331 1.648-.91 2.457-1.452 2.425-1.625-.015-.283-.824-.683-2.425-1.201s-2.402-1.209-2.402-2.072c0-.267.086-.589.259-.966.204-.518.542-.777 1.013-.777.627 0 1.593.55 2.896 1.649 1.224 1.004 1.915 1.452 2.072 1.342a.67.67 0 00.094-.377c0-.204-.11-.816-.33-1.837a33.535 33.535 0 01-.223-1.318 6.849 6.849 0 01-.082-.966c0-1.177.502-1.766 1.507-1.766.957 0 1.436.644 1.436 1.93 0 .44-.07 1.092-.212 1.955-.141.848-.212 1.413-.212 1.696 0 .392.094.62.283.683.188.063.855-.408 2.001-1.413 1.146-1.02 2.057-1.53 2.732-1.53.408 0 .793.18 1.154.54.345.346.518.73.518 1.155z"
/></g
></g
></g
></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,15 @@
<svg name="play" width="14px" height="14px" viewBox="0 0 11 14"
><g
><g fill="#FFF" transform="translate(-258 -886)"
><g transform="translate(111 553)"
><g transform="translate(15 49)"
><g transform="translate(92.55 270)"
><path
d="M50.278 20.725L40.61 14.06a.335.335 0 00-.523.274v13.334a.334.334 0 00.523.274l9.667-6.667a.333.333 0 000-.549z"
/></g
></g
></g
></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 478 B

@@ -0,0 +1,13 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="22"
height="22"
fill="currentColor"
class="bi bi-power"
viewBox="0 0 16 16"
>
<path d="M7.5 1v7h1V1h-1z" />
<path
d="M3 8.812a4.999 4.999 0 0 1 2.578-4.375l-.485-.874A6 6 0 1 0 11 3.616l-.501.865A5 5 0 1 1 3 8.812z"
/>
</svg>

After

Width:  |  Height:  |  Size: 295 B

@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="22"
height="22"
fill="currentColor"
class="bi bi-volume-down-fill"
viewBox="0 0 16 16"
>
<path
d="M9 4a.5.5 0 0 0-.812-.39L5.825 5.5H3.5A.5.5 0 0 0 3 6v4a.5.5 0 0 0 .5.5h2.325l2.363 1.89A.5.5 0 0 0 9 12V4zm3.025 4a4.486 4.486 0 0 1-1.318 3.182L10 10.475A3.489 3.489 0 0 0 11.025 8 3.49 3.49 0 0 0 10 5.525l.707-.707A4.486 4.486 0 0 1 12.025 8z"
/>
</svg>

After

Width:  |  Height:  |  Size: 422 B

@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="22"
height="22"
fill="currentColor"
class="bi bi-volume-mute-fill"
viewBox="0 0 16 16"
>
<path
d="M6.717 3.55A.5.5 0 0 1 7 4v8a.5.5 0 0 1-.812.39L3.825 10.5H1.5A.5.5 0 0 1 1 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06zm7.137 2.096a.5.5 0 0 1 0 .708L12.207 8l1.647 1.646a.5.5 0 0 1-.708.708L11.5 8.707l-1.646 1.647a.5.5 0 0 1-.708-.708L10.793 8 9.146 6.354a.5.5 0 1 1 .708-.708L11.5 7.293l1.646-1.647a.5.5 0 0 1 .708 0z"
/>
</svg>

After

Width:  |  Height:  |  Size: 512 B

@@ -0,0 +1,18 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="22"
height="22"
fill="currentColor"
class="bi bi-volume-up-fill"
viewBox="0 0 16 16"
>
<path
d="M11.536 14.01A8.473 8.473 0 0 0 14.026 8a8.473 8.473 0 0 0-2.49-6.01l-.708.707A7.476 7.476 0 0 1 13.025 8c0 2.071-.84 3.946-2.197 5.303l.708.707z"
/>
<path
d="M10.121 12.596A6.48 6.48 0 0 0 12.025 8a6.48 6.48 0 0 0-1.904-4.596l-.707.707A5.483 5.483 0 0 1 11.025 8a5.483 5.483 0 0 1-1.61 3.89l.706.706z"
/>
<path
d="M8.707 11.182A4.486 4.486 0 0 0 10.025 8a4.486 4.486 0 0 0-1.318-3.182L8 5.525A3.489 3.489 0 0 1 9.025 8 3.49 3.49 0 0 1 8 10.475l.707.707zM6.717 3.55A.5.5 0 0 1 7 4v8a.5.5 0 0 1-.812.39L3.825 10.5H1.5A.5.5 0 0 1 1 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06z"
/>
</svg>

After

Width:  |  Height:  |  Size: 780 B

@@ -0,0 +1,33 @@
import { getIp } from "./Host";
export class ExternalControlProtocol {
static async launchApp(appId) {
console.log("Launching app", appId)
return fetch(`http://${getIp()}:8060/launch/${appId}`, {
method: 'POST',
body: '',
})
}
static async pressKey(key) {
return fetch(`http://${getIp()}:8060/keypress/${key}`, {
method: 'POST',
body: '',
})
}
static async pressKeyUp(key) {
console.log("Pressing key up", key)
return fetch(`http://${getIp()}:8060/keyup/${key}`, {
method: 'POST',
body: '',
})
}
static async pressKeyDown(key) {
console.log("Pressing key down", key)
return fetch(`http://${getIp()}:8060/keydown/${key}`, {
method: 'POST',
body: '',
})
}
}
+6 -1
View File
@@ -3,4 +3,9 @@ function getHost() {
return urlSearchParams.get('host') ?? window.location.host
}
export { getHost }
function getIp() {
const host = getHost()
return host.split(':')[0]
}
export { getHost, getIp }
@@ -4,6 +4,7 @@
import SearchIcon from "../assets/search-icon.svg.svelte";
import SettingsIcon from "../assets/settings-icon.svg.svelte";
import BookmarksIcon from "../assets/star-icon.svg.svelte";
import RemoteIcon from "../assets/remote-control.svg.svelte";
import { appStateStore } from "lib/Stores";
import type { AppState } from "lib/Types";
@@ -55,6 +56,14 @@
<SettingsIcon />
</div>
</button>
<button
on:click={() => setScreen("remote")}
class={$appStateStore.screen === "remote" ? "active" : ""}
>
<div class="h-6">
<RemoteIcon />
</div>
</button>
<button
on:click={() => setScreen("info")}
class={$appStateStore.screen === "info" ? "active" : ""}
+13 -6
View File
@@ -3,6 +3,7 @@
import playletLogoLight from "assets/logo-light.svg";
import UserIcon from "assets/user.svg.svelte";
import { PlayletApi } from "lib/Api/PlayletApi";
import { ExternalControlProtocol } from "lib/Api/ExternalControlProtocol";
import { appThemeStore, playletStateStore } from "lib/Stores";
import ThemeSelect from "lib/ThemeToggle.svelte";
@@ -12,10 +13,14 @@
let currentInstance;
let loggedInInstance;
let username;
let appId = "693751";
playletStateStore.subscribe((value) => {
version = value?.app?.lib_version ?? "";
if (value?.app?.id === "dev") {
if (value?.app?.id) {
appId = value?.app?.id;
}
if (appId === "dev") {
version += "-dev";
}
if (
@@ -49,11 +54,13 @@
<div class="navbar bg-base-100 sticky top-0 z-40">
<div class="flex-1">
<img
src={$appThemeStore === "dark" ? playletLogoDark : playletLogoLight}
class="h-8"
alt="Playlet Logo"
/>
<button on:click={() => ExternalControlProtocol.launchApp(appId)}>
<img
src={$appThemeStore === "dark" ? playletLogoDark : playletLogoLight}
class="h-8"
alt="Playlet Logo"
/>
</button>
<h4 class="label brightness-75">{version}</h4>
</div>
<div class="flex-none">
@@ -0,0 +1,62 @@
<script lang="ts">
import { ExternalControlProtocol } from "lib/Api/ExternalControlProtocol";
import { onDestroy, onMount } from "svelte";
export let key: string;
export let icon;
export let small: boolean = false;
let button;
onMount(() => {
const isTouchDevice = "ontouchstart" in document.documentElement;
if (isTouchDevice) {
button.addEventListener("touchstart", pressKeyDown);
button.addEventListener("touchend", pressKeyUp);
button.addEventListener("touchcancel", onMouseLeave);
} else {
button.addEventListener("mousedown", pressKeyDown);
button.addEventListener("mouseup", pressKeyUp);
button.addEventListener("mouseleave", onMouseLeave);
}
});
onDestroy(() => {
const isTouchDevice = "ontouchstart" in document.documentElement;
if (isTouchDevice) {
button.removeEventListener("touchstart", pressKeyDown);
button.removeEventListener("touchend", pressKeyUp);
button.removeEventListener("touchcancel", onMouseLeave);
} else {
button.removeEventListener("mousedown", pressKeyDown);
button.removeEventListener("mouseup", pressKeyUp);
button.removeEventListener("mouseleave", onMouseLeave);
}
});
let isDown = false;
function pressKeyDown() {
isDown = true;
ExternalControlProtocol.pressKeyDown(key);
}
function pressKeyUp() {
isDown = false;
ExternalControlProtocol.pressKeyUp(key);
}
function onMouseLeave() {
if (isDown) {
pressKeyUp();
}
}
</script>
<button
bind:this={button}
class="{small
? 'w-16'
: 'w-24'} h-11 btn-primary rounded-full flex items-center justify-center"
>
<svelte:component this={icon} />
</button>
@@ -0,0 +1,151 @@
<script lang="ts">
import { ExternalControlProtocol } from "lib/Api/ExternalControlProtocol";
import HomeIcon from "assets/remote-control/home.svg.svelte";
import ArrowBackIcon from "assets/remote-control/arrow-back.svg.svelte";
import ArrowUpIcon from "assets/remote-control/arrow-up.svg.svelte";
import ArrowDownIcon from "assets/remote-control/arrow-down.svg.svelte";
import ArrowLeftIcon from "assets/remote-control/arrow-left.svg.svelte";
import ArrowRightIcon from "assets/remote-control/arrow-right.svg.svelte";
import OkIcon from "assets/remote-control/ok.svelte";
import InstantReplayIcon from "assets/remote-control/instant-replay.svg.svelte";
import OptionsIcon from "assets/remote-control/options.svg.svelte";
import FastForwardIcon from "assets/remote-control/fast-forward.svg.svelte";
import FastBackwardIcon from "assets/remote-control/fast-backward.svg.svelte";
import PlayIcon from "assets/remote-control/play.svg.svelte";
import VolumeDownIcon from "assets/remote-control/volume-down.svg.svelte";
import VolumeMuteIcon from "assets/remote-control/volume-mute.svg.svelte";
import VolumeUpIcon from "assets/remote-control/volume-up.svg.svelte";
import PowerIcon from "assets/remote-control/power.svg.svelte";
import RemoteButton from "./RemoteControl/RemoteButton.svelte";
import { onDestroy, onMount } from "svelte";
export let visibility: boolean;
let screen;
const BUTTONS = {
home: "Home",
rev: "Rev",
fwd: "Fwd",
play: "Play",
select: "Select",
left: "Left",
right: "Right",
down: "Down",
up: "Up",
back: "Back",
instantReplay: "InstantReplay",
info: "Info",
backspace: "Backspace",
search: "Search",
enter: "Enter",
volumeDown: "VolumeDown",
volumeMute: "VolumeMute",
volumeUp: "VolumeUp",
powerOff: "PowerOff",
};
const KEYBOARD_BUTTONS = {
ArrowRight: BUTTONS.right,
ArrowLeft: BUTTONS.left,
ArrowUp: BUTTONS.up,
ArrowDown: BUTTONS.down,
Enter: BUTTONS.select,
Backspace: BUTTONS.backspace,
Escape: BUTTONS.back,
"*": BUTTONS.info,
};
onMount(() => {
screen.addEventListener("keydown", onKeyDown);
screen.addEventListener("keyup", onKeyUp);
// TODO:P1 support navigator.mediaSession
// media buttons, such as play/pause, next, and previous track.
// metadata, like title, artist, album, artwork
});
onDestroy(() => {
screen.removeEventListener("keydown", onKeyDown);
screen.removeEventListener("keyup", onKeyUp);
});
function onKeyDown(event) {
if (!visibility) {
return;
}
event.preventDefault();
if (event.repeat) {
return;
}
if (event.key in KEYBOARD_BUTTONS) {
ExternalControlProtocol.pressKeyDown(KEYBOARD_BUTTONS[event.key]);
} else {
ExternalControlProtocol.pressKeyDown(
"Lit_" + encodeURIComponent(event.key)
);
}
}
function onKeyUp(event) {
if (!visibility) {
return;
}
event.preventDefault();
if (event.repeat) {
return;
}
if (event.key in KEYBOARD_BUTTONS) {
ExternalControlProtocol.pressKeyUp(KEYBOARD_BUTTONS[event.key]);
} else {
ExternalControlProtocol.pressKeyUp(
"Lit_" + encodeURIComponent(event.key)
);
}
}
</script>
<div bind:this={screen} tabindex="-1" class={visibility ? "" : "hidden"}>
<div class="flex flex-col items-center justify-center p-6">
<div class="flex space-x-2 m-2">
<button
on:click={() => {
ExternalControlProtocol.pressKey(BUTTONS.powerOff);
}}
class="btn-primary rounded-full flex items-center justify-center bg-red-600 hover:bg-red-400 w-12 h-12 text-white"
>
<PowerIcon />
</button>
</div>
<div class="flex space-x-2 m-2">
<RemoteButton key={BUTTONS.back} icon={ArrowBackIcon} />
<RemoteButton key={BUTTONS.home} icon={HomeIcon} />
</div>
<div class="flex space-x-2 m-2">
<RemoteButton key={BUTTONS.up} icon={ArrowUpIcon} small />
</div>
<div class="flex space-x-2 m-2">
<RemoteButton key={BUTTONS.left} icon={ArrowLeftIcon} small />
<RemoteButton key={BUTTONS.select} icon={OkIcon} small />
<RemoteButton key={BUTTONS.right} icon={ArrowRightIcon} small />
</div>
<div class="flex space-x-2 m-2">
<RemoteButton key={BUTTONS.down} icon={ArrowDownIcon} small />
</div>
<div class="flex space-x-2 m-2">
<RemoteButton key={BUTTONS.instantReplay} icon={InstantReplayIcon} />
<RemoteButton key={BUTTONS.info} icon={OptionsIcon} />
</div>
<div class="flex space-x-2 m-2">
<RemoteButton key={BUTTONS.rev} icon={FastBackwardIcon} small />
<RemoteButton key={BUTTONS.play} icon={PlayIcon} small />
<RemoteButton key={BUTTONS.fwd} icon={FastForwardIcon} small />
</div>
<div class="flex space-x-2 m-2">
<RemoteButton key={BUTTONS.volumeMute} icon={VolumeMuteIcon} small />
<RemoteButton key={BUTTONS.volumeDown} icon={VolumeDownIcon} small />
<RemoteButton key={BUTTONS.volumeUp} icon={VolumeUpIcon} small />
</div>
</div>
</div>
+1 -1
View File
@@ -1,5 +1,5 @@
export type AppState = {
screen: "search" | "home" | "bookmarks" | "settings" | "info"
screen: "search" | "home" | "bookmarks" | "settings" | "info" | "remote"
}
export type PlayletState = {