Last active
August 29, 2015 14:02
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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