List of usage examples for javafx.scene.media MediaPlayer MediaPlayer
public MediaPlayer(@NamedArg("media") Media media)
From source file:utybo.branchingstorytree.swing.impl.SSBClient.java
@Override public void load(final InputStream in, final String name) throws BSTException { // Write the input stream in a temporary folder try {//from w w w. ja v a2 s . co m File f = File.createTempFile("openbst" + name, ""); f.deleteOnExit(); IOUtils.copy(in, new FileOutputStream(f)); final Media m = new Media(f.toURI().toString()); resources.put(name, new MediaPlayer(m)); } catch (IOException e) { throw new BSTException(-1, "Could not create temporary file", e, "<none>"); } }
From source file:utybo.branchingstorytree.swing.impl.SSBClient.java
@Override public void load(final File file, final String name) throws BSTException { final Media m = new Media(file.toURI().toString()); resources.put(name, new MediaPlayer(m)); }