method-videos-setThumbnail
Last edited: August 6th, 2009 by Colin DevroeChoose a thumbnail based on a moment in time in a video. This feature will select the nearest keyframe to the point given and create a new thumbnail.
To send an image file to Viddler’s servers use POST method with Content-Type: multipart/form-data (RFC1867).
Due to the caching methods of our service, it will take a few minutes for the new thumbnail to propagate to our entire network.
Note: ALL arguments are required.
Authenication
This method requires authentication with viddler.users.auth API method.
Arguments
- method
- Should be set to “Viddler.videos.setThumbnail”
- api_key
- Assigned Viddler API Key
- sessionid
- Current session in generated by calling viddler.users.auth method
- video_id
- The ID of the video which you want to update
- timepoint
- Time in seconds from 0 to video length (int).
- file
- An image file to use as the static thumbnail. JPG, GIF, PNG supported.
Notes
- Invalid arguments will be ignored
- Time point must be in seconds and be a valid integer.
- To improve thumbnail generation increase the number of keyframes in the video uploaded.
- Due to caching, a new thumbnail make take a few minutes to propagate throughout the network.
- If both timepoint and file are sent, timepoint is ignored.
- Image files should be the same dimensions as the video. Larger image files will be automatically scaled down.
- Max thumbnail size is 400 KB. Anything larger results in Error 200.
Example Call
http://www.viddler.com/api_rest?method=viddler.videos.setDetails&apki_key=12345678&sessionid=12345678video_id=12345678&timepoint=90
Example Response
This method will respond with the thumbnail URLs for the brand new thumbnails. The URLs are available immediately, but the Flash player will not use the new files until the cache is expired.
<?xml version="1.0" encoding="UTF-8"?><thumbnail> <small>http://cdn-thumbs.viddler.com/thumbnail_0_65e76a73.jpg?ver=2</small> <medium>http://cdn-thumbs.viddler.com/thumbnail_1_65e76a73.jpg?ver=2</medium> <snapshot>http://cdn-thumbs.viddler.com/thumbnail_2_65e76a73.jpg?ver=2</snapshot> </thumbnail>