From 15e7d9dd15431baa68ebacec70b85f743d15dd6b Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Mon, 13 Dec 2021 19:09:54 +0100 Subject: [PATCH 1/6] appinfo: add deeplinking/voicesearch options --- assets/appinfo.json | 6 ++++++ src/utils.js | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/assets/appinfo.json b/assets/appinfo.json index b3b72fa3..69e94d63 100644 --- a/assets/appinfo.json +++ b/assets/appinfo.json @@ -16,6 +16,12 @@ "userAgent": "$browserName$/$browserVersion$ ($platformName$-$platformVersion$), _TV_$chipSetName$/$firmwareVersion$ (LG, $modelName$, $networkMode$)", "allowCrossDomain": true }, + "deeplinkingParams": "{\"target\":\"v=$CONTENTID\"}", + "inAppSearchParams": "{\"target\":\"q=$SEARCH_KEYWORD\"}", + "inAppVoiceIntent": "{\"target\":{\"intent\":\"$INTENT\",\"intentParam\":\"$INTENT_PARAM\",\"languageCode\":\"$LANG_CODE\"}}", + "supportQueryRouting": "{\"amazonAlexa\":true,\"googleAssistant\":true}", + "resolution": "1920x1080", + "enablePigScreenSaver": false, "trustLevel": "netcast", "privilegedJail": true, "supportQuickStart": true, diff --git a/src/utils.js b/src/utils.js index c8f0875f..46a4216d 100644 --- a/src/utils.js +++ b/src/utils.js @@ -7,7 +7,11 @@ export function extractLaunchParams() { } export function handleLaunch(params) { - const { contentTarget } = params; + // We use our custom "target" param, since launches with "contentTarget" + // parameter do not respect "handlesRelaunch" appinfo option. We still + // fallback to "contentTarget" if our custom param is not specified. + // + const { target, contentTarget = target } = params; if (contentTarget && typeof contentTarget === 'string') { if (contentTarget.indexOf('https://www.youtube.com/tv?') === 0) { @@ -15,10 +19,10 @@ export function handleLaunch(params) { window.location = contentTarget; } else { console.info('Launching from partial contentTarget:', contentTarget); - window.location = 'https://www.youtube.com/tv#?' + contentTarget; + window.location = 'https://www.youtube.com/tv#/?' + contentTarget; } } else { console.info('Default launch'); - window.location = 'https://www.youtube.com/tv'; + window.location = 'https://www.youtube.com/tv#/'; } } From ae2ef6ce891f14d4ef0633d786196025588e1dc2 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Tue, 14 Dec 2021 15:43:25 +0100 Subject: [PATCH 2/6] utils: handle double v= --- CHANGELOG.md | 6 ++++++ src/utils.js | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 955dcb69..782150c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # ChangeLog +## Unreleased +* Fixed deeplinking from voice search results +* Fixed in-app voice search button on webOS 5.x +* Fixed screensaver kicking in on sponsor segment skips +* Improved startup time when relaunching an application + ## Version 0.0.1 * Created basic web app which launches YouTube TV. diff --git a/src/utils.js b/src/utils.js index 46a4216d..f52ede59 100644 --- a/src/utils.js +++ b/src/utils.js @@ -11,7 +11,9 @@ export function handleLaunch(params) { // parameter do not respect "handlesRelaunch" appinfo option. We still // fallback to "contentTarget" if our custom param is not specified. // - const { target, contentTarget = target } = params; + let { target, contentTarget = target } = params; + + if (contentTarget.indexOf('v=v=') != -1) contentTarget = contentTarget.replace('v=v=', 'v='); if (contentTarget && typeof contentTarget === 'string') { if (contentTarget.indexOf('https://www.youtube.com/tv?') === 0) { From ce05f48178cac7890c1e69c29aa05a62e7a25baf Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Tue, 14 Dec 2021 15:48:08 +0100 Subject: [PATCH 3/6] appinfo: use contentTarget again... --- CHANGELOG.md | 1 - assets/appinfo.json | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 782150c7..f786bf24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,6 @@ * Fixed deeplinking from voice search results * Fixed in-app voice search button on webOS 5.x * Fixed screensaver kicking in on sponsor segment skips -* Improved startup time when relaunching an application ## Version 0.0.1 * Created basic web app which launches YouTube TV. diff --git a/assets/appinfo.json b/assets/appinfo.json index 69e94d63..674fc5a2 100644 --- a/assets/appinfo.json +++ b/assets/appinfo.json @@ -16,9 +16,9 @@ "userAgent": "$browserName$/$browserVersion$ ($platformName$-$platformVersion$), _TV_$chipSetName$/$firmwareVersion$ (LG, $modelName$, $networkMode$)", "allowCrossDomain": true }, - "deeplinkingParams": "{\"target\":\"v=$CONTENTID\"}", - "inAppSearchParams": "{\"target\":\"q=$SEARCH_KEYWORD\"}", - "inAppVoiceIntent": "{\"target\":{\"intent\":\"$INTENT\",\"intentParam\":\"$INTENT_PARAM\",\"languageCode\":\"$LANG_CODE\"}}", + "deeplinkingParams": "{\"contentTarget\":\"v=$CONTENTID\"}", + "inAppSearchParams": "{\"contentTarget\":\"q=$SEARCH_KEYWORD\"}", + "inAppVoiceIntent": "{\"contentTarget\":{\"intent\":\"$INTENT\",\"intentParam\":\"$INTENT_PARAM\",\"languageCode\":\"$LANG_CODE\"}}", "supportQueryRouting": "{\"amazonAlexa\":true,\"googleAssistant\":true}", "resolution": "1920x1080", "enablePigScreenSaver": false, From ef3bf2bb8d9a62c86a5d3d249245d4655aa1110a Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Sun, 19 Dec 2021 10:05:34 +0100 Subject: [PATCH 4/6] utils: fix direct launch... --- src/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index f52ede59..f407dfb3 100644 --- a/src/utils.js +++ b/src/utils.js @@ -13,9 +13,10 @@ export function handleLaunch(params) { // let { target, contentTarget = target } = params; - if (contentTarget.indexOf('v=v=') != -1) contentTarget = contentTarget.replace('v=v=', 'v='); if (contentTarget && typeof contentTarget === 'string') { + if (contentTarget.indexOf('v=v=') != -1) contentTarget = contentTarget.replace('v=v=', 'v='); + if (contentTarget.indexOf('https://www.youtube.com/tv?') === 0) { console.info('Launching from direct contentTarget:', contentTarget); window.location = contentTarget; From 471729c977b4a6ecf6ff76398eaccec71c4df7f1 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Sun, 19 Dec 2021 12:57:39 +0100 Subject: [PATCH 5/6] appinfo: add supportGIP With this enabled, anyone willing to have youtube autostart can run: luna-send -n 1 'luna://com.webos.service.eim/addDevice' '{"appId":"youtube.leanback.v4","pigImage":"","mvpdIcon":""}' Sadly we cannot run this from the app itself, since netcast trustLevel disables luna bus access. --- assets/appinfo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/appinfo.json b/assets/appinfo.json index 674fc5a2..92b235df 100644 --- a/assets/appinfo.json +++ b/assets/appinfo.json @@ -26,5 +26,6 @@ "privilegedJail": true, "supportQuickStart": true, "dialAppName": "YouTube", - "disableBackHistoryAPI": true + "disableBackHistoryAPI": true, + "supportGIP": true } From 42f7a65f95d89ced7dd86661d218e282779efe7a Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Sun, 19 Dec 2021 13:00:18 +0100 Subject: [PATCH 6/6] CI: upload artifacts in PRs --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2926fc4d..68df7197 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,3 +32,10 @@ jobs: - run: npm ci - run: npm run build - run: npm run package + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: youtube_adfree_ipk + path: | + ${{github.workspace}}/youtube.leanback.v4_*_all.ipk