Media API question regarding metadata retrieval
david.dehaven at oracle.com
Wed Apr 1 19:48:55 UTC 2015
> I was a bit surprised that the metadata retrieval functionality
> of javafx.scene.media.Media is only usable in conjunction with a player, so
> if I want to retrieve the dimensions of a video file I have to instantiate
> a player and wait for it to reach ready state? That's how I read the
> javadoc. Is this a misunderstanding?
Nope, currently you have to create a player. Once a player is created it kicks off a parser to grab metadata or waits for the underlying native player to parse.
> If not is there a specific reason not
> to offer this functionality independently of a player?
There were plans, there were also issues as we don't have a Java based mp4 parser so we're relying on the underlying platforms (e.g. QTKit, AVFoundation, etc..) to provide that data, which basically means we're creating a player at the native level anyways. If you're using the horribly outdated FXM format you get the benefit of a Java based parser, but honestly, who's using that these days?
More information about the openjfx-dev