-
Notifications
You must be signed in to change notification settings - Fork 104
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
TF feedback: volume buttons like in YATSE #441
Comments
@kambala-decapitator, am I understanding correctly that iOS does not allow or at least Apple does not want Apps to take control of the hardware keys? In this case we cannot implement this request and #24. For a solution via a widget we have two other issues created. |
I don't think there's a dedicated public API, but you could try something like https://stackoverflow.com/questions/40231220/get-notification-on-volume-button-press-event-in-ios or even subclass |
Thanks. As a first attempt to play around with this I added the relevant code to the volume handling controller of the App. Can you point me to why |
The code seems fine, maybe this approach no longer works. Just in case make sure that audio session succeeds in becoming active. |
No, doesn't seem so. I used a method which is called once per second and called:
If I change the volume, I can read proper values (0.0 -> 1.0). Now I only call above sequence once and then repeated each second:
The values keep the same as for the first call. |
strange, audio session activation needs to be done only once afaik (unless you deactivate it later). please also try this:
|
Nope, cannot get this working. |
just tested the following code on a few different devices - all works: __auto_type audioSession = [AVAudioSession sharedInstance];
[audioSession setActive:YES error:NULL];
[audioSession addObserver:self forKeyPath:NSStringFromSelector(@selector(outputVolume)) options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:NULL];
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
// the `change` dictionary contains correct values for old and new (current) volume level
} |
Can you share the complete change in a commit? And this works in simulator (setting a break point in |
I tested this code in a test project (placed in |
VOLUME BUTTONS SHOULD CONTROL KODI LIKE YATSE DOES ON ANDROID!!!!!!!!
The text was updated successfully, but these errors were encountered: