Media Capture

enyo.MediaCapture is a non-control component that's used to manage the capturing of media in webOS. It is found under framework/lib/mediacapture in the Enyo source tree. To use the Media Capture API in an application, add the following line to the app's depend.js file:

"$enyo-lib/mediacapture/"

Published Properties

Name Default Description
lastImagePath "" Path of the last captured image
lastVideoPath "" Path of the last captured video
lastAudioPath "" Path of the last captured audio

Public Events

The following events are sent back to the client to signal the start or completion of an action, or some other change in state.

Public Methods

initialize(videoObjectFromClient)

Fires the call to initialize an instance of MediaServer.

videoObjectFromClient is an optional HTML5 video object used as the preview for the byte stream from the media server.

load(mode, format)

Loads the media capture device.

Both mode and format come from the (required) property bag.

startImageCapture(filePath, imageCaptureOptions)

Starts an image capture.

startAudioCapture(filePath, audioCaptureOptions)

Starts an audio capture.

stopAudioCapture()

Stops the current audio capture.

startVideoCapture(filePath, videoCaptureOptions)

Starts a video capture.

stopVideoCapture()

Stops the current video capture.

unload()

Unloads the currently-loaded device.

updateAutoFocus(autoFocusSettings)

Resets the current auto focus with the settings specified in the passed-in object.

autoFocusSettings is a JSON-formatted object with the following fields: