Skip to content

Commit

Permalink
Merge pull request #5 from webosbrew/deeplinking
Browse files Browse the repository at this point in the history
appinfo: add deeplinking/voicesearch options
  • Loading branch information
Informatic authored Dec 20, 2021
2 parents 6b31458 + 42f7a65 commit b49de4e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 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

## Version 0.0.1
* Created basic web app which launches YouTube TV.

Expand Down
9 changes: 8 additions & 1 deletion assets/appinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@
"userAgent": "$browserName$/$browserVersion$ ($platformName$-$platformVersion$), _TV_$chipSetName$/$firmwareVersion$ (LG, $modelName$, $networkMode$)",
"allowCrossDomain": true
},
"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,
"trustLevel": "netcast",
"privilegedJail": true,
"supportQuickStart": true,
"dialAppName": "YouTube",
"disableBackHistoryAPI": true
"disableBackHistoryAPI": true,
"supportGIP": true
}
13 changes: 10 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,25 @@ 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.
//
let { target, contentTarget = target } = params;


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;
} 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#/';
}
}

0 comments on commit b49de4e

Please sign in to comment.