Resource Class
Resource class is used to represent resources.
Resources store data that is used by objects.
Methods
dispose
()
Dispose resource, should be called to free memory after its no longer required.
export
(
-
fname
Export resource data to file.
Parameters:
-
fname
StringFile name or file path.
toJSON
(
Object
-
meta
Serialize resource to json.
Only serializes name, uuid and type.
Parameters:
-
meta
Object
Returns:
Object:
json
Properties
data
Object
Resource data.
encoding
String | ArrayBuffer
Data encoding (mp3, jpg, mp4, ...).
Indicates how the data is encoded.
format
Object
Data format (base64, arraybuffer, blob, url, chunk, ...).
Indicates the format used to store the data.
name
String
Resource name.
Not required to be unique.
type
String
Resource type. Used to identify the type of the resource, usefull for serialization.
uuid
String
UUID unique identifier.