Solved

Java JMF Manager.CreatePlayer() URL format QUERY

Posted on 1997-04-02
1
1,744 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

832 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