Steve On Java

Hacking JavaFX and Java with Agility
  • rss
  • Home
  • About
  • Contact
  • SvJugFX
  • Prize Spinner

Live Video Streaming Guide – Part 2 : Hardware

steveonjava | March 6, 2010

This is the second installation of my Live Streaming Guide, which will go over all the hardware you need to get setup.  While you can spend tens of thousands of dollars on professional gear, it is possible to put together a high quality setup for a fraction of that cost.  You may also be able to reuse some of your existing hardware, further reducing the cost.

This setup is targeted at streaming a live presentation over the internet that includes a speaker and possibly some slides or a demo.  Not all of this hardware is required to get started, so I will present it in order of how critical it is to the quality of the presentation.

If you are just interested in knowing what I recommend and how much it will run you, skip to the Buying Guide.

Choosing a Camcorder

The first thing you will need is a camcorder to stream the video.  The reason to go with a camcorder rather than a webcam is that you will have more options for lenses and zooming, and will be able to get a much higher resolution (as high as 1920×1080 for HD).  HD camcorders are pretty common and fairly inexpensive; a good one can be bought new for around $600.  Also, chances are that you or someone you know already has one that you can take advantage of.

One important consideration for camcorders is the computer interface.  If the camcorder supports Firewire (IEEE 1394), you are in pretty good shape.  This means it will probably support DV or HDV streaming to a laptop that has Firewire, and video streaming software will automatically pick it up as an input device.  A popular model for doing video streaming is the Canon Vixia HV40 which can be purchased for around $650 new:

Canon Vixia HV40

Read the rest of this entry »

 
Comments
1 Comment »
Categories
Events, Video
Tags
Event, streaming, Video
Comments rss Comments rss
Trackback Trackback

Launching Hyperlinks from JavaFX (including Mobile)

steveonjava | March 4, 2010

Creating hyperlinks in JavaFX should be in the category of things that are trivially easy, but is complicated by various factors, such as deployment mode and Java version. First I will go into detail on all the different permutations of how you can launch links in a browser and under what circumstances each will work. Next I will give you a nice packaged solution that you can use as a library (if you are impatient, just skip to The Easy Way Out now).  Finally, I will show how you can do the same thing for JavaFX Mobile applications.

A Tale of 3 APIs

There are 3 different ways that you can launch hyperlinks in Java/JavaFX. Unfortunately, none of them work in all circumstances, so you need to know when to call each. Here is a quick reference table:

AppletStageExtensionWeb Start BasicServiceDesktop.browse
Works in AppletYesYesYes
Works in Web StartNoYesYes
Works in ApplicationNoNoYes
Works on Java 1.5YesYesNo
Can Set TargetYesNoNo
Default Target_self_blank_self

AppletStageExtension

The first option is to use the JavaFX AppletStageExtension. This is only available if you are running as an Applet, but also gives you the most control over how the hyperlink is launched.  In addition to a URL you can also specify a target, which can be any of the standard HTML targets including the following (excerpted from the AppletStageExtension javadocs):

Target ArgumentDescription
"_self"Show in the window and frame that contain the applet.
"_parent"Show in the applet’s parent frame. If the applet’s frame has no parent frame, acts the same as “_self”.
"_top"Show in the top-level frame of the applet’s window. If the applet’s frame is the top-level frame, acts the same as “_self”.
"_blank"Show in a new, unnamed top-level window.
nameShow in the frame or window named name. If a target named name does not already exist, a new top-level window with the specified name is created, and the document is shown there.

Web Start BasicService

The second option is to use the Web Start BasicService.  This works from both JavaFX Applets and Web Start applications, but does not let you specify the HTML target.  It is effectively the same as using the AppletStageExtension with a target of “_blank”.

Here is a small code excerpt showing how you would call the Web Start BasicService from your JavaFX code:

def basicService = ServiceManager.lookup("javax.jnlp.BasicService") as BasicService;
basicService.showDocument(new URL(url));

Desktop.browse

The third option is to use the new Desktop class introduced in Java 1.6.  This works from Applet, Web Start applications, and Standard Execution (within a desktop Frame).  Unfortunately, it did not exist in Java 1.5, so it won’t work from JavaFX without a little hacking.

The quick and dirty hack is to modify your JavaFX distribution to include the rt.jar from Java 1.6 as explained in this earlier post.  The only problem with this is you also have to get all the other developers on your project to do the same (and redo this on every upgrade).

The friendlier approach is to use reflection to check and see if the Desktop class is available, and then invoke the methods dynamically.  There is quite a bit more boilerplate code, but it will allow you to compile with a plain vanilla JavaFX installation, and also handle the odd case where someone is trying to run JavaFX under 1.5.  (Which is unsupported on Windows/Unix, but happens to be the only option for the poor lost souls with 32 bit chips who have been abandoned by Apple).

Since the code is easier to follow without reflection, I will show that first:

Desktop.getDesktop().browse(new URI(url));

And here is the munged version with reflection:

try {
    def desktopClazz = Class.forName("java.awt.Desktop");
    def desktop = desktopClazz.getMethod("getDesktop").invoke(null);
    def browseMethod = desktopClazz.getMethod("browse", [URI.class] as java.lang.Class[]);
    browseMethod.invoke(desktop, new URI(url));
} catch (e) {
    println("Upgrade to Java 6 or later to launch hyperlinks: {url}");
}

The Easy Way Out

When things are easy to do, they will get done right.  To make sure that JavaFX applications do not fall prey to broken and inconsistent linking, I put together a library for JFXtras that takes care of all the plumbing for you.

There is a new JFXtras class called BrowserUtil that has a very simple API:

BrowserUtil.browse(url);

or

BrowserUtil.browse(url, target);

It is that simple…  Conversion of string URLs to URL or URI objects, selection of the correct API based on your deployment mode, and failover modes based on the Java version are all included.

In addition, I created an extended Hyperlink called the XHyperlink.  This behaves identically to the built-in control, with the addition of simple configuration of URL navigation (this is what hyperlinks are designed for, right?)  The usage of the XHyperlink class is as follows:

XHyperlink {
    text: "Oracle's Homepage", url: "http://oracle.com/"}
}

All of this functionality will be included in the JFXtras 0.6 release.  If you need it now, you can build off the head of our repo.  Otherwise we are working on a release, which I will announce on this blog shortly which you can follow.

What about JavaFX mobile?

None of these desktop techniques actually work on a mobile device, so this is not a 100% solution yet.

Fortunately, there is also a solution for JavaFX Mobile if you are willing to delve in to the Java ME APIs.  To do this you first need to get a handle to the MIDlet like this:

def midlet = com.sun.javafx.runtime.adapter.MIDletAdapter.getMidlet();

And then you can call platformRequest to launch a browser on the mobile device:

midlet.platformRequest(url);

Note: This requires use of private APIs, so this may not work in future JavaFX releases.

It is not possible to merge this in with the desktop solution, because the JavaFX Mobile libraries do not exist on the desktop platform (and vice versa), but it is relatively easy to use this technique yourself by copying and pasting the above code sample into a helper function in your application.

 
Comments
2 Comments »
Categories
JavaFX, JavaFX Mobile, jfxtras
Tags
hyperlinks, JavaFX, JavaFX Mobile, jfxtras
Comments rss Comments rss
Trackback Trackback

Live Video Streaming Guide – Part 1 : Introduction

steveonjava | February 23, 2010

Recently I have been doing a lot of research, experimentation, and processing of videos for the Silicon Valley JavaFX User Group.  We decided from day 1 that we wanted to take things up a notch by providing high quality web streaming of our events.  It makes particular sense for us, because the JavaFX community is spread all around the world, and we want to be able to reach as wide of an audience as possible.  However, once you have everything setup the overhead is minimal, so it is worthwhile to do for any user group or event.

Video setup for the first SvJugFx meeting with myself (left) and Keith Combs (right) running the rig.

Because this is a fairly in depth subject, I am going to cover it in a 4 part blog series.  Here are the topics (links will be added as each entry is published):

  • Part 1 : Introduction – You are reading it!
  • Part 2 : Hardware – This will give you an idea what hardware you need (including how to reuse what you have available).
  • Part 3 : Broadcasting – A step-by-step guide on how to stream video live from your event and tools to let your remote audience interact.
  • Part 4 : Post-processing – How to take the video assets you have and process them for upload complete with slides.

By the end of this series you will be able to walk in to almost any venue and do live streaming on the spot.  You will also be able to post-process professional videos like Hinkmond’s February JavaFX Mobile talk.

Please drop feedback or comments below on anything specific you are interested on hearing me cover beyond what I have already mentioned!

 
Comments
2 Comments »
Categories
SvJugFx, Video
Tags
how-to, streaming, SvJugFx, Video
Comments rss Comments rss
Trackback Trackback

Hinkmond’s JavaFX Mobile Dojo

steveonjava | February 19, 2010

In case you missed the big event last week, I have finished post-processing and uploading the video.  We took the quality up a notch by getting a direct screen capture from the presenter laptop.  This means that you will not only get crystal clear slides, but also full-screen demos and a nice tight head-shot of the presenter.  This moves our video setup firmly up from a Level 4 to a premium Level 1 operation as detailed in Stephan Janssen’s blog.

Without further ado, here is the Parleys version of Hinkmond’s JavaFX Mobile Dojo talk:

I got a lot of requests for just the slides last time, so I am also making them available here:

Finally, a quick plug for our next SvJugFx event.  We will be doing a double feature with folks from the Java Store and JFrog Artifactory presenting back-to-back.  Even if you plan to attend online, make sure to sign-up here:
http://www.svjugfx.org/calendar/12559455/

 
Comments
5 Comments »
Categories
Events, JavaFX, SvJugFx
Tags
hinkmond wong, JavaFX, mobile, SvJugFx
Comments rss Comments rss
Trackback Trackback

JavaFX Layout Secrets with Amy Fowler

steveonjava | January 19, 2010

I finished post-processing and publishing our January talk with Amy Fowler on Parleys.com.

Here is a direct link: JavaFX Layout Secrets with Amy Fowler

I did my best to clean up the audio at the beginning to remove the static that our streaming listeners had to put up with. After the first 10 minutes we swapped mics, which made a huge difference!

Our plan for next month is to upgrade our streaming/recording setup once again so we can directly capture the presenter’s VGA signal for a dual-cast. This should allow us to capture the demos in full resolution and give a much better streaming experience. If you or your company is interested in helping sponsor some of our hardware needs, we can definitely use the help (contact me).

See you next month for Hinkmond’s JavaFX Mobile talk: Hinkmond’s JavaFX Mobile Dojo

 
Comments
No Comments »
Categories
Events, JavaFX, SvJugFx
Comments rss Comments rss
Trackback Trackback

SvJugFx Stream Page

steveonjava | January 13, 2010

Just a quick note. I have added a new page for the Silicon Valley JavaFX User Group live stream in the toolbar above. It contains an embedded movie player, chat window, and link to Google Moderator. The direct url is: http://steveonjava.com/svjugfx/

I don’t know if I mentioned this before, but the live stream is definitely worth the effort to watch. It is the only place you will get to hear the interesting commentary by JavaFX experts such as Jim Weaver, Dean Iverson, Jonathan Giles, and others.

Please also use this post to respond with comments and suggestions about the stream so we can improve it in future meetings.

We will be broadcasting tonight at 7PM PST, so please join us for a great presentation from Amy Fowler!

 
Comments
3 Comments »
Categories
Uncategorized
Comments rss Comments rss
Trackback Trackback

2010 Blog – Revisited

steveonjava | January 2, 2010

To bring in the New Year, I did a complete revamp of my blog.  Wordpress.com served me well initially, but the limitations started to cramp my style.  Now I am off the corporate cloud and running on a 100% Open Source platform.

Here are some of the benefits of the new blogging platform:

  • Inline JavaFX and Java applets – No need to click a link or launch a web start application to see my latest creations.
  • Embedded videos – I can now embed videos from all 3rd party sites, including developer favorites like Parleys.com.
  • Unencumbered styling – No limitations on what I can do with styles and themes for the site (although I promise to keep it tame!)

I also spent some doing a minor site redesign.  Some of the new features include:

  • Updated site theme – Uses the latest Freshy 2 release from Jidé (I guess I am partial to French designers)
  • DZone and Twitter post links – Feel free to vote up (or down) anything you see or retweet it to your followers
  • Contact form – Good way to directly poke me in case I am asleep at the wheel (sometimes I need a reminder)

I will be taking advantage of all these and other features of the new platform throughout the rest of 2010.

And finally, some local fireworks from the celebration over San Francisco to enjoy:

Happy New Year!

 
Comments
No Comments »
Categories
Uncategorized
Tags
blog, redesign
Comments rss Comments rss
Trackback Trackback

JavaFX Layout Secrets

steveonjava | December 18, 2009

I am very pleased to have Amy Fowler (Aim) presenting on JavaFX Layouts at our January Silicon Valley JavaFX Users Group (SvJugFx).  For those of you who don’t know Aim, she was a founding member of the Swing team, has done some Rock Star presentations at JavaOne, and is a core member of the JavaFX team focused on all things layout.

If you are doing any JavaFX development at all, this is an event you won’t want to miss.  The presentation is on January 13th and you can sign-up on the SvJugFx website here:

Click to Sign-Up

We will also be streaming the event live from Santa Clara, so if you don’t live nearby make sure to join us online for the event.  I actually think the folks watching it online are at an advantage, because they get all the inside information in the chat window from JavaFX luminaries like Jim Weaver, Dean Iverson, and Jonathan Giles.

For those of you who missed our December event, we just finished posting Richard Bair’s December talk on JavaFX entitled “Intro to JavaFX – A Rich Client Platform for All Screens.”  You can view it on Parleys.com complete with synchronized slides by clicking on the image or link below:

Richard Bair Presenting on JavaFX at the SvJugFx

Click to View Presentation

I hope to see you at our next event!

 
Comments
4 Comments »
Categories
Events, JavaFX, SvJugFx, presentation
Tags
JavaFX, jug, SvJugFx
Comments rss Comments rss
Trackback Trackback

SvJugFx Streamed Live with Richard Bair

steveonjava | December 8, 2009

For those of you who don’t know, SvJugFx stands for the Silicon Valley JavaFX Users Group.  We will be holding our very first meeting this coming Wednesday with a live, streamed presentation from the world renowned Richard Bair (who is now infamous for divulging JavaFX secrets at Devoxx).

Richard Bair Presenting at Devoxx 2009

Yes, I said streamed live…  for those of you who are not fortunate enough to live in Silicon Valley, you can still participate in realtime by doing the following:

  1. Sign-up for the SvJugFx meetup group.  This is the primary communication vehicle we will use to announce last-minute changes:
    http://www.svjugfx.org/
    (Note: Everyone can sign up for the group, but please only RSVP for the event if you are physically attending)
  2. For the video feed, please go to the following ustream channel:

    http://www.ustream.tv/channel/silicon-valley-javafx-user-group

  3. And to participate, please log on to Google Moderator at the following URL:

    http://moderator.appspot.com/#16/e=d528e

The in-person meeting will start on: Wednesday at 6PM PST
The online streaming will start at latest by: 7PM PST (possibly earlier)

Please leave enough time to login on both sites and test your internet and video playback capabilities.  You will be able to watch the live video stream on ustream and respond with your own questions (as well as vote other participant’s questions up and down) via Google Moderator, which we will be monitoring during the presentation.

This is the first time we are trying this format, so we apologize in advance for technical glitches or issues that we are sure will arise.

“Success is the ability to go from failure to failure without losing your enthusiasm.”

–Winston Churchill

 
Comments
1 Comment »
Categories
Announcements, Events, JavaFX, SvJugFx, presentation
Tags
JavaFX, richard bair, SvJugFx
Comments rss Comments rss
Trackback Trackback

2009 Devoxx Posts + NetBeans JavaFX Designer Preview

steveonjava | December 6, 2009

The two talks I gave at Devoxx 2009 are now available on the Parleys.com website for online viewing.

I would recommend you start with the University Talk, which is the most in-depth tutorial on the JavaFX Language and Platform available today.  This talk also features a guest appearance by Tor Norbye who demonstrated the new NetBeans JavaFX Designer Tool (which is distinct from the Authoring Tool):

Netbeans JavaFX Designer Demo

http://devoxx.parleys.com/#st=5&id=1636

The second is the JavaFX Enterprise Developer talk, which showcased many of the new JFXtras components that we are about to release in the 0.6 JFXtras release (a preview of which is available today).  It also goes into detail on JavaFX unit testing with FEST-JavaFX, which is a tool any enterprise developer should use regularly:

Pro JavaFX - Developing Enterprise Applications

http://devoxx.parleys.com/#st=5&id=1593

Both talks are available now for a small fee to register, which is well worth it for all the great content at the conference.  There was a lot of preparation work that went into these talks, so I hope you enjoy them!

 
Comments
9 Comments »
Categories
Uncategorized
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Publications

The most comprehensive book on the JavaFX Platform!

Free Refcard covering JavaFX 1.2

Categories

  • Announcements (11)
  • contest (3)
  • Events (14)
  • JavaFX (29)
  • JavaFX Mobile (1)
  • jfxtras (9)
  • Liferay (2)
  • presentation (4)
  • pro javafx (2)
  • SvJugFx (6)
  • Uncategorized (21)
  • Video (2)
  • widgetfx (9)

Affiliations

Awards

2009 JavaOne Rock Star!

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox