Constructor
new Controller(ip, port)
Parameters:
Name |
Type |
Default |
Description |
ip |
string
|
localhost
|
The IP address that Kodi is on |
port |
number
|
8080
|
The port that Kodi is configured for (Default is 8080) |
- Source:
Methods
getActivePlayerID(callback)
Gets the ID of the active player from Kodi
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) with data being the ID |
- Source:
getVolume(callback)
Gets the current players volume
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) with data being the volume |
- Source:
goNext(callback)
Skips to next media
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the err |
- Source:
goPrevious(callback)
Goes to start or previous media
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the err |
- Source:
pause(callback)
Pauses kodi
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the err |
- Source:
play(callback)
Plays kodi
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the err |
- Source:
playPause(callback)
Plays kodi if paused and pauses if playing
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the err |
- Source:
sendRequest(method, params, callback?)
Sends a request to Kodi with body as the body of the request, handles errors as needed
Parameters:
Name |
Type |
Description |
method |
string
|
The method we are calling |
params |
Object
|
The parameters for the method |
callback? |
function
|
Function called when request is finished with arguments of
string (err), string (body) |
- Source:
volumeDown(callback, volumeChangeBy)
Decreases the volume
Parameters:
Name |
Type |
Default |
Description |
callback |
function
|
|
The callback function called with the err |
volumeChangeBy |
number
|
5
|
How much to decrease the volume by |
- Source:
volumeUp(callback, volumeChangeBy)
Increases the volume
Parameters:
Name |
Type |
Default |
Description |
callback |
function
|
|
The callback function called with the err |
volumeChangeBy |
number
|
5
|
How much to increase the volume by |
- Source: