Skip to content

Instantly share code, notes, and snippets.

@georules
Created April 25, 2013 00:01
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 georules/5456577 to your computer and use it in GitHub Desktop.
Save georules/5456577 to your computer and use it in GitHub Desktop.
video o.O
{"description":"video o.O","endpoint":"","display":"div","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":true,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/NN9jZ6a.png"}
tributary.loopType = "pingpong";
tributary.duration = 4000;
tributary.init = function(g) {
var video = "http://archive.org/download/electricsheep-flock-244-72500-1/00244%3D72501%3D72109%3D72111.mp4"
var vid = g.append("video")
.attr({
src: video
})
.style({
opacity: 0.9
}).node()
// vid.play()
}
tributary.run = function(g,t) {
var vid = g.select("video").node()
var speed = 0.5 + t * 20;
vid.playbackRate = Math.abs(speed);
vid.play()
//vid.currentTime = t
//console.log(vid.duration)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment