Media


Purpose

Consists of the Media object that enables taking pictures with a camera, as well as recording and playing audio clips.

The object can be accessed using the launchbox.Media reference.

The API preserves any information it retrieves, in case Hybrid Container gets stopped by the Android operating system. Once the external activity finishes, the main activity is restarted and Hybrid Container notifies the user about further steps. The user may decide to re-capture the information or use the preserved data.

Module

This object belongs to the Media product module.

Constants

Name Description
window.launchbox.Media.ImageFormat.JPG Represents the JPG image file format.
window.launchbox.Media.ImageFormat.PNG Represents file PNG image file format.
window.launchbox.Media.Audio.Codec.AAC Represents the AAC audio codec.
window.launchbox.Media.Audio.Codec.AMR

Represents the Adaptive Multi-Rate narrowband audio codec, also known as AMR or AMR-NB.

Note

Supported by Android only.

window.launchbox.Media.Audio.OutputFormat.MPEG_4 Represents the MPEG4 output format.
window.launchbox.Media.Audio.OutputFormat.THREE_GPP Represents the 3GPP output format.
window.launchbox.Media.Audio.SESSION_PLAYING Denotes that the audio file is being played.
window.launchbox.Media.Audio.SESSION_RECORDING Denotes that the audio file is being recorded.
window.launchbox.Media.SourceType.USER_CHOICE Denotes that the media source can be chosen by the user.
window.launchbox.Media.SourceType.CAPTURE Denotes that the media source is the built-in camera/recorder.
window.launchbox.Media.SourceType.MEDIA_LIBRARY Denotes that the media source is a media album.

Methods

Name Return type Description
getPicture undefined

Picks a picture from a photo album or takes a picture with the built-in camera.

getAudio undefined

Picks audio data from the library or the recorder.

Audio.play undefined

Starts playing an audio file.

Audio.record undefined

Starts the recording of an audio file.

Audio.pause undefined

Pauses any audio recording or playback in progress. On Android it only pauses the playback session.

Audio.stop undefined

Stops any audio recording or playing in progress.

addListener undefined

Registers a listener for Media Audio events.

removeListener undefined

Removes a listener for Media Audio events.

Related topics

Public API reference
Legal notice | Copyright © 2017 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...