Skip to content

Instantly share code, notes, and snippets.

@gcoop
Created June 24, 2011 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcoop/1044668 to your computer and use it in GitHub Desktop.
Save gcoop/1044668 to your computer and use it in GitHub Desktop.
Plays an array of vimeo videos in a row. Just full screen the browser, sit back and relax.
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<iframe id="player_1" src="http://player.vimeo.com/video/25498609?api=1&amp;player_id=player_1" width="100%" height="100%" frameborder="0"></iframe>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
var videos = [
25498609,
25500978,
25355113,
25295347,
25299330,
25233650,
25069423
];
(function () {
var vimeoPlayer = document.querySelectorAll('iframe')[0],
currentVideo = 0,
currentPlayerId;
var playerReady = function (player_id) {
console.log("READY GO GO GO");
currentPlayerId = player_id;
var thePlayer = $f(player_id);
thePlayer.addEvent("finish", playNextVideo);
thePlayer.api("play");
};
var playNextVideo = function (data) {
currentVideo++;
vimeoPlayer.src = "http://player.vimeo.com/video/"+videos[currentVideo]+"?api=1&player_id="+currentPlayerId;
}
$f(vimeoPlayer).addEvent("ready", playerReady);
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment