Solved

Java JMF Manager.CreatePlayer() URL format QUERY

Posted on 1997-04-02
1
1,708 Views
Last Modified: 2013-12-25
Hello,

I am trying to write an application that implements the Java JMF API
using Intel's SDK.

The query I have is how do I pass a local file name (i.e. the
location/name of my mpg/avi) to manager.createplayer() when this method
appears only to accept a complete (URL, file) parameter.

If there is a way to use getdocumentbase() for a local file system, this
would be ideal. Can I extend this and pass my own absolute directory
address instead?

Thanks.
0
Comment
Question by:weblynx
1 Comment
 
LVL 6

Accepted Solution

by:
jpk041897 earned 100 total points
ID: 1854038
The way to access local files is to use the following syntax for a url:

file:///<drive>|/path/file

where <drive> is the dos drive letter and <drive>|/ is used only under dos, not UNIX..

To Use a URL parameter, you must remember that URL is a Java class, to use it you must write code to the effects of:

URL MyURL;

try{
   MyURL = new URL("file:///C|/YourPath/Yourfile.avi);
}catch(MalformedURLException u) {
   System.out.println("Malformed URL erorr: " + u);
}

There are other options for creating URL objects. See the java docs for URL to view them.

You don't need getdocument nase() to access these files unless you are running an applet from a remote site.

Note: You probably would have recieved an answer faster if you had posted this question to the Java topic area.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now