Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Beamer Bookmarklet for Vimeo
var Beamer = {
open: function (movie) {
var beamerURL = 'beamer.control://play?url=' + escape(movie["URL"]);
if (movie["previewURL"] != null)
beamerURL += '&preview=' + escape(movie["previewURL"]);
if (movie["title"] != null)
beamerURL += "&title=" + escape(movie["title"]);
if (movie["duration"] != null)
beamerURL += "&duration=" + escape(movie["duration"]);
window.location.href = beamerURL;
},
playCallback: function(movie, error) {
if (movie == null || movie["URL"] == null) {
error = "Sorry, did not find suitable movie information to send to Beamer";
}
if (error != null) {
alert(error);
} else {
Beamer.open(movie);
}
},
playVimeoMovie: function(callback) {
var video;
for (property in window) {
if (property.match(/^clip\d+_\d+$/)) {
video = window[property].config;
break;
}
}
if (video == undefined) {
callback(null, "Could not find movie information on this page");
return;
} // else
var movie = {};
movie["previewURL"] = video["video"]["thumbnail"];
// Gather all video vars
var clip_id = video["video"]["id"];
var signature = video["request"]["signature"];
var timestamp = video["request"]["timestamp"];
var quality = video["video"]["hd"] == 1 ? "hd" : "sd";
movie["URL"] = "http://player.vimeo.com/play_redirect?clip_id=" + clip_id +
"&sig=" + signature +
"&time=" + timestamp +
"&quality=" + quality +
"&codecs=h264" +
"&type=moogaloop_local" +
"&embed_location=";
movie["title"] = video["video"]["title"] + " (" + video["video"]["url"] + ")"
movie["duration"] = video["video"]["duration"];
callback(movie);
},
run: function () {
if (window.location.href.match(/^https?:\/\/vimeo\.com\/\d+/)) {
Beamer.playVimeoMovie(Beamer.playCallback);
} else {
alert('Sorry, this bookmarklet only works on single video Vimeo pages.');
}
},
}
Beamer.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.