This section covers the API invocations related to previews and thumbnails in Zoom.
All JSON responses contain these standard fields:
Get Preview or Thumbnail
Description:
Get thumbnail or preview associated with an asset version.
Request URL:
http://192.168.1.6:8873/review/preview/assetPreview
If param “resolution” is absent or is set to 0, then the request just fetches a small thumbnail; otherwise, it fetches the preview at the specified resolution.If you specify the resolution as -1, it will return a copy of the original asset.
Sample URL with url encoded query string parameters:
Request parameters to get thumbnail:
“bid” : int
“fuid” : int
“rrn” : long
“frn” : int
fqPath:String
Using Ls command or other Zoom commands, or using the Find Web API, the above parameters can be fetched for an asset.
Response:
<Streamed thumbnail>
Request parameters to get preview:
“bid” : int
“fuid” : int
“rrn” : long
“resolution” : int // requested resolution minimum (height, width), aspect ratio automatically maintained
“aspectRatio”:”true”|”false”
“fqPath” : String
“filename”:String // base file name
Response:
<Streamed preview>
or
HTTP error code 404 if failed to create preview
or
HTTP error code 449 to retry if resources are unavailable.
Generate Default Preview
It is possible to trigger default preview generation for some assets on Preview server. For video assets only FLV file format is supported and for images only JPEG file format is supported.
The follow URL can be used to trigger the preview generation:
To trigger the default preview generation for video files, following parameters has to be passed to above URL
zm_server = http://<YOUR-ZOOM-SERVER>:8880
zm_username = <USER NAME>
zm_password = <USER PASSWORD>
bid = 1
Default is 1.
fuid = 227 (Asset id of which preview generation needs to be triggered)
rrn = 197 (Repository Revision Number aka RRN. Revision number on which asset has changed)
aspectRatio = true
resolution = 480 (Default preview generation resolution.)
- This value must be same as the value specified in “Preview/Review Server Settings” in Zoom web management console.
fqName = <Full path to Asset on Zoom server>
- /defproj/acme/video/cartoon.mp4
fileType = FLV
For e.g: To trigger the preview generation for asset: “/defproj/acme/video/cartoon.mp4” with id 304 at RRN: 10, following url has to be created:
http://192.168.0.144:8873/review/preview/assetPreview?
zm_server=http://192.168.0.144:8880&
zm_username=admin&
zm_password=admin&
bid=1&
fuid=304&
rrn=10&
aspectRatio=true&
resolution=480&
fqName=/defproj/acme/video/cartoon.mp4&
fileType=FLV
Response on the above URL is the actual FLV file, streamed using HTTP protocol. Above request will block till the preview is generated. If you just want to trigger the preview generation, then set some lower value timeout, so that connection is break after triggering the call.