Jump to content

How to get playing status using API?


Recommended Posts

Posted

I want to get the status whether the server is playing any media using the API. Is there any API endpoint which can be helpful in this scenario?

Posted

Hi, yes I'd take a look at the /sessions API.

Posted

In /Sessions API, I can see only three GET requests which are to get all sessions, auth providers and auth keys respectively. Others are DELETE and POST requests.

Posted

Yes try that first one.

  • Like 1
Posted

 I checked the /Sessions API and found that when a media is playing/paused we get field named "NowPlayingItem" with details of the media being played. I can use this field to check whether a media is being played or not.

Thank you @Luke for help.

  • Thanks 1
Posted

Actually newer versions of the server have an IsPlaying param that you can attach. So IsPlaying=true

Posted (edited)

How can I attach IsPlaying field? This field is not mentioned in the swagger documentation of /Sessions API.

Edited by HemTark
Posted

IsPlaying=true. We'll get it added to swagger.

Cheesegeezer
Posted

@HemTark Depending on what you're using (language wise)

@chef did a poster app that you can look at the JS and HTML that will let you see the process connecting, authenticating, creating a session and getting playback

hope it helps

 

  • 1 year later...
Posted
On 11/4/2022 at 1:10 AM, Luke said:

Actually newer versions of the server have an IsPlaying param that you can attach. So IsPlaying=true

So glad I stumbled across this hidden param!  :D

 

  • Thanks 1
  • 11 months later...
displayname0504
Posted

Sorry to revive this old thread.  I see the NowPlayingItem, but I don't see "IsPlaying".

Is this still on the roadmap? And would it be possible to filter? In Swagger, the only options listed to filter are "DeviceId" or "ControllableByUserId"

Posted
7 hours ago, displayname0504 said:

Sorry to revive this old thread.  I see the NowPlayingItem, but I don't see "IsPlaying".

Is this still on the roadmap? And would it be possible to filter? In Swagger, the only options listed to filter are "DeviceId" or "ControllableByUserId"

Hi, IsPlaying is a filter on the api endpoint, not a property on the output. It sounds like you have what you need.

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...