Created
November 13, 2011 16:00
-
-
Save ksky/1362259 to your computer and use it in GitHub Desktop.
Playing movie by GroovyFX
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
import groovyx.javafx.* | |
GroovyFX.start { | |
def sg = new SceneGraphBuilder() | |
sg.stage(title: "MediaView Demo", width: 640, height: 380, visible: true) { | |
scene(fill: black) { | |
mview = mediaView(fitWidth: 640, fitHeight: 380) { | |
player(autoPlay: true, source: "<URL to movie file(.flv)>") | |
transition = parallelTransition { | |
rotateTransition(5.s, from:0, to:360) | |
fadeTransition(5.s, from:0.0, to:1.0) | |
scaleTransition(5.s, from:0.0, to:1.0) | |
} | |
} | |
onKeyReleased { e -> | |
println "media key: ${e.text}" | |
if (e.text == 's') { | |
mview.effect = (mview.effect) ? null : sepiaTone() | |
} else if (e.text == 'b') { | |
mview.effect = (mview.effect) ? null : gaussianBlur(radius:30) | |
} else if (e.text == 't') { | |
transition.playFromStart() | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment