Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Java JMF Manager.CreatePlayer() URL format QUERY

Posted on 1997-04-02
1
Medium Priority
?
1,836 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 300 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

926 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