Class: Html5AudioOutput

Html5AudioOutput

new Html5AudioOutput()

Members

_pluginName

constantMediaErrorArray.<String>

Media error (codes): the corresponding code is their index.

Code 0 is an internal error code for unknown/unspecific error causes.
Codes 1 - 4 correspond to the HTML5 MediaError interface (which are the same as Cordova's Audio MediaError codes). The description texts are taken from the HTML5 documentation.

See:

Methods

createDataUrl(blob, callback)

HELPER for creating data-URL from binary data (blob)
Name Type Description
blob Blob The audio data as blob
callback function callback that will be invoked with the data-URL: callback(dataUrl)

createError(code, errorEvent){Object}

HELPER for creating error object that is returned in the failureCallbacks
Name Type Description
code Number The error code: if in [1,4], the corresponding HTML5 MediaError information will be returned Otherwise an "error 0", i.e. internal/unknown error will be created
errorEvent Event | Error the causing event- or error-object
Returns:
Type Description
Object the error object, which has 3 properties: code (Number): the error code message (String): the error name description (String): a descriptive text for the error

createErrorWrapper(ctx, errorCallback){function}

FACTORY for creating error-listeners (that trigger the failureCallback)
Name Type Description
ctx Object optional the context for the errorCallback. IF omitted, the callback will be within the default (i.e. global) context.
errorCallback function optional the error callback. Is invoked with 2 arguments: errorCallback(error, event) where error has 3 properties: code (Number): the error code message (String): the error name description (String): a descriptive text for the error IF omitted, the error will be printed to the console.
Returns:
Type Description
function wrapper function that can be registered as event-listener (takes one argument: the event)

getURLAsAudio()

See:

getWAVAsAudio()

See:
  • mmir.MediaManager#getWAVAsAudio

handlePlayPromise(p, audio, errorHandler){mmir.env.media.IAudio}

HELPER for handling new play() promise mechanism: play may get rejected due to no user-interaction -> trigger 'errorplay' event on MediaManager
Name Type Description
p Promise | void The promise returned by calling WebAudio.play() (or FALSY, if no promise was returned)
audio IAudio The audio object for which play was invoked
errorHandler function The error handler/callback for the audio
Returns:
Type Description
mmir.env.media.IAudio the audio
See:
See:

releaseDataUrl(dataUrl)

HELPER for releasing data-URL
Name Type Description
dataUrl String The data URL for the audio blob

releaseDataUrl(dataUrl)

HELPER for releasing data-URL
Name Type Description
dataUrl String The data URL for the audio blob