Repository navigation
- misc
- media
- controls
- volume
Indicate the service should start discovery (if it has not already).
| Name | Required | Type | Description |
|---|---|---|---|
| subscribe | true | Boolean | subscribe should be true - service will only discover devices while an application is subscribed to device list. |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be false for requests. Applications must subscribe to receive device list |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| subscribed | false | Boolean | subscribed will be true if the subscription is successful, false otherwise |
| devices | false | Device Array | devices will contain an array of Device objects. |
| event | false | String | event will be one of ["found", "lost"] |
| device | false | Device | device will be the modified device |
None
luna-send -n 1 -f luna://com.alanstice.cast.service/listDevices {}
{
"returnValue": false,
"errorCode": 405,
"errorText": "Request not allowed, please subscribe"
}
luna-send -i -f luna://com.alanstice.cast.service/listDevices '{"subscribe": true}'
{
"returnValue": true,
"subscribed": true,
"devices": []
}
{
"event": "found",
"device": {
"id": "0",
"name": "LG webOS TV",
"type": "webOS"
},
"devices": [
{
"id": "0",
"name": "LG webOS TV",
"type": "webOS"
}
]
}
{
"event": "lost",
"device": {
"id": "0",
"name": "LG webOS TV",
"type": "webOS"
},
"devices": []
}
Cast media (audio, video, image) to a device
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Cast target: must match a found Device ID |
| media | true | Object OR Object array | Must be a Media object, or array of Media objects |
| subscribe | false | Boolean | Subscribe for cast status updates. May not be available on all platforms. |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise. |
| subscribed | false | Boolean | subscribed, returned on first response, will be true if successfully subscribed, false otherwise |
Get the media duration
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| subscribe | false | Boolean | true to subscribe for duration updates, false for single poll. Will be internally abstracted as a poll interval if target platform doesn't support subscribing. |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
| duration | false | Number | Media duration in seconds |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise. |
| subscribed | false | Boolean | subscribed, returned on first response, will be true if successfully subscribed, false otherwise |
| duration | true | Number | Media duration in seconds |
Get (or subscribe to) the media position
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| subscribe | false | Boolean | true to subscribe for position updates, false for single poll. Will be internally abstracted as a poll interval if target platform doesn't support subscribing. |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
| position | false | Number | Current media position in seconds |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise. |
| subscribed | false | Boolean | subscribed, returned on first response, will be true if successfully subscribed, false otherwise |
| position | true | Number | Current media position in seconds |
Get (or subscribe to) the media status
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| subscribe | false | Boolean | true to subscribe for status updates, false for single poll. Will be internally abstracted as a poll interval if target platform doesn't support subscribing. |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
| playState | false | String | The media play state ("playing", "paused", etc) |
| playingMedia | false | String | The URI (or file path) of the playing media |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise. |
| subscribed | false | Boolean | subscribed, returned on first response, will be true if successfully subscribed, false otherwise |
| playState | true | String | The media play state ("playing", "paused", etc) |
| playingMedia | true | String | The URI (or file path) of the playing media |
Seek to the specified position
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| position | true | Number | Seek time in seconds, must be in the range [0,duration] |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Jump to a specific item in the playlist
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| index | true | Number | Playlist index to seek to |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Skip to the next item in the playlist
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Skip to the previous item in the playlist
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Send the fast forward command to the device. Behavior depends on device implementation.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Send the pause command to the device. Behavior depends on device implementation.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Send the play command to the device. Behavior depends on device implementation.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Send the rewind command to the device. Behavior depends on device implementation.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Send the stop command to the device. Behavior depends on device implementation.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Get the volume from the device. May not work correctly on Chromecast.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| subscribe | false | Boolean | true to subscribe for volume updates, false for single poll. Will be internally abstracted as a poll interval if target platform doesn't support subscribing. |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
| volume | false | Number | If not error occurs, volume will be returned in range [0,100] |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise. |
| subscribed | false | Boolean | subscribed, returned on first response, will be true if successfully subscribed, false otherwise |
| volume | true | Number | The device volume, in range [0,100]. |
Set the volume on the device. May not work correctly on Chromecast
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| volume | true | Number | New volume value, [0,100] |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Decrease the device volume by one.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
Increase the device volume by one.
| Name | Required | Type | Description |
|---|---|---|---|
| target | true | String | Target Device ID to access |
| Name | Required | Type | Description |
|---|---|---|---|
| returnValue | true | Boolean | returnValue will be true on success, false otherwise |
| errorCode | false | Number | If an error occurs, errorCode will contain numeric error code |
| errorText | false | String | If an error occurs, errorText will contain a description of the error |
An object representing a connectable device
| Name | Type | Description |
|---|---|---|
| id | String | Unique identifier, used to interact with the device |
| name | String | User friendly name for representing the device in UI |
| type | String | Device type. (e.g. webOS, Chromecast or Chromecast Audio) |
An object representing cast target media
| Name | Type | Description |
|---|---|---|
| path | String | URI pointing to the media or, if local flag is true, filesystem path to the media |
| mimeType | String | The media's mimeType |
| local | Boolean | true if the media is stored locally, false if it's hosted |
| title | String | Title to display with media |
| description | String | Description to display with media |
| poster | String | URI pointing to a poster image. Will be displayed while video is loading or as album art for audio. |