Inrego 76 Posted August 3, 2016 Share Posted August 3, 2016 Hello. I'm building some sort of remote control of current sessions to Home Assistant, but how do I know which sessions support pausing? From my tests, I can send a pause command when playing on my Android TV device, but if I send it to a Web Client, I get an error from the server. Link to comment Share on other sites More sharing options...
Luke 37272 Posted August 3, 2016 Share Posted August 3, 2016 Hi, thanks I'll test that issue out. You can check out the remote control wiki here: https://github.com/MediaBrowser/Emby/wiki/Remote-control the api will tell you what the supported commands are for a given session. Link to comment Share on other sites More sharing options...
Inrego 76 Posted August 3, 2016 Author Share Posted August 3, 2016 (edited) Hello. Thank you for your response. I meant playstates, not commands. I did see that there is SupportedCommands response on the webservice, but none of them show the pause since it's a playstate, not a command. Here's a link to the relevant part that I mean: https://github.com/MediaBrowser/Emby/wiki/Remote-control#sending-a-playstate-command Sending these doesn't work for WebClients as far as I've experienced. Is that a bug? Or is there a way to check if a session supports settings these playstates. Edited August 3, 2016 by Inrego Link to comment Share on other sites More sharing options...
Luke 37272 Posted August 3, 2016 Share Posted August 3, 2016 the playstate commands will also be in the list of supported commands. yes there is ongoing work involved with controlling another instance of the web client so there might be some issues there. theater is fully controllable though. Link to comment Share on other sites More sharing options...
Inrego 76 Posted August 3, 2016 Author Share Posted August 3, 2016 I'm not sure I understand. Let me elaborate. When I call GET on /Sessions, I get the following for my Android TV: [ { "SupportedCommands": [ "DisplayContent", "Mute", "Unmute", "ToggleMute" ], "QueueableMediaTypes": [], "PlayableMediaTypes": [ "Video", "Audio" ], "Id": "6ea3359de334e2f7ce9d419ec19fa271", "UserId": "a30a0e8f763e4a68b4bd30aa95ad74e1", "UserName": "Inrego", "AdditionalUsers": [], "ApplicationVersion": "1.2.28g", "Client": "AndroidTv", "LastActivityDate": "2016-08-03T16:57:07.1167207Z", "DeviceName": "NVIDIA SHIELD Android TV", "DeviceId": "d9a07717ac7b4a57", "AppIconUrl": "https://raw.githubusercontent.com/MediaBrowser/MediaBrowser.Android/master/servericon.png", "SupportsRemoteControl": true, "PlayState": { "CanSeek": false, "IsPaused": false, "IsMuted": false, "RepeatMode": "RepeatNone" } }, { "SupportedCommands": [ "GoHome", "GoToSettings", "VolumeUp", "VolumeDown", "Mute", "Unmute", "ToggleMute", "SetVolume", "SetAudioStreamIndex", "SetSubtitleStreamIndex", "DisplayContent", "GoToSearch", "DisplayMessage", "SetRepeatMode" ], "QueueableMediaTypes": [ "Video" ], "PlayableMediaTypes": [ "Audio", "Video" ], "Id": "5c34a68573d46d2cb1f8b8134f344c4c", "UserId": "a30a0e8f763e4a68b4bd30aa95ad74e1", "UserName": "Inrego", "AdditionalUsers": [], "ApplicationVersion": "3.0.6020.0", "Client": "Emby Mobile", "LastActivityDate": "2016-08-03T12:35:59.3311928Z", "DeviceName": "Chrome 52.0.2743.82", "DeviceId": "39bc91c447e9352221d0f66ed4e8692b", "SupportsRemoteControl": true, "PlayState": { "CanSeek": false, "IsPaused": false, "IsMuted": false, "RepeatMode": "RepeatNone" } } ] Pause and Unpause are not listed here under "SupportedCommands". However, calling the webservice /Sessions/{Id}/Playing/pause does in fact pause the current video on that device, and unpause resumes the video. From my understanding the commands listed in "SupportedCommands" are only for the /Sessions/{Id}/Command/{CommandName} webservice, and unrelated to the playstate commands. Link to comment Share on other sites More sharing options...
Luke 37272 Posted August 3, 2016 Share Posted August 3, 2016 Sorry, maybe i was wrong. My memory was a little fuzzy on that. The supported commands list came after the playstate commands so in order to retain compatibility that's they are just assumed supported if SupportsRemoteControl is true. Link to comment Share on other sites More sharing options...
Inrego 76 Posted August 3, 2016 Author Share Posted August 3, 2016 No worries It's quite a large api endpoint to know by memory. And it does also seem like web clients return false on the SupportsRemoteControl property, so that's all I needed, thanks! (How did I not see that property myself?) 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