Skip to content

Instantly share code, notes, and snippets.

@ksky
Created November 13, 2011 16:00
Show Gist options
  • Select an option

  • Save ksky/1362259 to your computer and use it in GitHub Desktop.

Select an option

Save ksky/1362259 to your computer and use it in GitHub Desktop.

Revisions

  1. ksky revised this gist Nov 13, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion media.groovy
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ GroovyFX.start {
    sg.stage(title: "MediaView Demo", width: 640, height: 380, visible: true) {
    scene(fill: black) {
    mview = mediaView(fitWidth: 640, fitHeight: 380) {
    player(autoPlay: true, source: "***動画ファイル(.flv)へのURL***")
    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)
  2. ksky created this gist Nov 13, 2011.
    28 changes: 28 additions & 0 deletions media.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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: "***動画ファイル(.flv)へのURL***")
    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()
    }
    }
    }
    }
    }