Tung Pham
Tung Pham

Reputation: 31

How to get veoh video thumbnail using PHP

I am developing a wordpress plugin VIDEO LIST MANAGER: http://wordpress.org/extend/plugins/video-list-manager/

I don't know if veoh supports us to get a veoh video thumbnail. I want to add VEOH to my plugin and what i need are: 1. embed link (yes) 2. thumbnail image (no)

Please help me!

Thanks

Upvotes: 1

Views: 942

Answers (1)

AndreKR
AndreKR

Reputation: 33658

If you have the link to the video, e.g. http://www.veoh.com/watch/abcdef123456 you first need to use the API method veoh.video.findByPermalink to get the video ID:

http://www.veoh.com/rest/v2/execute.xml?method=veoh.video.findByPermalink
                                       &permalink=abcdef123456
                                       &apiKey=12345678-1234-...

You will get an XML of this structure:

<rsp>
  <videoList offset="0" items="1" numItems="1">
    <video videoId="12345" ... >
    ...

With that video ID you can then use the API method veoh.video.getVideoThumbnails to get thumbnails of that video:

http://www.veoh.com/rest/v2/execute.xml?method=veoh.video.getVideoThumbnails
                                       &videoId=12345
                                       &apiKey=12345678-1234-...

You will get an XML of this structure:

<rsp>
  <thumbList offset="0" items="33" numItems="10">
    <thumbnail lowResImage="http://....jpg" highResImage="http://....jpg">
    </thumbnail>
    <thumbnail lowResImage="http://....jpg" highResImage="http://....jpg">
    </thumbnail>
    ...

The API is really easy to use, for a complete list of methods see the documentation.

Upvotes: 1

Related Questions