[vlc-devel] commit: jvlc: multiple videos on a canvas sample added (Filippo Carone )

git version control git at videolan.org
Fri Aug 29 11:41:50 CEST 2008


vlc | branch: master | Filippo Carone <littlejohn at videolan.org> | Mon Aug 25 16:30:54 2008 +0200| [15bb8c9f0c319c5c727cd789e3dcc9a85b4cffa5] | committer: Filippo Carone 

jvlc: multiple videos on a canvas sample added

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=15bb8c9f0c319c5c727cd789e3dcc9a85b4cffa5
---

 .../client/src/main/java/MultipleVideosSample.java |   90 ++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/bindings/java/samples/client/src/main/java/MultipleVideosSample.java b/bindings/java/samples/client/src/main/java/MultipleVideosSample.java
new file mode 100644
index 0000000..9601af1
--- /dev/null
+++ b/bindings/java/samples/client/src/main/java/MultipleVideosSample.java
@@ -0,0 +1,90 @@
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JPanel;
+
+import org.videolan.jvlc.JVLC;
+
+/*****************************************************************************
+ * MultipleVideosSample.java: VLC Java Bindings
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo at carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+public class MultipleVideosSample
+{
+
+    private static int videosNumber = 6;
+    private static String filename ="/home/carone/a.avi";
+    
+    public static void main(String[] args) throws Exception
+    {
+        Frame frame = new java.awt.Frame();
+        frame.setBounds(0, 0, 600, 700);
+        JPanel jvcc = new JPanel();
+        Canvas[] videoCanvasesArray = new Canvas[videosNumber];
+        frame.add(jvcc);
+        
+        if (args.length > 0)
+        {
+            filename = args[0];
+        }
+        
+        for (int i = 0; i < videosNumber; i++)
+        {
+            Canvas jvlcCanvas = new Canvas();
+            videoCanvasesArray[i] = jvlcCanvas;
+            jvlcCanvas.setSize(200, 200);
+            jvlcCanvas.setBackground(new Color(0x0));
+            jvcc.add(jvlcCanvas);
+        }
+        
+        frame.addWindowListener(new WindowAdapter()
+        {
+
+            @Override
+            public void windowClosing(WindowEvent ev)
+            {
+                System.exit(0);
+            }
+        });
+        
+        frame.setVisible(true);
+        JVLC[] jvlcArray = new JVLC[videosNumber];
+        for (int i = 0; i < videosNumber; i++)
+        {
+            JVLC jvlc = new JVLC();
+            jvlcArray[i] = jvlc;
+            jvlc.setVideoOutput(videoCanvasesArray[i]);
+        }
+        
+        for (int i = 0; i < videosNumber; i++)
+        {
+            jvlcArray[i].play(filename);
+            Thread.sleep(500);
+        }
+    }
+    
+}




More information about the vlc-devel mailing list