Jump to content

Remote control howto


amazingstories

Recommended Posts

amazingstories

So I used the api-key to find the sessions. I tried to send a stop command to the session but it did not succeed. What did I do wrong?

 

https://videos/Sessions/<idfrom session>/Playing/Stop?api_key=<api-key-goes-here>

 

I was able to get the list of sessions using the same format.

 

https://videos/Sessions?api_key=<api-key-goes-here>

 

Each session had a id parameter.

Link to comment
Share on other sites

The URL is right. What is videos? Have you tried it with the IP and port if the server in the URL?

Link to comment
Share on other sites

amazingstories

I have an nginx reverse proxy so port is not required - https connects to http on port 8096. What is the base URL I should use?  videos is the hostname of my local servrer and https://videos redirects to https://videos/web/index.html. https://videos/Sessions gets me the list of sessions, but when I tell the session that's playing top stop, it tells me "Unable to find the specified file."

Link to comment
Share on other sites

Okay message body in the swagger shows (as required):

{
  "Command": "Stop",
  "SeekPositionTicks": 0,
  "ControllingUserId": "string"
}

But also, this is a "POST" request. Are you Posting to your address?

 

Adding the stop request into the web browser would send a "GET" which would return "file not found", because it is trying to get a file, which isn't there.

Edited by chef
Link to comment
Share on other sites

amazingstories

I see it now. The Playing command takes a POST. It's not obvious though that the other commands also take a POST if you see below - POST is omitted in the Wiki.  Where is the swagger? I only see the wiki.

 

https://github.com/MediaBrowser/Emby/wiki/Remote-control

 

###Sending a play command

You can instruct a client to play something by posting to the following url:

/Sessions/{Id}/Playing

The following values should be included within post data:

  • ItemIds - A comma-delimited list of item id's
  • PlayCommand - PlayNow, PlayNext or PlayLast
  • StartPositionTicks - If supplied, this is the position in which the first title should start at.
  • MediaSourceId - If supplied, this is the media source that should be used for the first item
  • AudioStreamIndex - If supplied, this is the audio stream that should be used for the first item
  • SubtitleStreamIndex - If supplied, this is the subtitle stream that should be used for the first item
  • StartIndex - If supplied, and if playing a list of items, this is the index of the first item that should be played.

Note: StartPositionTicks is ignored when PlayCommand is PlayNext or PlayLast.

###Sending a playstate command

The following commands are available:

  • /Sessions/{Id}/Playing/Stop
  • /Sessions/{Id}/Playing/Pause
  • /Sessions/{Id}/Playing/Unpause
  • /Sessions/{Id}/Playing/PlayPause
  • /Sessions/{Id}/Playing/NextTrack
  • /Sessions/{Id}/Playing/PreviousTrack
  • /Sessions/{Id}/Playing/Seek?SeekPositionTicks=xxx

###Sending a general command

General commands are sent using /Sessions/{Id}/Command/{CommandName}

If arguments are required, the body of the request should be of contentType application/json and have the following structure:

{ Arguments:{ "Name": "Value" } }

Below are the list of known core command names, along with the list of properties available in Arguments.

  • MoveUp,
  • MoveDown,
  • MoveLeft,
  • MoveRight,
  • PageUp,
  • PageDown,
  • PreviousLetter (scroll list to previous letter),
  • NextLetter (scroll list to next letter),
  • ToggleOsdMenu (show or hide video player OSD),
  • ToggleContextMenu (show or hide information relating to selected list item),
  • Select (enter),
  • Back,
  • TakeScreenshot,
  • SendKey (tbd),
  • SendString (Enter text into application - Arguments: String),
  • GoHome,
  • GoToSettings,
  • VolumeUp,
  • VolumeDown,
  • Mute,
  • Unmute,
  • ToggleMute,
  • SetVolume (Arguments: Volume 0-100 scale),
  • SetAudioStreamIndex = (Arguments: Index),
  • SetSubtitleStreamIndex = (Arguments: Index. If -1 turn off subtitles),
  • ToggleFullscreen ,
  • DisplayContent (Arguments: ItemName, ItemId, ItemType),
  • GoToSearch,
  • PlayMediaSource - used to indicate support for media source selection for an item,
  • PlayTrailers (Arguments: ItemId),
  • DisplayMessage (Arguments: Header, Text, TimeoutMs - if timeout is omitted, message should be modal)
  • Like 1
Link to comment
Share on other sites

Happy2Play

 

I see it now. The Playing command takes a POST. It's not obvious though that the other commands also take a POST if you see below - POST is omitted in the Wiki.  Where is the swagger? I only see the wiki.

 

 

 

There is a API link at the bottom of the Dashboard.

  • Like 1
Link to comment
Share on other sites

amazingstories

Ok - I found the API link. Problem. I don't see the /Sessions/id/Playing/Stop listed under the PlayState Service per the 2018 Remote control details in the Wiki. In fact, I don't see ANY services that allow for remote control. Did I miss something? Do I have the wrong swagger?

Link to comment
Share on other sites

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