Skip to content

Long Volume Button Press for Playback Control#6970

Closed
yashaswigalhotra wants to merge 2 commits intoTeamNewPipe:devfrom
yashaswigalhotra:dev
Closed

Long Volume Button Press for Playback Control#6970
yashaswigalhotra wants to merge 2 commits intoTeamNewPipe:devfrom
yashaswigalhotra:dev

Conversation

@yashaswigalhotra
Copy link
Copy Markdown

@yashaswigalhotra yashaswigalhotra commented Aug 24, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Added a new feature :- Long Volume Button Press for Playback Control

Before/After Screenshots/Screen Record

Before After
This is an image before long press of volume button This is an image after long press of volume button which activates the playback control and plays the next video

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

@Stypox
Copy link
Copy Markdown
Member

Stypox commented Aug 25, 2021

Thank you! :-)
Unfortunately the build fails, and you seem not to have followed the advice from the user in #6874. Also, this feature would have to be enabled only on phones where the android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER permission is active, as not to be in the way of all other users, since it would have to be granted via adb anyway, according to #6874. @yashaswigalhotra @z3r0r4

@opusforlife2
Copy link
Copy Markdown
Collaborator

opusforlife2 commented Aug 27, 2021

I don't understand the need for this feature.

This is normally an OS level feature: when the screen is off, a media app can be told to restart playback or switch to the previous/next track using the volume buttons. This is already the case.

What is the point of Playback Control when the screen is on? You're either in the app, or you have a permanent notification with action buttons available at all times.

Edit: the user in the linked issue seems to be asking for this feature when the screen is off, so I'm assuming only some Custom ROMs or OEM ROMs offer this feature currently. In that case, this should be modified to work only when the screen is off.

@Stypox Stypox added the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Aug 30, 2021
@triallax
Copy link
Copy Markdown
Contributor

triallax commented Sep 3, 2021

@Stypox let's avoid putting waiting-for-author on PRs for now. 14 days is a little too short for them.

@Stypox
Copy link
Copy Markdown
Member

Stypox commented Sep 3, 2021

Oh ok, I see

@triallax triallax removed the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Sep 3, 2021
@z3r0r4
Copy link
Copy Markdown
Contributor

z3r0r4 commented Sep 12, 2021

First of all; I am surprised (and thankful) that someone besides me has shown interest and tried to implement this. I tried and sadly ended up running out of the time I had free.
This however might serve as a good starting point and I'll try to verify and tie up lose ends if possible.

Also, this feature would have to be enabled only on phones where the android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER permission is active, as not to be in the way of all other users, since it would have to be granted via adb anyway, according to #6874. @yashaswigalhotra @z3r0r4

@Stypox Yes this was my initial intention, it should not be a feature that taunts the less tech-savy users but rather one that improves the experience of those that know about it by a lot.

@z3r0r4
Copy link
Copy Markdown
Contributor

z3r0r4 commented Sep 12, 2021

This is normally an OS level feature: ...
Edit: the user in the linked issue seems to be asking for this feature when the screen is off, so I'm assuming only some Custom ROMs or OEM ROMs offer this feature currently. In that case, this should be modified to work only when the screen is off.

Your edit explains my reasons @opusforlife2.
Personally I've only seen this feature implemented in custom ROMs (LineageOs) and am missing it dearly in the Samsung One Ui. Thus at least from my perspective its a feature that's normally missing.
And yes this feature was mostly meant to be useful in situations where touch control is very inconvenient (driving, running, writing...), although admittedly imo its a faster way to control playback when the screen is on as well.

@z3r0r4
Copy link
Copy Markdown
Contributor

z3r0r4 commented Sep 15, 2021

I am not convinced that this code is complete.
Most of the used variables and symbols in the new lines dont seem to resolve and the changes to the onKeyDownListener are incompatible with existing code.
Good starting point, but does not work yet.

@z3r0r4
Copy link
Copy Markdown
Contributor

z3r0r4 commented Sep 17, 2021

I have implemented a mvp of this feature.
See here: https://github.com/z3r0r4/NewPipe/tree/volume-btn-long-press-skip
However this requires Android Hidden Apis (further info here) to compile, because Google hides functionality because of stability reason...
In short this means that the file %Android-SDK-location%/platforms/android-30/android.jar has to be replaced with a custom one (I used this one https://github.com/Reginer/aosp-android-jar/blob/main/android-30/android.jar).
I have unsuccessfully tried to implement a automatic way to use the custom android.jar using gradle or the config files of Android Studio (.idea/). (starting points for future reference: 1 2 3 4 )

Thus this of course is not something that can be implemented into NewPipe in general, if no other way is found.
Only alternative is that someone could fork Newpipe and maintain builds with a custom android.jar.

@litetex litetex marked this pull request as draft October 1, 2021 16:52
@litetex
Copy link
Copy Markdown
Member

litetex commented Oct 1, 2021

No feedback since over a month and also the PR is not compiling.
Converted it to a draft and closing it for now.

Feel free to reopen it again when there is further progress.

@litetex litetex closed this Oct 1, 2021
@opusforlife2 opusforlife2 added the feature request Issue is related to a feature in the app label Oct 2, 2021
@litetex litetex mentioned this pull request Oct 10, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Issue is related to a feature in the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Volume Button Long Press Playback Control.

6 participants