Skip to content

android: do not restore last playing when opened from link - #248

Open
gabparrot wants to merge 1 commit into
nonbili:mainfrom
gabparrot:fix-deep-link-override
Open

android: do not restore last playing when opened from link#248
gabparrot wants to merge 1 commit into
nonbili:mainfrom
gabparrot:fix-deep-link-override

Conversation

@gabparrot

Copy link
Copy Markdown

Cold start from a YouTube link in another app always resumed the last-played video instead of opening the linked video, even with "Restore last playing on start" enabled (#158). The same root cause — incoming intent URLs being dropped on cold start — is also why deep links were ignored entirely (#188).

Linking.getInitialURL() was never called in app/index.tsx, so the Android intent URL was dropped on cold start. The first webview onload then unconditionally triggered window.NouTube.restoreLastPlaying() because the only guard was the user setting.

Call Linking.getInitialURL() on mount and route through the existing openSharedUrl path. When a deep link resolves before onload, the existing ui$.url observer in MainPageContent.tsx already flips the restored flag so restoreLastPlaying is skipped — no extra guard needed.

Warm-start Linking events, share-intent path, and the user-facing setting are unchanged.

Closes #158
Closes #188

@rnons

rnons commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

have you tested opening a second deep link, in my test, noutube was stuck with the 1st deep link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: support deep links External link video resumes on next app launch

2 participants