new Client()
Record manager. Listening daemon for records changes and emitting corresponding events to application.
Can emit events: progress, state, add, remove.
Extends
Members
errorCodes :Object
Description for pvr error codes.
Type:
- Object
Methods
add(data, callback)
Create new record.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object | record info
Properties
|
|||||||||||||||
callback |
callback | callback function |
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.
remove(item, options, callback)
Remove record.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
item |
Record | record instance | ||||||
options |
Object | delete options
Properties
|
||||||
callback |
callback | callback function |