HemTark 1 Posted November 3, 2022 Share 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? Link to comment Share on other sites More sharing options...
Luke 37128 Posted November 3, 2022 Share Posted November 3, 2022 Hi, yes I'd take a look at the /sessions API. Link to comment Share on other sites More sharing options...
HemTark 1 Posted November 3, 2022 Author Share 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. Link to comment Share on other sites More sharing options...
Luke 37128 Posted November 3, 2022 Share Posted November 3, 2022 Yes try that first one. 1 Link to comment Share on other sites More sharing options...
HemTark 1 Posted November 4, 2022 Author Share 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 Link to comment Share on other sites More sharing options...
Luke 37128 Posted November 4, 2022 Share Posted November 4, 2022 Actually newer versions of the server have an IsPlaying param that you can attach. So IsPlaying=true Link to comment Share on other sites More sharing options...
HemTark 1 Posted November 4, 2022 Author Share 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 Link to comment Share on other sites More sharing options...
Luke 37128 Posted November 4, 2022 Share Posted November 4, 2022 IsPlaying=true. We'll get it added to swagger. Link to comment Share on other sites More sharing options...
Cheesegeezer 3088 Posted November 5, 2022 Share 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 Link to comment Share on other sites More sharing options...
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