-
-
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
Long-click on stream segment to share timestamped url #9203
Conversation
…k for each chapter
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.
Thanks for the PR, looks almost good
Are you an ANU student with the strict deadline on the 31st of October?
String videoUrl = player.getVideoUrl(); | ||
videoUrl += ("&t=" + seconds); | ||
ShareUtils.shareText(context, currentItem.getTitle(), | ||
videoUrl, currentItem.getThumbnailUrl()); |
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:
final long timeSeconds = simpleExoPlayer.getCurrentPosition() / 1000; |
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.
I thought that these click handlers on the segments would only ever be called from a YouTube service
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 with setLongClickable(false)
, however even with setOnLongClickListener(null)
, the long click event still occurs. Similarly, the existing onClick
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.
don't allow long-pressing the item at all.
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
Kudos, SonarCloud Quality Gate passed! |
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.
I tested and it works well. Thank you and good luck with the exams! ;-)
What is it?
Description of the changes in your PR
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence