android: do not restore last playing when opened from link - #248
Open
gabparrot wants to merge 1 commit into
Open
android: do not restore last playing when opened from link#248gabparrot wants to merge 1 commit into
gabparrot wants to merge 1 commit into
Conversation
Contributor
|
have you tested opening a second deep link, in my test, noutube was stuck with the 1st deep link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inapp/index.tsx, so the Android intent URL was dropped on cold start. The first webviewonloadthen unconditionally triggeredwindow.NouTube.restoreLastPlaying()because the only guard was the user setting.Call
Linking.getInitialURL()on mount and route through the existingopenSharedUrlpath. When a deep link resolves beforeonload, the existingui$.urlobserver inMainPageContent.tsxalready flips therestoredflag sorestoreLastPlayingis skipped — no extra guard needed.Warm-start Linking events, share-intent path, and the user-facing setting are unchanged.
Closes #158
Closes #188