HemTark 1 Posted November 3, 2022 Posted November 3, 2022 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?
Luke 40136 Posted November 3, 2022 Posted November 3, 2022 Hi, yes I'd take a look at the /sessions API.
HemTark 1 Posted November 3, 2022 Author Posted November 3, 2022 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.
HemTark 1 Posted November 4, 2022 Author Posted November 4, 2022 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. 1
Luke 40136 Posted November 4, 2022 Posted November 4, 2022 Actually newer versions of the server have an IsPlaying param that you can attach. So IsPlaying=true
HemTark 1 Posted November 4, 2022 Author Posted November 4, 2022 (edited) How can I attach IsPlaying field? This field is not mentioned in the swagger documentation of /Sessions API. Edited November 4, 2022 by HemTark
Luke 40136 Posted November 4, 2022 Posted November 4, 2022 IsPlaying=true. We'll get it added to swagger.
Cheesegeezer 3102 Posted November 5, 2022 Posted November 5, 2022 @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
bruor 37 Posted July 23, 2024 Posted July 23, 2024 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! 1
displayname0504 1 Posted June 26 Posted June 26 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"
Luke 40136 Posted June 26 Posted June 26 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now