JDK-8088930 : Inconsistent API between Media and Image class
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: fx2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2011-07-10
  • Updated: 2018-09-06
  • Resolved: 2017-04-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
The Image class has several constructors so that you can load an image from a file or a stream in addition to an URL, whereas the Media class only supports loading from an URL. Why is there such an inconsistency? The javadoc also has a little bug. The parameter is currently called "source" but in the parameter description it is named "sourceURI".
Comments
Camera and Microphone support are covered by a different feature in JavaFX: RT-3458 and similar ones. As for implementing RT-26823 (InputStream) I think we can expose an internal API (ConnectionHolder) that allows arbitrary input (not only input stream) but we need to get SQE ok for this to have it in 8.0. Changing javadoc only is an easy thing to have it in 8.0. If it's about changing APIs then I'll close this issue as a duplicate of RT-26823. If you need InputStream support I urge you to watch RT-26823 and discuss possible solutions there.
04-09-2013

Do I understand correctly, that with this fix, we would be able to do a live voice or video chat, by passing in the stream from a camera or microphone? Given that we somehow get access to a mic or camera signal. But Java Sound should at least provide a microphone stream. That would be great :-)
04-09-2013

If it is easy to do I don't have any problem with it.
03-09-2013

If anybody would ask me I would vote "It's not too late". This issue has 8 votes and many related issues and should be easy to fix. It is waiting for a fix since two years now.
03-09-2013

That's the question to answer but looks like change to javadoc wouldn't remove inconsistency so something should be done in API. If it is not too late. The question is can we fix the inconsistency before it is too late or it is already too late.
03-09-2013

What exactly is necessary to do here ? Add a stream constructor or change the javadoc ? If the earlier then it's a feature planned to jdk 9. See RT-26823.
03-09-2013

I don't have bandwidth to look into this. Is Kirill not able to do so?
03-09-2013

Richard, could you please take a look?
03-09-2013

We would really need this feature as our media files come from a encrypted container that only hands out InputStreams for the mp3 files.
24-11-2011