...
REST-methods and response statuses
REST-method | Example of the REST query | Example of the REST response body | Response statuses | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/stream/snapshot |
|
| 200 - Snapshot is taken 404 - Stream not found 500 - Snapshot taking error |
Parameters
Parameter name | Description | Example |
---|---|---|
streamName | Unique stream name | 64966f33 |
data | Snapshot file encoded to base64 | iVBORw0KGgoAAAANSUhEUgAAAUAAAADwCAYAAABxLb1rAAAACXBIWXMAAAAAAAAAAQCEeRdzAAAQA |
Sending the REST query to the WCS server
To send the REST query to the WCS server you need to use a REST-client.
Configuration
Since build 5.2.1116, a maximum snapshot taking duration, including a possible server disk I/O delay, may be configured when taking snapshot via REST API. By default, maximum duration is set to 3000 ms, and 30 checks if snapshot file is ready will be performed during this interval
Code Block | ||
---|---|---|
| ||
snapshot_taking_interval_ms=3000
snapshot_taking_attempts=30 |
If the snapshot file is not ready, and the interval is expired, /stream/snapshot request will return the following error
Code Block | ||||
---|---|---|---|---|
| ||||
{
"exception": "com.flashphoner.rest.server.exception.InternalErrorException",
"reason": "com.flashphoner.rest.server.exception.InternalErrorException, Internal Server Error, Snapshot response timeout, ts: 1640836780816, path: /rest-api/stream/snapshot",
"path": "/rest-api/stream/snapshot",
"error": "Internal Server Error",
"message": "Snapshot response timeout",
"timestamp": 1640836780816,
"status": 500
} |
JavaScript API
The snapshot method of the Stream object in WebSDK is intended to take stream snapshots. Example of use of this method can be found in the Stream Snapshot web applications that publishes a stream and take a snapshot.
...