Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get Thumbnails from Vimeo

Posted on 2010-11-21
2
Medium Priority
?
1,942 Views
Last Modified: 2012-05-10
Have a simple video gallery on my site created with classic asp.
Database contains video title and the video url from vimeo.

I have been able to get the actual video to display but not sure how to get the thumbnails for the videos.

I have a page which shoud list my video titles with thumbnails.
There is a method to get the url of the thumbnails:
http://vimeo.com/api/docs/methods/vimeo.videos.getThumbnailUrls
but I don't know how I get to use the actual url which is returned.  

0
Comment
Question by:harris9999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Proculopsis earned 2000 total points
ID: 34186062

The json format response should drop into your javascript nicely, as in the following simulation:

<html>
<head>
<title>http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q__26630467.html</title>

<script>

window.onload = function()
{
  var vimeo;
  eval( "vimeo = " + document.getElementById("thumbnail").innerHTML );

  var image = new Image();
  image.src = vimeo.thumbnail[2]._content;
  image.height = vimeo.thumbnail[2].height;
  image.width = vimeo.thumbnail[2].width;

  document.body.appendChild( image );
}
</script>

<style>
#code { width: 145px; height: 100px; border: 1px solid red; }
</style>

</head>

<body>

vimeo.videos.getThumbnailUrls<br />
JSON<br />
Response<br />
<div id="code">
<pre id="thumbnail" >
{
  "thumbnail":[
    {
      "height":"75",      "width":"100",      "_content":"http://www.opendns.com/dashboard/img/placeholder_md.gif"    },
    {
      "height":"150",      "width":"200",      "_content":"http://www.opendns.com/dashboard/img/placeholder_md.gif"    },
    {
      "height":"200",      "width":"300",      "_content":"http://www.opendns.com/dashboard/img/placeholder_sm.gif"    }
  ]
}
</pre>
<div>

</body>

</html>

Open in new window

0
 
LVL 3

Author Comment

by:harris9999
ID: 34187376
Ok I kind of undertsand how that works.
Now trying to combine it all.
Code started with below. Been playing with it but unsuccessful so far to get the thumbnails from the vimeo urls.
<html>
<head>
<title>http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q__26630467.html</title>

<script>

window.onload = function()
{
  var vimeo;
  eval( "vimeo = " + document.getElementById("thumbnail").innerHTML );

  var image = new Image();
  image.src = vimeo.thumbnail[0]._content;
  image.height = vimeo.thumbnail[0].height;
  image.width = vimeo.thumbnail[0].width;

  document.body.appendChild( image );
}
</script>

<style>
.video{ margin-bottom:20px;}
#code { width: 145px; height: 100px; border: 1px solid red; }
</style>

</head>

<body>

vimeo.videos.getThumbnailUrls<br />
JSON<br />
Response<br />
<div id="code">
<pre id="thumbnail" >
{
  "thumbnail":[
    {
      "height":"75",      "width":"100",      "_content":"http://www.opendns.com/dashboard/img/placeholder_md.gif"    },
    {
      "height":"150",      "width":"200",      "_content":"http://www.opendns.com/dashboard/img/placeholder_md.gif"    },
    {
      "height":"200",      "width":"300",      "_content":"http://www.opendns.com/dashboard/img/placeholder_sm.gif"    }
  ]
}
</pre>
</div>
<%
dim vidtitle(3)
vidtitle(1)="Video 1"
vidtitle(2)="Video 2"
vidtitle(3)="Video 3"

dim vidurl(3)
vidurl(1)="http://vimeo.com/11436985"
vidurl(2)="http://vimeo.com/16871362"
vidurl(3)="http://vimeo.com/16894558"


for i=1 to 3
%>

<div class="video">
	<div class="videotitle"><%=vidtitle(i)%></div>
	<div class="videotitle"><%=vidurl(i)%></div>
	<div class="videothumbnail"></div>
</div>

<%
next
%>

</body>

</html>

Open in new window

0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question