Poster Images and Video Information API
Poster image is the image that is shown to the viewer before a video is loaded. By default, a shot from the video at a random time is taken and converted into posters of different sizes. It may be customized to better appeal to the viewers. You can use the API to auto upload new poster images.
Obtain video informationβ
Send an HTTP GET request to https://dev.vdocipher.com/api/meta/{{videoID}}
to receive response from this API. The response contains detailed structure about the video including the URL to download the poster images.
The URL is valid for long-time and is backed by a CDN. This means you can directly save this URL and use it to display video thumbnail of the video on your website or mobile app.
Sample Code for Video Listβ
The sample video ID is written as {{videoID}}
. Replace this with your video ID.
- CURL
- NODE
- PHP
- C#
- Python
- Ruby
curl -X GET \
https://dev.vdocipher.com/api/meta/{{videoID}} \
-H 'Accept: application/json'
var request = require('request');
var options = {
method: 'GET',
url: 'https://dev.vdocipher.com/api/meta/{{videoID}}',
headers: {Accept: 'application/json'},
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://dev.vdocipher.com/api/meta/{{videoID}}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Accept: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var client = new RestClient("https://dev.vdocipher.com/api/meta/{{videoID}}");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
IRestResponse response = client.Execute(request);
import requests
url = "https://dev.vdocipher.com/api/meta/{{videoID}}"
headers = {
'Accept': "application/json"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://dev.vdocipher.com/api/meta/{{videoID}}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
response = http.request(request)
puts response.read_body
Sample Responseβ
Below is a sample response from the meta API. The duration is in seconds.
{
"title": "Waves.mp4",
"duration": 21,
"aspectRatio": 1.77778,
"posters": [
{
"url": "https://dmf9cnjua2s32.cloudfront.net/poster/VY4txxGMG8agW.240.jpeg",
"height": 240
},
{
"url": "https://dmf9cnjua2s32.cloudfront.net/poster/VY4txxGMG8agW.480.jpeg",
"height": 480
},
{
"url": "https://dmf9cnjua2s32.cloudfront.net/poster/VY4txxGMG8agW.720.jpeg",
"height": 720
}
]
}