Namespace: rlDataObjectFactory

rlDataObjectFactory

Provides methods to create various objects from binary data in ArrayBuffer objects.

Methods

(static) createAudio(sourceArrayBuffer, mimeTypeopt) → {HTMLAudioElement|null}

Create an audio object from the given binary data.

Parameters:
Name Type Attributes Default Description
sourceArrayBuffer ArrayBuffer

the source binary data (must contain audio file data)

mimeType string <optional>
"audio/wav"

the MIME type of the binary data

See:
Returns:

null is returned if an error/exception occured

Type
HTMLAudioElement | null

(static) createImage(sourceArrayBuffer, mimeTypeopt) → {HTMLImageElement|null}

Create an image object from the given binary data.

Parameters:
Name Type Attributes Default Description
sourceArrayBuffer ArrayBuffer

the source binary data (must contain image file data)

mimeType string <optional>
"image/png"

the MIME type of the binary data

See:
Returns:

null is returned if an error/exception occured

Type
HTMLImageElement | null