MovieView can play movies such as .mov and mpg, and image files like jpg, png, tiff and others.
JSCMovieView is currently based on the Java Media Framework (JMF) which is not part of the standard java environment (Java SE) but needs to be installed separately. There is a reference implementation from Sun available for Linux, Windows and Mac OS X. It can be downloaded from http://java.sun.com/products/java-media/jmf/index.jsp (note: for Mac OS X you need the generic cross-platform version).
The reference implementation has rather poor media support (check this page: http://java.sun.com/products/java-media/jmf/2.1.1/formats.html ), so you might need to convert your movies or look out for extra JMF plug-ins. A really good plug-in is fobs4j !(ffpmeg objects for java) -> http://fobs.sourceforge.net/ ! You need to install the "jmf.jar" file in your system's java extensions folder, e.g. on Mac OS X that's "/Library/Java/Extensions". For fobs, do the same with "fobs4jmf.jar" and copy "jmf.properties" into "SwingOSC/build".
(in the future, FMJ (freedom for media in java) might be an alternative: http://fmj-sf.net)
The path to the movie.
Go to frame.
The frame index; an Integer. |
A Boolean. |
An Integer. |
A Boolean. |
Possible loop modes:
One of the above Integers. |
An instance of Float. 1.0 is the normal rate. |
A Boolean. |
The current time.
Defaults to |
show |
A Boolean. Default is |
adjust |
A Boolean. Default is |
Resizes the whole view, adjusts its contents.
size |
A Float. |
A Boolean. |
( w = Window("mov").front; b = Button(w, Rect(0, 0, 150, 20)) .states_([["pick a file"]]) .action_({ File.openDialog("", { |path| m.path_(path) }) }); m = MovieView(w, Rect(0,20,360, 260)); ) // random-pick a tiff from the Help folder m.path_("Help/*/*/*.tiff".pathMatch.choose); // or point it to a movie (you may have that one too): m.path_("/Library/Application\ Support/iDVD/Tutorial/Movies/Our\ First\ Snowman.mov"); m.start; // playback m.muted_(false); // thank god m.stop; //rate m.rate_(1); // backwards m.gotoEnd.rate_(-1).start; // select a range on the controller and play it m.rate_(1).playSelectionOnly_(true).start; // loopModes: m.loopMode_(1); // only one direction m.loopMode_(0).start; // back and forth m.stop; m.gotoBeginning; // single steps m.stepForward; 10.do { m.stepForward; }; m.stepBack; // select with shift-drag, copy paste between movieviews or quicktime player m.editable_(true); m.showControllerAndAdjustSize(true, true); // resize compared to image size: m.resizeWithMagnification(0.25); //goto time (in seconds) m.currentTime_(1); // not there yet, but would be nice to have: // startFrame, length m.setSelection_(20, 15); m.frame_(frame); // jump to frame m.frame.postln; // poll current frame pos