Skip to content

Experimental API

C. Rubin edited this page Jan 10, 2020 · 1 revision

CherryRenderer has an experimental API that can be used instead of UPnP. However, as of this writing, you would still need to use UPnP's SSDP multicast in order to search for CherryRenderer's IP address.

Starting from version 2.0.2, the experimental API is disabled by default and must be enabled via Preferences - Advanced - Experimental API.

Discovery

Standard UPnP SSDP multicast with the search target ST: urn:schemas-upnp-org:service:AVTransport:1. Filter via ModelName CherryRenderer in case there are multiple AVTransport devices such as Smart TVs.

The API's default port is 54325 while the fallback port is 54326 in case default port is unavailable.

GET endpoints

Check alive

GET /isAlive

Response

{"isAlive": true}

View currently playing

GET /currentlyPlaying

Response

{
    "video": {
        "uri": "",
        "title": ""
    },
    "status": "STOPPED",
    "currentTime": 0,
    "totalTime": 0,
    "mute": false,
    "volume": 100
}

status will be one of the following values:

  • STOPPED - Player has stopped and no video is currently playing
  • TRANSITIONING - Player is currently loading a new video
  • PLAYING - Video is playing
  • PAUSE - Video is paused

POST endpoints

POST endpoints (and error messages) will always respond with the following payload format:

{
    "code": 200,
    "description": "OK",
    "message": ""
}
Key Description Example
code HTTP response code 200, 404, 405
description Description of response code "OK", "Not Found", "Method Not Allowed"
message Error message (when available) "No videos found from payload"

Play video

POST /play
{
    "videos":[
        {
            "uri": "https://video.com/video.mp4",
            "title": "Video (Episode 3).mp4"
        }
    ]
}

Toggle Pause

POST /togglePause

Stop video

POST /stop

Seeking

POST /seek
{
    "targetTime": 120
}

targetTime must be between 0 and the totalTime of the currently playing video.

Toggle mute

POST /toggleMute

Set volume

POST /setVolume
{
    "targetVolume": 50
}

targetVolume must be between 0 and 100.