-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long-click on stream segment to share timestamped url #9203
Merged
Stypox
merged 2 commits into
TeamNewPipe:dev
from
Callisto404:add-chapter-timestamp-share
Oct 30, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work for services other than YouTube. You should use the same logic as in the player:
NewPipe/app/src/main/java/org/schabi/newpipe/player/Player.java
Line 1782 in 4a7af6f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey sorry for clarification, do you mean that I should be surrounding line 714 with an if statement checking that the service ID is indeed YouTube? I did look at this part in the player but thought it might not be necessary since I thought that these click handlers on the segments would only ever be called from a YouTube service. Sorry if I am misunderstanding and thanks for the quick replies!
And yes I am an ANU student :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably true, but who knows if a future service will support segments ;-)
Yes, sorround it with a "is youtube" check. If it's not YouTube, don't allow long-pressing the item at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I have been attempting to add this check to the
buildSegements
function withsetLongClickable(false)
, however even withsetOnLongClickListener(null)
, the long click event still occurs. Similarly, the existingonClick
method used for seeking to different chapters does not get disabled by setting clickable to false. I have also tried adding the check to the beginning of the long click call, however since the call consumes the click event, this is not the desired result.Is there some better way of doing this that I am unaware of? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then it's fine if you just don't do anything when a long-press is detected but the url is non-youtube