File tree Expand file tree Collapse file tree
java/libraries/video/src/processing/video Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 * @usage application
5353 */
5454public class Movie extends PImage implements PConstants {
55+ public static String [] supportedProtocols = { "http" };
56+
5557 protected String filename ;
5658
5759 protected boolean playing = false ;
@@ -681,18 +683,21 @@ protected void initGStreamer(PApplet parent, String filename) {
681683 e .printStackTrace ();
682684 }
683685 }
684-
685- // Network read...
686- if (gplayer == null && filename .startsWith ("http://" )) {
687- try {
688- PApplet .println ("network read" );
689- gplayer = new PlayBin2 ("Movie Player" );
690- gplayer .setURI (URI .create (filename ));
691- } catch (Exception e ) {
692- e .printStackTrace ();
693- }
694- }
695-
686+
687+ if (gplayer == null ) {
688+ // Try network read...
689+ for (int i = 0 ; i < supportedProtocols .length ; i ++) {
690+ if (filename .startsWith (supportedProtocols [i ] + "://" )) {
691+ try {
692+ gplayer = new PlayBin2 ("Movie Player" );
693+ gplayer .setURI (URI .create (filename ));
694+ break ;
695+ } catch (Exception e ) {
696+ e .printStackTrace ();
697+ }
698+ }
699+ }
700+ }
696701 } catch (SecurityException se ) {
697702 // online, whups. catch the security exception out here rather than
698703 // doing it three times (or whatever) for each of the cases above.
You can’t perform that action at this time.
0 commit comments