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
fastForward(callback, speed)
Fast forwards
Parameters:
Name |
Type |
Default |
Description |
callback |
function
|
|
The callback function called with err, callback |
speed |
number
|
2
|
The speed to fast forward with
speed has to be in [2, 4, 8, 16, 32] |
- Source:
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:
goBack(callback)
Parameters:
Name |
Type |
Description |
callback |
|
|
- Source:
goDown(callback)
Navigates down in the menu
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) |
- Source:
goHome(callback)
Goes to Kodi home menu
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) |
- Source:
goLeft(callback)
Navigates left in the menu
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) |
- Source:
goNext(callback)
Skips to next media
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with err, callback |
- Source:
goPrevious(callback)
Goes to start or previous media
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with err, callback |
- Source:
goRight(callback)
Navigates right in the menu
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) |
- Source:
goUp(callback)
Navigates up in the menu
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) |
- Source:
pause(callback)
Pauses Kodi
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with err, callback |
- Source:
play(callback)
Plays Kodi
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with err, callback |
- Source:
playPause(callback)
Plays Kodi if paused and pauses if playing
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with err, callback |
- Source:
rewind(callback, speed)
Rewinds
Parameters:
Name |
Type |
Default |
Description |
callback |
function
|
|
The callback function called with err, callback |
speed |
number
|
2
|
The speed to rewind by
speed has to be in [2, 4, 8, 16, 32] |
- Source:
select(callback)
Selects the current menu item
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) |
- 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:
showInfo(callback)
Shows info on the current video playing
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with the params (err, data) with data being the volume |
- Source:
stop(callback)
Stops kodi
Parameters:
Name |
Type |
Description |
callback |
function
|
The callback function called with err, callback |
- Source:
volumeDown(callback, volumeChangeBy)
Decreases the volume
Parameters:
Name |
Type |
Default |
Description |
callback |
function
|
|
The callback function called with err, callback |
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 err, callback |
volumeChangeBy |
number
|
5
|
How much to increase the volume by |
- Source: