|
Code issue, Using Json and Oembed for Vimeo
So i am trying to use Oembed and Json to automatically embed the newest Vimeo video from my channel on the homepage of my website. I got it to embed the video and all but the problem is resizing the video. It always comes in too big and i can't figure out how to fix it. Here is what i have, any help would be great!
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$.getJSON('http://vimeo.com/api/v2/gavinrudy/videos.json?callback=?', {format: "json"}, function(videoList) {
$.getJSON('http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/' + videoList[0].id + '&byline=false&portrait=false&callback=?', {format: "json", "width": 900,}, function(videoProperties) {
document.getElementById("vimeoRecent").innerHTML=videoProperties.html
document.getElementById("vimeoDescription").innerHTML="<p><a href='" + videoList[0].url + "'>" + videoProperties.title + "</a> from <a href='" + videoProperties.author_url + "'>" + videoProperties.author_name + "</a> on <a href='http://vimeo.com'>Vimeo</a>.</p><p>" + videoProperties.description + "</p>"
});
});
});
</script>
|