This data type allows the user to manage the location and content of a Media-type file that may be a photo or video stored in the device.
CONSTRUCTOR
This data type does not have a constructor. It just may be instantiated as return of the broker.media.open() services.
PUBLIC METHODS
String getURL()
Address of the file system of the device where media files is stored.
Return | |
---|---|
String | Address. |
Exceptions |
---|
MediaFileSaveException – Has been an exception when trying to save media file. |
Boolean isPhoto()
The Media files may be a picture or a video. This method enables the user to ask if it is a picture.
Return | |
---|---|
Boolean | Positive boolean value if it is a picture. |
Boolean isVideo()
The Media files may be a picture or a file. This method enables the user to ask if it is a video.
Return | |
---|---|
Boolean | Positive boolean value if it is a video. |
String saveInGallery()
It saves a copy of the photo or video in the gallery of the device.
Return | |
---|---|
String | URL with the location of the media file. |
Exceptions |
---|
GallerySaveError – Error trying to save media file in gallery. |
GalleryAccessDenied – Error trying to access media gallery without permission. |
Boolean fileExists()
It returns true if the file is in the temporary files or in the gallery of the device. Otherwise, it returns false.
Return | |
---|---|
Boolean | Positive boolean value if the file exists. |