Thursday, February 16, 2012

Will JavaFX support Camera (and Microphone) with a developer friendly API?

With all the props that go to the upcoming release of JavaFX 2.x I tried to find out the status of the media components in JavaFX.
Looking at other platforms first:
- Flash: Camera / Microphone: See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/package-detail.html really extended support, at least Adobe claims they support it on all devices (although of course there might be always slight glitches if you use some exotic webcam on Linux). They pretty much can support any DESKTOP device. And that is what makes you wonder: What about mobile platform? They just cancelled further development of Flash Mobile ( see: http://blogs.adobe.com/conversations/2011/11/flash-focus.html ).
- Silverlight: Camera / Microphone access was introduced in Silverlight 4, however I honestly can't say how widespreaded the support on devices accross platforms is, as I hardly know any application that use Silverlight on Mac or even Linux to capture Cam/Mic. However there are noticeable offerings of VOD providers (Maxdome in Germany for example) that use the Silverlight platform as it seems to have a good integration of DRM tools ( see: http://msdn.microsoft.com/en-us/library/cc838192%28v=vs.95%29.aspx ). However the programming model is still shaped for .NET and Microsoft simply can't expect that every Web-Programmer now becomes a .NET programmer.
- HTML5: There is the Video component in HTML5, and its the only cross-platform video-playback that works on mobile devices as well as on desktop (although the playback lacks on many features) . However the access to camera and microphone is in very early stages and it is not clear at all if one day browser vendors will agree on a codec for the transmission of the captured data from the device.

Now looking at JavaFX:
They build some playback components to playback video. Additionally the JavaFX API ( http://docs.oracle.com/javafx/2.0/api/index.html ) has a Camera object, however it seems to have nothing to do with a "webcam", it is an internal object used to render the UI. There is also no Microphone access. The plan seems to be like leaving this as opportunity to the users to program their own drivers to access the cam/mic. By looking at the way JMF was not developed since almost 10 years and all the negative feedback (or even "ANTI" (or counter-revolutionary) projects like FMJ ( http://fmj-sf.net/ ) I doubt that this is an opportunity lot of people will consider.

Btw: You can also participate in the discussion in the Jira issue at the JavaFX bugtracker: http://javafx-jira.kenai.com/browse/RT-3458 Vote for it! :)