How to access local media file on my computer in JavaFX?


Question

How to access local media file on my computer in JavaFX?

Here are the urls I tried:

C:/PROJECT/videos/on2tm_352.flv
file:///C://PROJECT/videos/on2tm_352.flv (suggested in some site forgot where)

It does play however, when I put the media file inside the project's folder and access it using {__DIR__}/on2tm_352.flv

Note: There are no exceptions and errors outputted. The screen is just blank.

KLite Codec 583 Mega, JavaFX 1.2, Netbeans 6.8 are used

1
1
6/15/2010 3:27:45 PM

It is working right now for me:

private static final String MEDIA_URL = "file:/c:/Users/Alejandro/Downloads/oow2010-2.flv";

I tested it a few minutes ago....

or something like that:

private File file = new File("c:/Users/Alejandro/Downloads/oow2010-2.flv");
private final String MEDIA_URL = file.toURI().toString();

See you later =D

5
8/28/2013 3:43:24 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon