Jump to content

API - Test to see if XBox App Ready for Playback


Recommended Posts

Posted

I'm working on a home assistant integration using the Emby API.

I've gotten far enough that I can turn on the Xbox and the Xbox will launch Emby, but sometimes Emby takes several seconds (8-10) to launch from scratch and if I issue the 'play' command through the API in this window, nothing happens.  I can delay ~15 seconds before the media starts playing and this will generally work, but then if Emby is already launched I'm waiting for no reason.

I've tried to come up with a way to poll the Emby API for the Emby Xbox integration session (I'm more familiar with the API layer) - but I've not found any reliable way to know if a given Emby Session is ready to take a playback command.  Can anyone point me in the right direction, either from the Home Assistant perspective OR from the API layer?  I'm running low on new approaches.

As an aside, I'm also looking for a way to start a playlist in shuffle mode if anyone has any insight into that, but I just started looking around on that one.

For reference, I'm using the Sessions/Playing command to start playback, and looping through the Sessions API to find the player I want based off of a pretty simple string search in the response.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...