Skip to content

Instantly share code, notes, and snippets.

@kou
Created November 3, 2012 00:06
Show Gist options
  • Save kou/4005155 to your computer and use it in GitHub Desktop.
Save kou/4005155 to your computer and use it in GitHub Desktop.
Rabbit Video
include_theme("default")
proc_name = "video"
$showing = false
$pid = nil
match(SlideElement) do |slides|
slides.delete_post_draw_proc_by_name(proc_name)
slides.add_post_draw_proc(proc_name) do |slide, canvas, x, y, w, h, simulation|
unless simulation
if slide.title == "video"
unless $showing
url = slide.body.text.strip
$pid = Process.spawn("chromium", "--app=#{url}")
canvas.window.keep_above = false
$showing = true
end
else
if $showing
canvas.window.keep_above = true
Process.kill("INT", $pid)
Process.detach($pid)
$showing = false
end
end
end
[x, y, w, h]
end
end
= Video
: author
Kouhei Sutou
: theme
video
= video
http://www.youtube.com/watch?v=psuRGfAaju4
= not video
hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment