Class: Client

Client

new Client()

Record manager. Listening daemon for records changes and emitting corresponding events to application. Can emit events: progress, state, add, remove.
Source:

Extends

Members

errorCodes :Object

Description for pvr error codes.
Type:
  • Object
Source:

Methods

add(data, callback)

Create new record.
Parameters:
Name Type Description
data Object record info
Properties
Name Type Description
name string path to file
channel string channel url
startTime number start time
endTime number end time
callback callback callback function
Source:
Example
pvr.add({
    name: '/media/USB-94F9AM9X43RO31TW-1/records/EurosportLive/2016-03-16/00-00-01.ts',
    channel: 'rtp://239.1.1.1:1234',
    startTime: Math.ceil((new Date()).getTime() / 1000 + 10),
    endTime: Math.ceil((new Date()).getTime() / 1000 + 500)
}, function ( error, data ) {
    console.log(error);
    console.log(data);
});

destroy()

Stop this client and remove all it listeners. Use it for cleanup before application exit.
Source:

remove(item, options, callback)

Remove record.
Parameters:
Name Type Description
item Record record instance
options Object delete options
Properties
Name Type Description
deleteFile boolean if true then both file and task will be deleted, if false - only task
callback callback callback function
Source: