AbstractPvrService
On this page
- AbstractPvrService ⇐
Abstract
- AbstractPvrService()
- init() ⇒
Promise
- getTotalSpace(options) ⇒
Number
- getRemainingSpace(options) ⇒
Number
- add(recording, options) ⇒
Promise.<Recording, Error>
- delete(recording, options) ⇒
Promise.<Recording, Error>
- update(recording) ⇒
Promise.<Recording, Error>
- stop(recording, options) ⇒
Promise.<Recording, Error>
- getRecordingMedia(recording) ⇒
Promise.<Media, Error>
- getNbRecordings() ⇒
Promise.<Number>
- checkConflict(recording, options) ⇒
Promise.<Recording, Error>
- getRecordingById(recordingId) ⇒
Recording
- getRecordings(options) ⇒
Promise.<Array.<Recording>, Error>
- getProgramAssociateRecording(programId) ⇒
AbstractRecording
|null
- isBeingRecorded([channelOrProgramOrNull]) ⇒
Promise.<boolean, Error>
- _getTotalSpace() ⇒
Number
- _getRemainingSpace() ⇒
Number
- _updateStartedRecording(recording, state)
- “recordingStateChanged” (recording, newState, oldState)
- “recordingChanged” (recording)
- “recordingError” (recording, errorId, error)
- _PROGRAM_ASSOCIATE_RECODINGS
- _RECORDINGS
- _TOTAL_SPACE
- _REMAINING_SPACE
- ERROR_INSUFFICIENT_STORAGE :
number
- ERROR_RESOURCE_LIMITATION :
number
- ERROR_ADD_RECORDING :
number
- ERROR_UPDATE_RECORDING :
number
- ERROR_DELETE_RECORDING :
number
- ERROR_START_RECORDING :
number
- ERROR_STOP_RECORDING :
number
- ERROR_GET_RECORDING :
number
- ERROR_FIND_RECORDINGS :
number
- ERROR_NOT_IMPLEMENTED :
number
AbstractPvrService ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Mixes: MServiceCache
Service:
Properties
Name | Type | Description |
---|---|---|
nbPvrTunerAvailable | Number | Number of tuner available (default -1 no limitation) |
isCustomMarginAvailable | Boolean | Enable or disable custom margin from user |
isEnabled | Boolean | Flag to tell if pvr is enabled |
- AbstractPvrService ⇐
Abstract
- new AbstractPvrService()
- instance
- .init() ⇒
Promise
- .getTotalSpace(options) ⇒
Number
- .getRemainingSpace(options) ⇒
Number
- .add(recording, options) ⇒
Promise.<Recording, Error>
- .delete(recording, options) ⇒
Promise.<Recording, Error>
- .update(recording) ⇒
Promise.<Recording, Error>
- .stop(recording, options) ⇒
Promise.<Recording, Error>
- .getRecordingMedia(recording) ⇒
Promise.<Media, Error>
- .getNbRecordings() ⇒
Promise.<Number>
- .checkConflict(recording, options) ⇒
Promise.<Recording, Error>
- .getRecordingById(recordingId) ⇒
Recording
- .getRecordings(options) ⇒
Promise.<Array.<Recording>, Error>
- .getProgramAssociateRecording(programId) ⇒
AbstractRecording
|null
- .isBeingRecorded([channelOrProgramOrNull]) ⇒
Promise.<boolean, Error>
- ._getTotalSpace() ⇒
Number
- ._getRemainingSpace() ⇒
Number
- ._updateStartedRecording(recording, state)
- “recordingStateChanged” (recording, newState, oldState)
- “recordingChanged” (recording)
- “recordingError” (recording, errorId, error)
- .init() ⇒
- static
- ._PROGRAM_ASSOCIATE_RECODINGS
- ._RECORDINGS
- ._TOTAL_SPACE
- ._REMAINING_SPACE
- .ERROR_INSUFFICIENT_STORAGE :
number
- .ERROR_RESOURCE_LIMITATION :
number
- .ERROR_ADD_RECORDING :
number
- .ERROR_UPDATE_RECORDING :
number
- .ERROR_DELETE_RECORDING :
number
- .ERROR_START_RECORDING :
number
- .ERROR_STOP_RECORDING :
number
- .ERROR_GET_RECORDING :
number
- .ERROR_FIND_RECORDINGS :
number
- .ERROR_NOT_IMPLEMENTED :
number
AbstractPvrService()
This abstract class represents the interface of the personal video recorder services. You must inherits your vendors implementations from this class.
init() ⇒ Promise
Init must be called asap as most of PVR API is synchronous for performance needs
Kind: instance method of AbstractPvrService
getTotalSpace(options) ⇒ Number
Retrieves total space for recording
Kind: instance method of AbstractPvrService
Returns: Number
- Total space in minutes
Param | Type | Default | Description |
---|---|---|---|
options | Object | Additional options | |
[options.force] | Boolean | false | If true, renew the cache |
[options.duration] | Number |
| Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getRemainingSpace(options) ⇒ Number
Retrieves remaining space for recording
Kind: instance method of AbstractPvrService
Returns: Number
- Remaining space in minutes
Param | Type | Default | Description |
---|---|---|---|
options | Object | Additional options | |
[options.force] | Boolean | false | If true, renew the cache |
[options.duration] | number |
| Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
add(recording, options) ⇒ Promise.<Recording, Error>
Add a new recording to the recording list and start it if it can be started. If the recording is null or it’s id is not null or it’s program is null or it’s state is not RecordingState.CREATED return a rejected promise (an error).
Kind: instance method of AbstractPvrService
Returns: Promise.<Recording, Error>
- A promise (recording, error)
Param | Type | Default | Description |
---|---|---|---|
recording | Recording | The recording to add | |
options | Object | additional options | |
[options.addToFront] | Boolean | Add record to the front | |
[options.duration] | number |
| Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
delete(recording, options) ⇒ Promise.<Recording, Error>
Delete a recording from the recording list (and from the resource where it is stored) If the recording is null or the recording id is null, return a rejected promise (an error).
Kind: instance method of AbstractPvrService
Returns: Promise.<Recording, Error>
- A promise (recording, error)
Param | Type | Description |
---|---|---|
recording | Recording | The recording to delete |
options | Object | additional options |
update(recording) ⇒ Promise.<Recording, Error>
Update a recording and start it if it can be started If the recording is null, return a rejected promise (an error).
Kind: instance method of AbstractPvrService
Returns: Promise.<Recording, Error>
- A promise (recording, error)
Param | Type | Description |
---|---|---|
recording | Recording | The recording to update |
stop(recording, options) ⇒ Promise.<Recording, Error>
Stop manually a recording, ie stop recording the current channel’s program. It is an error to stop a recording that is not started
Kind: instance method of AbstractPvrService
Returns: Promise.<Recording, Error>
- A promise (recording, error)
Param | Type | Description |
---|---|---|
recording | Recording | The recording to delete |
options | Object | additional options |
getRecordingMedia(recording) ⇒ Promise.<Media, Error>
Retrieve media to play for a recording
Kind: instance method of AbstractPvrService
Returns: Promise.<Media, Error>
- A promise (media, error)
Param | Type | Description |
---|---|---|
recording | Recording | The recording to delete |
getNbRecordings() ⇒ Promise.<Number>
Return number of recordings
Kind: instance method of AbstractPvrService
checkConflict(recording, options) ⇒ Promise.<Recording, Error>
Check if there is some conflicts with recordings
Kind: instance method of AbstractPvrService
Returns: Promise.<Recording, Error>
- A promise (recording, error)
Param | Type | Default | Description |
---|---|---|---|
recording | Recording | ||
options | Object | Additional options | |
[options.paddingStart] | number | 0 | |
[options.paddingEnd] | number | 0 | |
[options.nbTunersAvailable] | number | 1 | |
[options.paddingStart] | number | 0 | |
[options.autoResolvePaddingConflicts] | Boolean | true |
getRecordingById(recordingId) ⇒ Recording
Return the recording referenced by it’s id
Kind: instance method of AbstractPvrService
Returns: Recording
- The recording
Param | Type | Description |
---|---|---|
recordingId | String | the id of the recording to get |
getRecordings(options) ⇒ Promise.<Array.<Recording>, Error>
Get all recordings.
Kind: instance method of AbstractPvrService
Returns: Promise.<Array.<Recording>, Error>
- A promise (recordings<Array>
, error)
Param | Type | Default | Description |
---|---|---|---|
options | Object | Additional options | |
[options.force] | Boolean | false | If true, renew the cache |
[options.duration] | number |
| Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getProgramAssociateRecording(programId) ⇒ AbstractRecording
| null
Find recording for a program id.
Warning return null if the service has not been initialized
Kind: instance method of AbstractPvrService
Returns: AbstractRecording
| null
- The recording of the program
Param | Type | Description |
---|---|---|
programId | String | Id of the program |
isBeingRecorded([channelOrProgramOrNull]) ⇒ Promise.<boolean, Error>
Return true if the media (a channel or a program) is currently being recorded. When called with no arguments, indicates that some medias are currently being recorded or not.
The abstract service offers a default implementation that may be overridden by the vendor for performance reason.
Kind: instance method of AbstractPvrService
Returns: Promise.<boolean, Error>
- A promise resolve with true if the specified channel or program is being recorded, or if some recordings are started if no channel /program was specified
Param | Type | Description |
---|---|---|
[channelOrProgramOrNull] | AbstractChannel | AbstractGridProgram | null | The channel or the program to check; null for any channel/program |
_getTotalSpace() ⇒ Number
Retrieves total space for recording
Kind: instance method of AbstractPvrService
Returns: Number
- Total space in minutes
_getRemainingSpace() ⇒ Number
Retrieves remaining space for recording
Kind: instance method of AbstractPvrService
Returns: Number
- Remaining space in minutes
_updateStartedRecording(recording, state)
Update the map containing started records
Kind: instance method of AbstractPvrService
Access: protected
Param | Type |
---|---|
recording | Recording |
state | number |
“recordingStateChanged” (recording, newState, oldState)
Fired when the state of a recording changed.
Kind: event emitted by AbstractPvrService
Param | Type | Description |
---|---|---|
recording | Recording | Recording which state changed |
newState | RecordingState | New state of recording |
oldState | RecordingState | Old state of recording |
“recordingChanged” (recording)
Fired when a recording changed.
Kind: event emitted by AbstractPvrService
Param | Type | Description |
---|---|---|
recording | Recording | Recording which changed |
“recordingError” (recording, errorId, error)
Fired when a recording is in error.
Kind: event emitted by AbstractPvrService
Param | Type | Description |
---|---|---|
recording | Recording | Recording which is in error |
errorId | String | Error id |
error | Error | Error |
_PROGRAM_ASSOCIATE_RECODINGS
Kind: static property of AbstractPvrService
Access: protected
_RECORDINGS
Kind: static property of AbstractPvrService
Access: protected
_TOTAL_SPACE
Kind: static property of AbstractPvrService
Access: protected
_REMAINING_SPACE
Kind: static property of AbstractPvrService
Access: protected
ERROR_INSUFFICIENT_STORAGE : number
Kind: static constant of AbstractPvrService
ERROR_RESOURCE_LIMITATION : number
Kind: static constant of AbstractPvrService
ERROR_ADD_RECORDING : number
Kind: static constant of AbstractPvrService
ERROR_UPDATE_RECORDING : number
Kind: static constant of AbstractPvrService
ERROR_DELETE_RECORDING : number
Kind: static constant of AbstractPvrService
ERROR_START_RECORDING : number
Kind: static constant of AbstractPvrService
ERROR_STOP_RECORDING : number
Kind: static constant of AbstractPvrService
ERROR_GET_RECORDING : number
Kind: static constant of AbstractPvrService
ERROR_FIND_RECORDINGS : number
Kind: static constant of AbstractPvrService
ERROR_NOT_IMPLEMENTED : number
Kind: static constant of AbstractPvrService