unfoldedcircle / feature-and-bug-tracker

Feature and bug tracker repository for Unfolded Circle products
22 stars 0 forks source link

Play/Pause toggle command for AppleTV integration #159

Open hprotter opened 8 months ago

hprotter commented 8 months ago

Is there an existing issue for this?

Description

In AppleTV integration I have an issue with the Play/Pause toggle command. It works with all my AppleTV apps except for the O2-TV app (maybe that this is the same for the Waipu-TV app?). Within the O2-TV app just the Pause command will work, but not the Play part of the toggle. So, I can stop (Pause) a movie with the R2, but cannot start (Play) again. Maybe that there are different commands for Play/Pause the Apple TV will recognize? Because for my Harmony remote the Play/Pause toggle will fully work also for the O2-TV app. So, something is different between the Play/Pause toggle commands from R2 AppleTV integration and the Harmony remote.

How to Reproduce

  1. Start AppleTV activity (with the AppleTV integration) on R2
  2. In Apple TV open "O2-TV" app
  3. Start a movie
  4. Pause/Stop the movie with Play/Pause toggle command
  5. Restart the movie with Play/Pause toggle command will not work

Expected behavior

After pausing a movie in O2-TV app with the Play/Pause toggle, the movie should play again with a second Play/Pause toggle command from the AppleTV integration.

System version

v1.4.3

What part of the system affected by the problem?

Integration

Additional context

No response

martonborzak commented 8 months ago

It depends on the specific apps how they implement things. We have seen the same behaviour during testing with various apps, that not everyone implements commands the same way.

hprotter commented 8 months ago

Thank you, Marton, for the response. Yes, it is surely the implementation within the app that will have another behaviour for that Play/Pause command toggle. My point here is, that there must be another Play/Pause toggle command because the toggle command which is send from my Harmony works perfectly, also for the Play part of the toggle.

petercv commented 7 months ago

I run into the same problem with various apps. Netflix works great, but for example HBO Max and some other big names don't. And indeed the Harmony remote works (but probably uses IR) and of course the Apple TV remote itself does work as well. So it seems there might be another command you can send that these apps do listen to. Unfortunately it seems the AppleTV integration isn't open source so I can't experiment with it in a Docker container locally.

kennymc-c commented 7 months ago

@petercv The Apple TV integration is using the same Python library (pyatv) as the Home Assistant integration.

I think this could also be a bug because I sometimes notice that the pause command is not working while something is playing and only works again when I exit the player interface and start it again. This happened with Disney+ and Joyn.

geransmith commented 6 months ago

I've started seeing this periodically in apps. Disney+ seems to do it the most consistently (where either play or pause works, but not always both). I experienced it with Netflix tonight as well.

kennymc-c commented 6 months ago

@geransmith When it's not working all the time it could also be related to https://github.com/unfoldedcircle/feature-and-bug-tracker/issues/221. I noticed that in the Disney+ app you can not pause or play with the select/ok button but this is not a remote two issue but rather related to the app not using the native tvOS player since this is also the case with other remotes. Also +/- 10 seconds skip is sometimes not working with this app.

petercv commented 3 months ago

As of today, with firmware 1.7.7, this issue is still present in certain apps. I've just added the Apple TV integration in Home Assistant which is able to pause the Apple TV.

petercv commented 3 months ago

My guess is that HomeAssistant uses the distinct play and pause actions instead of the play_pause action.

petercv commented 3 months ago

I can confirm that a play_pause from within Home Assistant also doesn't work, but the distinct play or pause actions do. So this could be fixed by checking for the current state and based on that invoke one or the other. It seems certain application only listen for the distinct actions instead of the toggle action.