Skip to content

Instantly share code, notes, and snippets.

@rchacon
Last active August 29, 2015 14:02
Show Gist options
  • Save rchacon/45fe20d6e7abf87693cc to your computer and use it in GitHub Desktop.
Save rchacon/45fe20d6e7abf87693cc to your computer and use it in GitHub Desktop.
Using jQuery and vimeo's REST API to fetch a video's description
<div id="video-container"></div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var vimeoId = 98357626;
// get description of video from vimeo
$.getJSON("http://vimeo.com/api/v2/video/" + vimeoId + ".json", function (videos) {
$("#video-descr").html(videos[0].description);
});
$("#video-container").html("<iframe src='http://player.vimeo.com/video/"
+ vimeoId + "' frameborder='0' webkitAllowFullScreen mozallowfullscreen "
+ " allowFullScreen></iframe><p id='video-descr'></p>");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment