diff options
author | Sven Gothel <[email protected]> | 2012-05-02 01:57:09 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-02 01:57:09 +0200 |
commit | 6710acebee541a843a6f546300bea885e437b986 (patch) | |
tree | 50ee839a7a090fcf1161e29af47527b5b236858d /src | |
parent | 935523a8c58efced1c0845bd60e08e2acb9e5aee (diff) |
Test MovieCube: Allow recreation - Video is still not visible after recreation (detach window) on OSX (FF, Safari)
Diffstat (limited to 'src')
-rwxr-xr-x | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java index 557cf28d7..bb0d84193 100755 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java @@ -64,11 +64,10 @@ import com.jogamp.opengl.util.av.GLMediaPlayerFactory; public class MovieCube implements GLEventListener, GLMediaEventListener { static boolean waitForKey = false; - GLWindow window; - boolean quit = false; + final URLConnection stream; + final float zoom0, rotx, roty; TexCubeES2 cube=null; GLMediaPlayer mPlayer=null; - URLConnection stream = null; public MovieCube() throws IOException { this(new URL("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4").openConnection(), @@ -77,9 +76,9 @@ public class MovieCube implements GLEventListener, GLMediaEventListener { public MovieCube(URLConnection stream, float zoom0, float rotx, float roty) throws IOException { this.stream = stream; - mPlayer = GLMediaPlayerFactory.create(); - mPlayer.addEventListener(this); - cube = new TexCubeES2(mPlayer, false, zoom0, rotx, roty); + this.zoom0 = zoom0; + this.rotx = rotx; + this.roty = roty; } private final KeyListener keyAction = new KeyAdapter() { @@ -136,6 +135,10 @@ public class MovieCube implements GLEventListener, GLMediaEventListener { GL2ES2 gl = drawable.getGL().getGL2ES2(); System.err.println(JoglVersion.getGLInfo(gl, null)); + mPlayer = GLMediaPlayerFactory.create(); + mPlayer.addEventListener(this); + cube = new TexCubeES2(mPlayer, false, zoom0, rotx, roty); + if(waitForKey) { BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); System.err.println("Press enter to continue"); |