Media

Overview

The Media class represents binary data associated with a MIME type and provides various methods to manage and manipulate this data. It stores media content as a blob and offers functionality for retrieving and updating the media content, such as using the getMediaData() function to lazily load the media or makeBlobPermanent() to make the data persistent. The class also allows for setting and getting properties like name and mime type through the setName() and getMimeType() functions, ensuring proper i dentification of the media.

Additionally, the Media class supports encapsulation levels with setEncapsulation() and getEncapsulation(), which help define how the media is exposed in different environments. The class also includes methods for handling deprecation, allowing you to track and manage deprecated media through getDeprecated() and setDeprecated().

By utilizing these features, the Media class provides support for managing media data, making it easy to handle in the Servoy environment, whether it is for temporary usage or permanent storage with a defined MIME type.

Properties Summarized

Type
Name
Summary

Additional information, such as programmer notes about this model object's purpose.

Gets the deprecation info for this element.

The encapsulation mode of this Media.

The MIME type of the Media object.

The name of the Media object.

Properties Detailed

comment

Additional information, such as programmer notes about this model object's purpose.

Type String

deprecated

Gets the deprecation info for this element.

Type String the deprecation info for this object or null if it is not deprecated

Sample

"not used anymore, replaced with ..."

encapsulation

The encapsulation mode of this Media. The following can be used:

- Public (available in both scripting and designer from any module) - Module Scope - available in both scripting and designer but only in the same module.

Type Number the encapsulation mode/level of the persist.

mimeType

The MIME type of the Media object.

Some examples are: 'image/jpg', 'image/png', etc.

Type String

name

The name of the Media object.

Type String


Last updated