TimeShift API v3
Using functionality of Timeshift
To be able to fully use Timeshift functions:
1. Set directory, where temporally files will be stored using
2. If it is needed change max duration of Timeshift using
3. Start playback with solution
All actions with timeshift are done using the global object
Events
During playback using
{"event_code":1,"ident":"TimeShift","event_data":""}
In this case
event_code | |
---|---|
1 | playback |
2 |
stop |
3 |
|
4 |
When timeshift buffer is full. After this event in
|
5 | Comes before 1 minute before buffer turns full (1 minute before event 4 ) |
6 |
Comes while playback if a storage device is not available
|
Method of object TimeShift
TimeShift.SetTimeShiftFolder
void SetTimeShiftFolder(string folderPath)
Set the working directory for the module
Parameters:
Parameters | Available values | Description |
---|---|---|
folderPath | Path to store timeshift files |
Return value:
No.
TimeShift. SetMaxDuration
void SetMaxDuration (int duration)
Set maximum Timeshift buffer duration.
Parameters:
Parameters | Available values | Description |
---|---|---|
duration | Max duration in seconds |
Return value:
No.
TimeShift.EnterTimeShift
void EnterTimeShift()
Switch to timeshift mode. After switch pause and positioning on the current buffer will be available.
Parameters: No.
Return value:
Parameters | Valid values | Description |
---|---|---|
error | int | 0 – success In other variant – false. |
Note: Works only if playback was started using the solution
TimeShift.ExitTimeShift
void ExitTimeShift()
Exit timeshift mode and switch back to real-time. Timeshift buffer will not be saved.
Parameters:
No.
Return value:
Parameters | Available values | Description |
---|---|---|
error | int | 0 – success In other variants – false. |
Note: Works only if playback was started using the solution
TimeShift.ExitTimeShiftAndSave
void ExitTimeShiftAndSave(string name)
Exit in timeshift mode and switch to real-time. The current buffer will save as a PVR task in file with a special extension.
Parameters:
Parameters | Description | |
---|---|---|
name | Subdirectory name, where all saved data for current timeshift will be stored |
Return value:
Parameters | Available values | Description |
---|---|---|
error | int | 0 – success In other variants – false. |
TimeShift. ExitTimeShiftAndSaveDuration
void ExitTimeShiftAndSaveDuration(string name, int duration)
Exit from timeshift mode and stop playback. The current timeshift buffer will be saved as a PVR task in file with a special extension. If parameter
Parameters:
Parameters | Available values | Description |
---|---|---|
name | Subdirectory name, where all saved data for current timeshift will be stored | |
duration | >= 0 | Time in seconds, while what it is necessary to save the stream. |
Return value:
Parameters | Available values | Description |
---|---|---|
error | int | 0 – success In other variants – false. |
TimeShift. SetSlidingMode
void SetSlidingMode(bool OnOff);
Parameters:
Parameters | Available values | Description |
---|---|---|
On/off | If «TRUE», timeshift buffer after reaching its end will lose old data. If «FALSE», timeshift buffer after reaching its end will lose new data. |
Return value:
No.