public class MediaClient
extends java.lang.Object
The MediaClient is used for loading media resources from Gluon CloudLink into the client application.
| Constructor | Description |
|---|---|
MediaClient() |
| Modifier and Type | Method | Description |
|---|---|---|
javafx.scene.image.Image |
loadImage(java.lang.String name) |
A convenience method to directly load a media resource with the provided name into
a JavaFX
Image object. |
java.io.InputStream |
loadMedia(java.lang.String name) |
Load the media resource with the provided name into an InputStream.
|
java.util.ResourceBundle |
loadResourceBundle(java.lang.String bundleName,
java.util.Locale locale) |
Loads the resource bundle with the provided bundle name and locale from Gluon CloudLink.
|
public java.io.InputStream loadMedia(java.lang.String name)
throws java.io.IOException
name - the name of the media resource to loadjava.io.IOException - if an I/O error occurs while loading the media resource.public javafx.scene.image.Image loadImage(java.lang.String name)
throws java.io.IOException
Image object. You can check Image.errorProperty()
to see whether the returned image contains a valid image or not.name - the name of the media resource to loadImageView.java.io.IOException - if an I/O error occurs while loading the media resource.public java.util.ResourceBundle loadResourceBundle(java.lang.String bundleName,
java.util.Locale locale)
throws java.io.IOException
null will be returned instead.bundleName - the name of the resource bundlelocale - the locale of the resource bundlejava.io.IOException - if an I/O error occurs while loading the resource bundle.