Created
November 3, 2012 00:06
-
-
Save kou/4005155 to your computer and use it in GitHub Desktop.
Rabbit Video
This file contains hidden or 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
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 |
This file contains hidden or 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
= 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