Since the JavaFX Preview SDK was released, I have been toying around with its video support. Overall, it is really, really good. I'm impressed and I've only hit the tip of the iceberg. Of course, there is room for improvement. For example, the current MediaView class does not have any concept of width nor height, whereas the ImageView class does. I was able to fix that with this amazingly short piece of code.

Yes, that is really it. To use it, just swap out ImprovedMediaView for MediaView, and set your width, height, and fill like this...
The result looks like this:


Leave a comment