vityevato / beardie

Beardie is a utility that allows you to control various media players with your keyboard.
163 stars 4 forks source link

[App Support] Native Podcast app #19

Closed antipoet closed 2 years ago

antipoet commented 3 years ago

Would it be possible to add the native Apple Podcast app as well?

So grateful to see this app getting support again, thanks!

vityevato commented 3 years ago

Apple Podcasts is not written with applescript support, so it's hard to do full control. I will think...

panosru commented 3 years ago

Hi, may I ask, is the Apple Podcasts app now supported after this commit, because I'm unable to find it in the strategies list?

Thanks!

UPDATE: Sorry, I just saw that the release is on 13th Jun, the code update is in the master branch, are there any plans to deploy a release soon? :D

Thanks again!

vityevato commented 3 years ago

@panosru you may check beta version in releases sections

panosru commented 3 years ago

The play/pause button works for Apple Podcasts but only when the app is focused, is it possible to make it work even when the app isn't focused?

Thanks!

vityevato commented 3 years ago

@panosru "is focused" - what that means actually? In my tests all worked as expected.

panosru commented 3 years ago

"is focused" - what that means actually?

When an application is selected, that state is called "focused" meaning that you are on that application currently. When you select another application, then the previous application is out of focus.

When I have podcasts selected I can use the media buttons of my keyboard fine, but once I select another application or minimise apple podcasts, the media buttons aren't working anymore, they only work while in focus.

vityevato commented 3 years ago

Very strange behaviour, i can't repeat this issue. I need more info... OS version, Podcasts app version, Beardie app version...

Is the Podcasts app in list, like on this picture? image

panosru commented 3 years ago

image image image image

I did a bit more testing and I can now see that the issue occurs when I switch space. For example, I have podcasts running in the background and I switch space to a fullscreen browser or another app, then the media buttons are not working.

vityevato commented 3 years ago

@panosru Sad ... Yes, at least in the latest version of Mac OS it does not work. Other adapters for applications that do not support applescript are also affected by this bug: Deezer, Tidal, AmazonMusic, Apple Podcasts!!! :((( Apple is not the same... :( I do not know how to fix this on my part, except to remove support for these players from the application. :(

panosru commented 3 years ago

@Stillness-2, it's not your fault that Apple f@ck up... Apple Script isn't supported by Apple Podcasts, just a sad lol... Not even M$ does that crap.

Anyways, I think it's not worth removing the feature, just place an asterisk for the affected apps and mention in the documentation that the apps marked with an asterisk are partially supported so people won't create new pointless issues.

Thanks for the try though!

panosru commented 3 years ago

Doing a bit more checking, since I have a 5 monitor setup, I found out that the issue only exists when on the main screen you are on a full-screen app. Basically, if your main screen doesn't have a fullscreen app currently, then the media keys are working fine across all monitors and spaces, even if Apple Podcasts is minimised or on another space.

Also, on the main screen, you may have fullscreen apps, as long as the fullscreen app of the main screen isn't focused. Having a fullscreen app focused on any other monitor, except the main, doesn't disturb the workflow of beardie and you can control Apple Podcasts.

I hope that description makes sense and maybe it can help somehow.

vityevato commented 3 years ago

Unfortunately, it won't help. As I wrote above, I do not know how to get around the feature of the API from the Apple. There is a function AXUIElementPerformAction from the API Accessibility. It allows you to "click" on menu items of another application. If an any application in fullscreen mode is currently in focus, then this function works without errors as usual, but in fact it does not do its job. That is, even the return of the function tells me that it is as if the action has been performed, although it is not. :)

panosru commented 3 years ago

Ah, I see, crap... So it is an API issue then, unfortunately, I'm not familiar with Apple's SDK to help somehow, but I wonder if what you describe is by design or a bug, maybe it is worth submitting it as a bug to Apple? Who knows, in a couple of decades we may get a fix from them! haha

So far, as a workaround, what I do is just create a new space and run the app I want maximised but not in fullscreen, that way at least I can play/pause the Apple Podcasts, so please, do not remove the support :)