Jump to content


Photo

Remote control howto


  • Please log in to reply
8 replies to this topic

#1 amazingstories OFFLINE  

amazingstories

    Advanced Member

  • Members
  • 31 posts
  • Local time: 01:55 AM

Posted 19 January 2020 - 10:54 PM

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/Sessi...-key-goes-here>

 

Each session had a id parameter.



#2 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4456 posts
  • Local time: 01:55 AM
  • LocationPeterborough, Canada

Posted 19 January 2020 - 11:02 PM

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

#3 amazingstories OFFLINE  

amazingstories

    Advanced Member

  • Members
  • 31 posts
  • Local time: 01:55 AM

Posted 19 January 2020 - 11:07 PM

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



#4 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4456 posts
  • Local time: 01:55 AM
  • LocationPeterborough, Canada

Posted 19 January 2020 - 11:47 PM

I see.

Just going to look over the swagger doc s here. Just a moment.

#5 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4456 posts
  • Local time: 01:55 AM
  • LocationPeterborough, Canada

Posted 19 January 2020 - 11:52 PM

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, 19 January 2020 - 11:53 PM.


#6 amazingstories OFFLINE  

amazingstories

    Advanced Member

  • Members
  • 31 posts
  • Local time: 01:55 AM

Posted 20 January 2020 - 02:37 AM

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/M.../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)

  • chef likes this

#7 Happy2Play OFFLINE  

Happy2Play

    Trial and Error

  • Moderators
  • 17674 posts
  • Local time: 10:55 PM
  • LocationWashington State

Posted 20 January 2020 - 07:23 AM

 

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.


  • chef likes this

#8 amazingstories OFFLINE  

amazingstories

    Advanced Member

  • Members
  • 31 posts
  • Local time: 01:55 AM

Posted 20 January 2020 - 01:44 PM

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?



#9 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4456 posts
  • Local time: 01:55 AM
  • LocationPeterborough, Canada

Posted 20 January 2020 - 02:17 PM

Look under SessionsService :)

Edited by chef, 20 January 2020 - 02:24 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users