Basics
Guides
API Reference
Basics
Guides
API Reference
[12:7] extends: FxObj
Wraps JavaFX Media, which represents a media resource (audio or video) loaded from a URI for playback through a MediaPlayer. The source must be a fully qualified URI string using the file:// scheme for local files or http:// for network streams. Once constructed, pass this object to a MediaPlayer to control playback.
Media (string Source)
Creates a new Media object from the given URI string.
Source is a string with the media URI, e.g., file:///path/to/file.mp4.this objectgetSource ()
Returns the source URI string used to create this Media object.
A string with the source URI.getWidth ()
Returns the width in pixels of the video, or 0 for audio-only media.
An int with the video width.getHeight ()
Returns the height in pixels of the video, or 0 for audio-only media.
An int with the video height.getDuration ()
Returns the duration of the media in milliseconds.
A double with the duration in milliseconds.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.