Titanium.Media
> Titanium.Media

The top-level Media module.

The Media module is used to access the device's media-related functionality, such as using the device's camera and photo gallery, playing media files, or recording audio or video. For examples of using the Media APIs, refer to the Working with Media APIs guide in addition to the other media submodule API documentation.

  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

Titanium.Media
AUDIO_FILEFORMAT_3GP2 : Numberreadonly

Audio file format 3GPP2.

Audio file format 3GPP2.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_3GPP : Numberreadonly

Audio file format 3GPP.

Audio file format 3GPP.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_AIFF : Numberreadonly

Audio file format Audio Interchange File Format (AIFF).

Audio file format Audio Interchange File Format (AIFF).

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_AMR : Numberreadonly

Audio file format Adaptive Multi-Rate (AMR).

Audio file format Adaptive Multi-Rate (AMR).

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_CAF : Numberreadonly

Audio file format Apple Compressed Audio Format (CAF).

Audio file format Apple Compressed Audio Format (CAF).

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_MP3 : Numberreadonly

Audio file format MP3.

Audio file format MP3.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_MP4 : Numberreadonly

Audio file format MP4.

Audio file format MP4.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_MP4A : Numberreadonly

Audio file format MP4A.

Audio file format MP4A.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FILEFORMAT_WAVE : Numberreadonly

Audio file format WAVE.

Audio file format WAVE.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FORMAT_AAC : Numberreadonly

Audio format MPEG4 AAC encoding.

Audio format MPEG4 AAC encoding.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FORMAT_ALAW : Numberreadonly

Audio format 8-bit aLaw encoding.

Audio format 8-bit aLaw encoding.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FORMAT_APPLE_LOSSLESS : Numberreadonly

Audio format Apple lossless encoding.

Audio format Apple lossless encoding.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FORMAT_ILBC : Numberreadonly

Audio format iLBC encoding.

Audio format iLBC encoding.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FORMAT_IMA4 : Numberreadonly

Audio format Apple IMA4 encoding.

Audio format Apple IMA4 encoding.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FORMAT_LINEAR_PCM : Numberreadonly

Audio format 16-bit, linear PCM encoding.

Audio format 16-bit, linear PCM encoding.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_FORMAT_ULAW : Numberreadonly

Audio format 8-bit muLaw encoding.

Audio format 8-bit muLaw encoding.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_HEADPHONES : Numberreadonlyremoved

Line-type constant for headphones.

Line-type constant for headphones.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_HEADPHONES_AND_MIC : Numberreadonlyremoved

Line-type constant for headphones and microphone.

Line-type constant for headphones and microphone.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_HEADSET_INOUT : Numberreadonlyremoved

Line-type constant for headset in/out.

Line-type constant for headset in/out.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_LINEOUT : Numberreadonlyremoved

Line-type constant for line-out.

Line-type constant for line-out.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_MICROPHONE : Numberreadonlyremoved

Line-type constant for microphone.

Line-type constant for microphone.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_MUTED : Numberreadonlyremoved

Line-type constant indicated mute switch is on.

Line-type constant indicated mute switch is on.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_RECEIVER_AND_MIC : Numberreadonlyremoved

Line-type constant indicating receiver and microphone.

Line-type constant indicating receiver and microphone.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_SESSION_CATEGORY_AMBIENT : Stringreadonly

For long-duration sounds such as rain, car engine noise, and so on.

For long-duration sounds such as rain, car engine noise, and so on.

Also used for for 'play along' style applications, such a virtual piano that a user plays over iPod audio.

See also: AUDIO_SESSION_CATEGORY_SOLO_AMBIENT.

  • 3.4.2
  • 3.4.2
Titanium.Media
AUDIO_SESSION_CATEGORY_PLAYBACK : Stringreadonly

Session mode for playing recorded music or other sounds that are central to the successful use of your application.

Session mode for playing recorded music or other sounds that are central to the successful use of your application.

When using this mode, your application audio continues with the Ring/Silent switch set to silent or when the screen locks. This property normally disallows mixing iPod audio with application audio.

  • 3.4.2
  • 3.4.2
Titanium.Media
AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD : Stringreadonly

Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application.

Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application.

This category is appropriate for simultaneous recording and playback, and also for applications that record and play back but not simultaneously. If you want to ensure that sounds such as Messages alerts do not play while your application is recording, use AUDIO_SESSION_CATEGORY_RECORD instead. This category normally disallows mixing iPod audio with application audio.

In this mode, by default audio playback is routed to the speaker in the iPhone receiver. To have audio playback through the iPhone speaker, use setOverrideAudioRoute.

  • 3.4.2
  • 3.4.2
Titanium.Media
AUDIO_SESSION_CATEGORY_RECORD : Stringreadonly

Session mode for recording audio; it silences playback audio.

Session mode for recording audio; it silences playback audio.

  • 3.4.2
  • 3.4.2
Titanium.Media
AUDIO_SESSION_CATEGORY_SOLO_AMBIENT : Stringreadonly

Session mode for long-duration sounds such as rain, car engine noise, and so on.

Session mode for long-duration sounds such as rain, car engine noise, and so on.

When you use this category, audio from built-in applications, such as the iPod, is silenced. Your audio is silenced when the Ring/Silent switch is set to silent or when the screen locks.

To use long-duration sounds without silencing built-in applications, see AUDIO_SESSION_CATEGORY_AMBIENT.

  • 3.4.2
  • 3.4.2
Titanium.Media
AUDIO_SESSION_MODE_AMBIENT : Numberreadonlyremoved

For long-duration sounds such as rain, car engine noise, and so on.

For long-duration sounds such as rain, car engine noise, and so on.

This property has been removed since 6.0.0

Deprecated in favor of the AUDIO_SESSION_CATEGORY constants defined in <Titanium.Media>.

Also used for for 'play along' style applications, such a virtual piano that a user plays over iPod audio.

See also: AUDIO_SESSION_MODE_SOLO_AMBIENT.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_SESSION_MODE_PLAYBACK : Numberreadonlyremoved

Session mode for playing recorded music or other sounds that are central to the successful use of your application.

Session mode for playing recorded music or other sounds that are central to the successful use of your application.

This property has been removed since 6.0.0

Deprecated in favor of the AUDIO_SESSION_CATEGORY constants defined in <Titanium.Media>.

When using this mode, your application audio continues with the Ring/Silent switch set to silent or when the screen locks. This property normally disallows mixing iPod audio with application audio.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_SESSION_MODE_PLAY_AND_RECORD : Numberreadonlyremoved

Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application.

Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application.

This property has been removed since 6.0.0

Deprecated in favor of the AUDIO_SESSION_CATEGORY constants defined in <Titanium.Media>.

This category is appropriate for simultaneous recording and playback, and also for applications that record and play back but not simultaneously. If you want to ensure that sounds such as Messages alerts do not play while your application is recording, use AUDIO_SESSION_CATEGORY_RECORD instead. This category normally disallows mixing iPod audio with application audio.

In this mode, by default audio playback is routed to the speaker in the iPhone receiver. To have audio playback through the iPhone speaker, use setOverrideAudioRoute.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_SESSION_MODE_RECORD : Numberreadonlyremoved

Session mode for recording audio; it silences playback audio.

Session mode for recording audio; it silences playback audio.

This property has been removed since 6.0.0

Deprecated in favor of the AUDIO_SESSION_CATEGORY_* constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
: Numberdeprecatedreadonly
Session mode for long-duration sounds such as rain, car engine noise, and so on. ...

Session mode for long-duration sounds such as rain, car engine noise, and so on.

deprecated since 3.4.2

Deprecated in favor of the AUDIO_SESSION_CATEGORY constants defined in <Titanium.Media>.

When you use this category, audio from built-in applications, such as the iPod, is silenced. Your audio is silenced when the Ring/Silent switch is set to silent or when the screen locks.

To use long-duration sounds without silencing built-in applications, see AUDIO_SESSION_MODE_AMBIENT.

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant that specifies audio should output to the default audio route. ...

Constant that specifies audio should output to the default audio route. See setOverrideAudioRoute for more information.

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant that specifies audio should output to the speaker. ...

Constant that specifies audio should output to the speaker. See setOverrideAudioRoute for more information.

  • 0.8
  • 0.8
Titanium.Media
: Stringreadonly
Constant for output on a remote Air Play device. ...

Constant for output on a remote Air Play device. This is an output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for output on a Bluetooth A2DP device. ...

Constant for output on a Bluetooth A2DP device. This is an output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for input or output on a Bluetooth Hands-Free Profile device. ...

Constant for input or output on a Bluetooth Hands-Free Profile device. This can be both an input and output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for output on a Bluetooth Low Energy device. ...

Constant for output on a Bluetooth Low Energy device. This is an output port. This is available on iOS7 and later.

Requires: iOS 7.0 and later

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for built-in microphone on an iOS device. ...

Constant for built-in microphone on an iOS device. This is an input port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for the speaker you hold to your ear when on a phone call. ...

Constant for the speaker you hold to your ear when on a phone call. This is an output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for built-in speaker on an iOS device. ...

Constant for built-in speaker on an iOS device. This is an output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for Input or output via Car Audio. ...

Constant for Input or output via Car Audio. This can be both an input and output port. This is available on iOS7 and later.

Requires: iOS 7.0 and later

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for output via High-Definition Multimedia Interface. ...

Constant for output via High-Definition Multimedia Interface. This is an output port

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for headphone or headset output. ...

Constant for headphone or headset output. This is an output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for microphone on a wired headset. ...

Constant for microphone on a wired headset. This is an input port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for line level input on a dock connector. ...

Constant for line level input on a dock connector. This is an input port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for line level output on a dock connector. ...

Constant for line level output on a dock connector. This is an output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Stringreadonly
Constant for input or output on a Universal Serial Bus device. ...

Constant for input or output on a Universal Serial Bus device. This can be both an input and output port.

  • 3.4.2
  • 3.4.2
Titanium.Media
: Numberdeprecatedreadonly
Line-type constant for speaker output. ...

Line-type constant for speaker output.

deprecated since 3.4.2

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_UNAVAILABLE : Numberreadonlyremoved

Line-type constant indicating that audio is unavailable.

Line-type constant indicating that audio is unavailable.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
AUDIO_UNKNOWN : Numberreadonlyremoved

Line-type constant indicating that line-type is unknown or not determined.

Line-type constant indicating that line-type is unknown or not determined.

This property has been removed since 3.6.0

Deprecated in favor of the AUDIO_SESSION_PORT constants defined in <Titanium.Media>.

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant specifying that app is authorized to use camera. ...

Constant specifying that app is authorized to use camera. This is available on iOS7 and later.

Requires: iOS 7.0 and later

  • 4.0.0
  • 4.0.0
Titanium.Media
: Numberreadonly
Constant specifying that app is denied usage of camera. ...

Constant specifying that app is denied usage of camera. This is available on iOS7 and later.

Requires: iOS 7.0 and later

  • 4.0.0
  • 4.0.0
Titanium.Media
: Numberreadonlyremoved
Constant specifying that app is not yet authorized to use camera. ...

Constant specifying that app is not yet authorized to use camera. This is available on iOS7 and later.

This property has been removed

7.0.0 Use <Titanium.Media.CAMERA_AUTHORIZATION_UNKNOWN> instead.

Requires: iOS 7.0 and later

  • 4.0.0
  • 4.0.0
Titanium.Media
: Numberreadonly
Constant specifying that app is restricted from using camera. ...

Constant specifying that app is restricted from using camera. This is available on iOS7 and later.

Requires: iOS 7.0 and later

  • 4.0.0
  • 4.0.0
Titanium.Media
: Numberreadonly
Constant specifying that app is not yet authorized to use camera. ...

Constant specifying that app is not yet authorized to use camera. This is available on iOS7 and later.

Requires: iOS 7.0 and later

  • 5.2.0
  • 5.2.0
Titanium.Media
CAMERA_FLASH_AUTO : Numberreadonly

Constant specifying to have the device determine to use the flash or not.

Constant specifying to have the device determine to use the flash or not.

  • 3.3.0
  • 1.4.0
  • 1.4.0
Titanium.Media
CAMERA_FLASH_OFF : Numberreadonly

Constant specifying to never fire the flash.

Constant specifying to never fire the flash.

  • 3.3.0
  • 1.4.0
  • 1.4.0
Titanium.Media
CAMERA_FLASH_ON : Numberreadonly

Constant specifying to always fire the flash.

Constant specifying to always fire the flash.

  • 3.3.0
  • 1.4.0
  • 1.4.0
Titanium.Media
CAMERA_FRONT : Numberreadonly

Constant specifying the front camera.

Constant specifying the front camera.

  • 3.2.0
  • 0.8
  • 0.8
Titanium.Media
CAMERA_REAR : Numberreadonly

Constant indicating the rear camera.

Constant indicating the rear camera.

  • 3.2.0
  • 0.8
  • 0.8
Titanium.Media
DEVICE_BUSY : Numberreadonly

Constant for media device busy error.

Constant for media device busy error.

Titanium.Media
: Stringreadonly
Media type constant for live photo media. ...

Media type constant for live photo media.

Requires: iOS 9.1 and later

  • 5.2.0
  • 5.2.0
Titanium.Media
MEDIA_TYPE_PHOTO : Stringreadonly

Media type constant for photo media.

Media type constant for photo media.

Titanium.Media
MEDIA_TYPE_VIDEO : Stringreadonly

Media type constant for video media.

Media type constant for video media.

Titanium.Media
: Numberreadonly
Constant for grouping query results by album. ...

Constant for grouping query results by album.

Constant value:1

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant for grouping query results by album and artist. ...

Constant for grouping query results by album and artist.

Constant value:3

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant for grouping query results by artist. ...

Constant for grouping query results by artist.

Constant value:2

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant for grouping query results by composer. ...

Constant for grouping query results by composer.

Constant value:4

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant for grouping query results by genre. ...

Constant for grouping query results by genre.

Constant value:5

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant for grouping query results by playlist. ...

Constant for grouping query results by playlist.

Constant value:6

  • 0.8
  • 0.8
Titanium.Media
: Numberreadonly
Constant for grouping query results by podcast title. ...

Constant for grouping query results by podcast title.

Constant value:7

  • 0.8
  • 0.8
Titanium.Media
MUSIC_MEDIA_GROUP_TITLE : Numberreadonly

Constant for grouping query results by title.

Constant for grouping query results by title.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_MEDIA_TYPE_ALL : Numberreadonly

Music library media containing any type of content.

Music library media containing any type of content.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_MEDIA_TYPE_ANY_AUDIO : Numberreadonly

Music library media containing any type of audio content.

Music library media containing any type of audio content.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_MEDIA_TYPE_AUDIOBOOK : Numberreadonly

Music library media containing audiobook content.

Music library media containing audiobook content.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_MEDIA_TYPE_MUSIC : Numberreadonly

Music library media containing music content.

Music library media containing music content.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_MEDIA_TYPE_PODCAST : Numberreadonly

Music library media containing podcast content.

Music library media containing podcast content.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_REPEAT_ALL : Numberreadonly

Constant for "Repeat All" setting.

Constant for "Repeat All" setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_REPEAT_DEFAULT : Numberreadonly

Constant for user's default repeat setting.

Constant for user's default repeat setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_REPEAT_NONE : Numberreadonly

Constant for "No Repeat" setting.

Constant for "No Repeat" setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_REPEAT_ONE : Numberreadonly

Constant for "Repeat one item" setting.

Constant for "Repeat one item" setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_SHUFFLE_ALBUMS : Numberreadonly

Constant for shuffling complete albums setting.

Constant for shuffling complete albums setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_SHUFFLE_DEFAULT : Numberreadonly

Constant for user's default shuffle setting.

Constant for user's default shuffle setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_SHUFFLE_NONE : Numberreadonly

Constant for "no shuffle" setting.

Constant for "no shuffle" setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_SHUFFLE_SONGS : Numberreadonly

Constant for shuffling songs setting.

Constant for shuffling songs setting.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_STATE_INTERRUPTED : Numberreadonly

Constant for interrupted state.

Constant for interrupted state.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_STATE_PAUSED : Numberreadonly

Constant for paused state.

Constant for paused state.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_STATE_PLAYING : Numberreadonly

Constant for playing state.

Constant for playing state.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_STATE_SEEK_BACKWARD : Numberreadonly

Constant for backward seek state.

Constant for backward seek state.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_STATE_SEEK_FORWARD : Numberreadonly

Constant for forward seek state.

Constant for forward seek state.

  • 0.8
  • 0.8
Titanium.Media
MUSIC_PLAYER_STATE_STOPPED : Numberreadonly

Constant for stopped state.

Constant for stopped state.

  • 0.8
  • 0.8
Titanium.Media
NO_CAMERA : Numberreadonly

Constant for media no camera error.

Constant for media no camera error.

Titanium.Media
NO_VIDEO : Numberreadonly

Constant for media no video error.

Constant for media no video error.

Titanium.Media
QUALITY_640x480 : Numberreadonly

Media type constant for medium-quality video recording.

Media type constant for medium-quality video recording.

If recording, specifies that you want to use VGA-quality video recording (pixel dimensions of 640x480).

  • 0.8
  • 0.8
Titanium.Media
QUALITY_HIGH : Numberreadonly

Media type constant for high-quality video recording.

Media type constant for high-quality video recording.

Recorded files are suitable for on-device playback and for wired transfer to the Desktop using Image Capture; they are likely to be too large for transfer using Wi-Fi.

  • 0.8
  • 0.8
Titanium.Media
QUALITY_IFRAME_1280x720 : Numberreadonly

Media type constant for medium-quality video recording.

Media type constant for medium-quality video recording.

If recording, specifies that you want to use 1280x720 iFrame format.

  • 6.0.0
  • 6.0.0
Titanium.Media
QUALITY_IFRAME_960x540 : Numberreadonly

Media type constant for medium-quality video recording.

Media type constant for medium-quality video recording.

If recording, specifies that you want to use 960x540 iFrame format.

  • 6.0.0
  • 6.0.0
Titanium.Media
QUALITY_LOW : Numberreadonly

Media type constant for low-quality video recording.

Media type constant for low-quality video recording.

Recorded files can usually be transferred over the cellular network.

  • 0.8
  • 0.8
Titanium.Media
QUALITY_MEDIUM : Numberreadonly

Media type constant for medium-quality video recording.

Media type constant for medium-quality video recording.

Recorded files can usually be transferred using Wi-Fi. This is the default video quality setting.

  • 0.8
  • 0.8
Titanium.Media
UNKNOWN_ERROR : Numberreadonly

Constant for unknown media error.

Constant for unknown media error.

Titanium.Media
VIDEO_CONTROL_DEFAULT : Numberreadonlyremoved

Constant for default video controls.

Constant for default video controls.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Used in conjunction with the mediaControlStyle property of Titanium.Media.VideoPlayer.

Titanium.Media
VIDEO_CONTROL_EMBEDDED : Numberreadonlyremoved

Constant for video controls for an embedded view.

Constant for video controls for an embedded view.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Used in conjunction with the mediaControlStyle property of Titanium.Media.VideoPlayer.

On Android, this constant has the same effect as VIDEO_CONTROL_DEFAULT. Video controls may only be shown or hidden.

Titanium.Media
VIDEO_CONTROL_FULLSCREEN : Numberreadonlyremoved

Constant for fullscreen video controls.

Constant for fullscreen video controls.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Used in conjunction with the mediaControlStyle property of Titanium.Media.VideoPlayer.

On iOS, use VIDEO_CONTROL_FULLSCREEN when creating a video player that occupies the entire screen, that is, the parent window should be a fullscreen window (fullscreen set to true) and the video player should occupy the entirety of the parent window.

If the user clicks the Done button in the fullscreen control bar, the video player pauses playback and generates a complete event.

Note that if you create a video player that does not occupy the entire screen, and later switch to fullscreen mode, the video controls are switched automatically. That is, if mediaControlStyle is set to VIDEO_CONTROL_DEFAULT or VIDEO_CONTROL_EMBEDDED, it is automatically switched to the fullscreen controls when the player enters fullscreen mode. This is true whether the user initiates the mode switch by clicking the fullscreen button in the embedded controls, or if you programmatically switch to full screen mode (by setting the fullscreen property to true).

On Android, this constant has the same effect as VIDEO_CONTROL_DEFAULT. Video controls may only be shown or hidden.

Titanium.Media
VIDEO_CONTROL_HIDDEN : Numberreadonly

Constant for video controls hidden.

Constant for video controls hidden.

Used in conjunction with the mediaControlStyle property of Titanium.Media.VideoPlayer.

Titanium.Media
VIDEO_CONTROL_NONE : Numberreadonly

Constant for no video controls.

Constant for no video controls.

Used in conjunction with the mediaControlStyle property of Titanium.Media.VideoPlayer.

Titanium.Media
VIDEO_CONTROL_VOLUME_ONLY : Numberreadonlyremoved

Constant for video controls volume only.

Constant for video controls volume only.

This property has been removed since 6.0.0

Use <Titanium.Media.VIDEO_CONTROL_EMBEDDED> instead.

  • 0.8
  • 0.8
Titanium.Media
VIDEO_FINISH_REASON_PLAYBACK_ENDED : Numberreadonly

Video playback ended normally.

Video playback ended normally.

Titanium.Media
VIDEO_FINISH_REASON_PLAYBACK_ERROR : Numberreadonly

Video playback ended abnormally.

Video playback ended abnormally.

Titanium.Media
VIDEO_FINISH_REASON_USER_EXITED : Numberreadonly

Video playback ended by user action (such as clicking the Done button).

Video playback ended by user action (such as clicking the Done button).

Titanium.Media
VIDEO_LOAD_STATE_FAILED : Numberreadonly

Indicates that the player can no longer play media items because of an error.

Indicates that the player can no longer play media items because of an error.

  • 0.8
  • 0.8
Titanium.Media
VIDEO_LOAD_STATE_PLAYABLE : Numberreadonly

Current media is playable.

Current media is playable.

Titanium.Media
VIDEO_LOAD_STATE_PLAYTHROUGH_OK : Numberreadonlyremoved

Playback will be automatically started in this state when autoplay is true.

Playback will be automatically started in this state when autoplay is true.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Titanium.Media
VIDEO_LOAD_STATE_STALLED : Numberreadonlyremoved

Playback will be automatically paused in this state, if started.

Playback will be automatically paused in this state, if started.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Titanium.Media
VIDEO_LOAD_STATE_UNKNOWN : Numberreadonly

Current load state is not known.

Current load state is not known.

Titanium.Media
VIDEO_MEDIA_TYPE_AUDIO : Numberreadonlyremoved

A audio type of media in the movie returned by Titanium.Media.VideoPlayer mediaTypes property.

A audio type of media in the movie returned by Titanium.Media.VideoPlayer mediaTypes property.

This property has been removed since 7.0.0

This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.

  • 0.8
  • 0.8
Titanium.Media
VIDEO_MEDIA_TYPE_NONE : Numberreadonlyremoved

An unknown type of media in the movie returned by Titanium.Media.VideoPlayer mediaTypes property.

An unknown type of media in the movie returned by Titanium.Media.VideoPlayer mediaTypes property.

This property has been removed since 7.0.0

This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.

  • 0.8
  • 0.8
Titanium.Media
VIDEO_MEDIA_TYPE_VIDEO : Numberreadonlyremoved

A video type of media in the movie returned by Titanium.Media.VideoPlayer mediaTypes property.

A video type of media in the movie returned by Titanium.Media.VideoPlayer mediaTypes property.

This property has been removed since 7.0.0

This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.

  • 0.8
  • 0.8
Titanium.Media
VIDEO_PLAYBACK_STATE_INTERRUPTED : Numberreadonly

Video playback has been interrupted.

Video playback has been interrupted.

Titanium.Media
VIDEO_PLAYBACK_STATE_PAUSED : Numberreadonly

Video playback is paused.

Video playback is paused.

Titanium.Media
VIDEO_PLAYBACK_STATE_PLAYING : Numberreadonly

Video is being played.

Video is being played.

Titanium.Media
VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD : Numberreadonlyremoved

Video playback is rewinding.

Video playback is rewinding.

This property has been removed since 7.0.0

This constant has been removed on iOS by using the official Apple AVPlayer that does not expose this functionality so far.

Titanium.Media
VIDEO_PLAYBACK_STATE_SEEKING_FORWARD : Numberreadonlyremoved

Video playback is seeking forward.

Video playback is seeking forward.

This property has been removed since 7.0.0

This constant has been removed on iOS by using the official Apple AVPlayer that does not expose this functionality so far.

Titanium.Media
VIDEO_PLAYBACK_STATE_STOPPED : Numberreadonly

Video playback is stopped.

Video playback is stopped.

Titanium.Media
VIDEO_REPEAT_MODE_NONE : Numberreadonly

Constant for disabling repeat on video playback.

Constant for disabling repeat on video playback.

  • 6.2.0
  • 0.9.0
  • 0.9.0
Titanium.Media
VIDEO_REPEAT_MODE_ONE : Numberreadonly

Constant for repeating one video (i.e., the one video will repeat constantly) during playback.

Constant for repeating one video (i.e., the one video will repeat constantly) during playback.

  • 6.2.0
  • 0.9.0
  • 0.9.0
Titanium.Media
VIDEO_SCALING_ASPECT_FILL : Numberreadonlyremoved

Scale video to fill the screen, clipping edges if necessary.

Scale video to fill the screen, clipping edges if necessary.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Video is scaled until the video fills the entire screen. Content at the edges of the larger of the two dimensions is clipped so that the other dimension fits the screen exactly. The aspect ratio of the movie is preserved.

Titanium.Media
VIDEO_SCALING_ASPECT_FIT : Numberreadonlyremoved

Scale video to fit the screen, letterboxing if necessary.

Scale video to fit the screen, letterboxing if necessary.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Video is scaled until the larger dimension fits on the screen exactly. In the other dimension, the region between the edge of the movie and the edge of the screen is filled with a black bar. The aspect ratio of the movie is preserved.

Titanium.Media
VIDEO_SCALING_MODE_FILL : Numberreadonlyremoved

Video is scaled until both dimensions fit the screen exactly, stretching if necessary.

Video is scaled until both dimensions fit the screen exactly, stretching if necessary.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

The aspect ratio of the video is not preserved.

Titanium.Media
VIDEO_SCALING_NONE : Numberreadonlyremoved

Video scaling is disabled.

Video scaling is disabled.

This property has been removed since 7.0.0

This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Titanium.Media
VIDEO_SCALING_RESIZE : Stringreadonly

Specifies that the video should be stretched to fill the bounds of layer.

Specifies that the video should be stretched to fill the bounds of layer.

  • 7.0.0
  • 7.0.0
Titanium.Media
VIDEO_SCALING_RESIZE_ASPECT : Stringreadonly

Specifies that the player should preserve the aspect ratio of video and fit the video within the bounds of layer.

Specifies that the player should preserve the aspect ratio of video and fit the video within the bounds of layer.

  • 7.0.0
  • 7.0.0
Titanium.Media
VIDEO_SCALING_RESIZE_ASPECT_FILL : Stringreadonly

Specifies that the player should preserve the aspect ratio of video and fill the bounds of layer.

Specifies that the player should preserve the aspect ratio of video and fill the bounds of layer.

  • 7.0.0
  • 7.0.0
Titanium.Media
VIDEO_SOURCE_TYPE_FILE : Numberreadonlyremoved

Video source type is a file.

Video source type is a file.

This property has been removed since 7.0.0

This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Related to the sourceType property of Titanium.Media.VideoPlayer.

  • 0.8
  • 0.8
Titanium.Media
VIDEO_SOURCE_TYPE_STREAMING : Numberreadonlyremoved

Video source type is a remote stream.

Video source type is a remote stream.

This property has been removed since 7.0.0

This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Related to the sourceType property of Titanium.Media.VideoPlayer

  • 0.8
  • 0.8
Titanium.Media
VIDEO_SOURCE_TYPE_UNKNOWN : Numberreadonlyremoved

Video source type is unknown.

Video source type is unknown.

This property has been removed since 7.0.0

This property has been removed in Titanium SDK 7.0.0 as of the official deprecation by Apple.

Related to the sourceType property of Titanium.Media.VideoPlayer

  • 0.8
  • 0.8
Titanium.Media
VIDEO_TIME_OPTION_CLOSEST_SYNC : Numberreadonly

Use the closest sync (or key) frame at given the time.

Use the closest sync (or key) frame at given the time.

  • 3.6.0
Titanium.Media
VIDEO_TIME_OPTION_EXACT : Numberreadonly

Use the exact time.

Use the exact time.

  • 0.8
  • 0.8
Titanium.Media
VIDEO_TIME_OPTION_NEAREST_KEYFRAME : Numberreadonly

Use the closest keyframe in the time.

Use the closest keyframe in the time.

  • 3.6.0
  • 0.8
  • 0.8
Titanium.Media
VIDEO_TIME_OPTION_NEXT_SYNC : Numberreadonly

Use the sync (or key) frame located right after or at given the time.

Use the sync (or key) frame located right after or at given the time.

  • 3.6.0
Titanium.Media
VIDEO_TIME_OPTION_PREVIOUS_SYNC : Numberreadonly

Use the sync (or key) frame located right before or at given the time.

Use the sync (or key) frame located right before or at given the time.

  • 3.6.0
apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0

An instance of Titanium.Media.MusicPlayer representing the app-specific music player.

An instance of Titanium.Media.MusicPlayer representing the app-specific music player.

  • 0.8
  • 0.8
Titanium.Media
audioLineType : Numberreadonlyremoved

Returns the line type constant for the current line type.

Returns the line type constant for the current line type.

This property has been removed since 3.6.0

Use <Titanium.Media.currentRoute> instead.

  • 0.8
  • 0.8
Titanium.Media
audioPlaying : Booleanreadonly

Returns true if the device is playing audio.

Returns true if the device is playing audio.

  • 0.8
  • 0.8
Titanium.Media
audioSessionCategory : Number

A constant for the audio session category to be used.

A constant for the audio session category to be used.

Set to one of the AUDIO_SESSION_CATEGORY constants defined in Titanium.Media.

Must be set while the audio session is inactive (no sounds are playing, no listeners for audio properties on the Media module, but the iPod may be active).

This API can be assigned the following constants:

  • 3.4.2
  • 3.4.2
Titanium.Media
audioSessionMode : Numberremoved

A constant for the audio session mode to be used.

A constant for the audio session mode to be used.

This property has been removed since 6.0.0

Use <Titanium.Media.audioSessionCategory> instead.

Set to one of the AUDIO_SESSION_MODE constants defined in Titanium.Media.

Must be set while the audio session is inactive (no sounds are playing, no listeners for audio properties on the Media module, but the iPod may be active).

This API can be assigned the following constants:

  • 0.8
  • 0.8
Titanium.Media
: Object[]
Array of media type constants supported for the camera. ...

Array of media type constants supported for the camera.

This API can be assigned the following constants:

  • 0.8
  • 0.8
Titanium.Media
: Number[]readonly
Array indicating which cameras are available, CAMERA_FRONT, CAMERA_REAR or both. ...

Array indicating which cameras are available, CAMERA_FRONT, CAMERA_REAR or both.

This API can be assigned the following constants:

  • 3.2.0
  • 0.8
  • 0.8
Titanium.Media
: Object[]
Array of media type constants supported for saving to the device's camera roll or saved images album. ...

Array of media type constants supported for saving to the device's camera roll or saved images album.

This API can be assigned the following constants:

  • 0.8
  • 0.8
Titanium.Media
: Object[]
Array of media type constants supported for the photo library. ...

Array of media type constants supported for the photo library.

This API can be assigned the following constants:

  • 0.8
  • 0.8
Titanium.Media
averageMicrophonePower : Number

Current average microphone level in dB or -1 if microphone monitoring is disabled.

Current average microphone level in dB or -1 if microphone monitoring is disabled.

See startMicrophoneMonitor, stopMicrophoneMonitor.

  • 0.8
  • 0.8
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0
Titanium.Media
: Numberreadonly
Returns the authorization status for the camera. ...

Returns the authorization status for the camera.

Requires: iOS 7.0 and later

This API can be assigned the following constants:

  • 5.2.0
  • 5.2.0
Titanium.Media
: Numberdeprecatedreadonly
Returns the authorization status for the camera. ...

Returns the authorization status for the camera.

  • 4.0.0
  • 4.0.0
Titanium.Media
: Number
Determines how the flash is fired when using the device's camera. ...

Determines how the flash is fired when using the device's camera.

This API can be assigned the following constants:

Default: Titanium.Media.CAMERA_FLASH_AUTO

  • 3.3.0
  • 1.4.0
  • 1.4.0
Titanium.Media
canRecord : Booleanreadonly

true if the device has a recording input device available.

true if the device has a recording input device available.

  • 6.2.0
  • 0.8
  • 0.8
Titanium.Media
currentRoute : RouteDescriptionreadonly

Returns a description of the current route, consisting of zero or more input ports and zero or more output ports.

Returns a description of the current route, consisting of zero or more input ports and zero or more output ports.

  • 3.4.2
  • 3.4.2
Titanium.Media
isCameraSupported : Booleanreadonly

true if the device has camera support.

true if the device has camera support.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Titanium.Media
peakMicrophonePower : Numberreadonly

Current microphone level peak power in dB or -1 if microphone monitoring is disabled.

Current microphone level peak power in dB or -1 if microphone monitoring is disabled.

See startMicrophoneMonitor, stopMicrophoneMonitor.

  • 0.8
  • 0.8

An instance of Titanium.Media.MusicPlayer representing the system-wide music player.

An instance of Titanium.Media.MusicPlayer representing the system-wide music player.

  • 0.8
  • 0.8
Titanium.Media
volume : Numberreadonly

Current volume of the playback device.

Current volume of the playback device.

  • 0.8
  • 0.8
Defined By

Methods

Adds the specified callback as an event listener for the named event. ...

Adds the specified callback as an event listener for the named event.

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to invoke when the event is fired.

Returns

  • void
Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Titanium.Media
( )
Plays a device beep notification. ...

Plays a device beep notification.

  • 0.8
  • 0.8

Returns

  • void
Titanium.Media
( [parameters] ) : Titanium.Media.AudioPlayer
Creates and returns an instance of Titanium.Media.AudioPlayer. ...

Creates and returns an instance of Titanium.Media.AudioPlayer.

  • 0.9
  • 0.9
  • 0.9

Parameters

Returns

Titanium.Media
( [parameters] ) : Titanium.Media.AudioRecorder
Creates and returns an instance of Titanium.Media.AudioRecorder. ...

Creates and returns an instance of Titanium.Media.AudioRecorder.

  • 6.2.0
  • 0.9
  • 0.9

Parameters

Returns

Titanium.Media
( [parameters] ) : Titanium.Media.Sound
Creates and returns an instance of Titanium.Media.Sound. ...

Creates and returns an instance of Titanium.Media.Sound.

Parameters

Returns

Titanium.Media
( [parameters] ) : Titanium.Media.SystemAlert
Creates and returns an instance of Titanium.Media.SystemAlert. ...

Creates and returns an instance of Titanium.Media.SystemAlert.

  • 6.1.0
  • 6.1.0

Parameters

Returns

Titanium.Media
( [parameters] ) : Titanium.Media.VideoPlayer
Creates and returns an instance of Titanium.Media.VideoPlayer. ...

Creates and returns an instance of Titanium.Media.VideoPlayer.

  • 0.9
  • 0.9
  • 0.9

Parameters

Returns

Fires a synthesized event to any registered listeners. ...

Fires a synthesized event to any registered listeners.

Parameters

  • name : String

    Name of the event.

  • event : Dictionary

    A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the appMusicPlayer property. ...

Gets the value of the appMusicPlayer property.

  • 0.8
  • 0.8

Returns

Titanium.Media
( ) : Numberremoved
Gets the value of the audioLineType property. ...

Gets the value of the audioLineType property.

This method has been removed since 3.6.0

Use <Titanium.Media.currentRoute> instead.

  • 0.8
  • 0.8

Returns

  • Number
Titanium.Media
( ) : Boolean
Gets the value of the audioPlaying property. ...

Gets the value of the audioPlaying property.

  • 0.8
  • 0.8

Returns

  • Boolean
Titanium.Media
( ) : Number
Gets the value of the audioSessionCategory property. ...

Gets the value of the audioSessionCategory property.

  • 3.4.2
  • 3.4.2

Returns

  • Number
Titanium.Media
( ) : Numberremoved
Gets the value of the audioSessionMode property. ...

Gets the value of the audioSessionMode property.

This method has been removed since 6.0.0

Use <Titanium.Media.audioSessionCategory> instead.

  • 0.8
  • 0.8

Returns

  • Number
Titanium.Media
( ) : Object[]
Gets the value of the availableCameraMediaTypes property. ...

Gets the value of the availableCameraMediaTypes property.

  • 0.8
  • 0.8

Returns

  • Object[]
Titanium.Media
( ) : Number[]
Gets the value of the availableCameras property. ...

Gets the value of the availableCameras property.

  • 3.2.0
  • 0.8
  • 0.8

Returns

  • Number[]
Titanium.Media
( ) : Object[]
Gets the value of the availablePhotoGalleryMediaTypes property. ...

Gets the value of the availablePhotoGalleryMediaTypes property.

  • 0.8
  • 0.8

Returns

  • Object[]
Titanium.Media
( ) : Object[]
Gets the value of the availablePhotoMediaTypes property. ...

Gets the value of the availablePhotoMediaTypes property.

  • 0.8
  • 0.8

Returns

  • Object[]
Titanium.Media
( ) : Number
Gets the value of the averageMicrophonePower property. ...

Gets the value of the averageMicrophonePower property.

  • 0.8
  • 0.8

Returns

  • Number
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Titanium.Media
( ) : Number
Gets the value of the cameraAuthorization property. ...

Gets the value of the cameraAuthorization property.

  • 5.2.0
  • 5.2.0

Returns

  • Number
Titanium.Media
( ) : Numberdeprecated
Gets the value of the cameraAuthorizationStatus property. ...

Gets the value of the cameraAuthorizationStatus property.

deprecated since 5.2.0

Use <Titanium.Media.cameraAuthorization> instead.

  • 4.0.0
  • 4.0.0

Returns

  • Number
Titanium.Media
( ) : Number
Gets the value of the cameraFlashMode property. ...

Gets the value of the cameraFlashMode property.

  • 3.3.0
  • 1.4.0
  • 1.4.0

Returns

  • Number
Titanium.Media
( ) : Boolean
Gets the value of the canRecord property. ...

Gets the value of the canRecord property.

  • 6.2.0
  • 0.8
  • 0.8

Returns

  • Boolean
Gets the value of the currentRoute property. ...

Gets the value of the currentRoute property.

  • 3.4.2
  • 3.4.2

Returns

Titanium.Media
( ) : Boolean
Gets the value of the isCameraSupported property. ...

Gets the value of the isCameraSupported property.

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Titanium.Media
( ) : Number
Gets the value of the peakMicrophonePower property. ...

Gets the value of the peakMicrophonePower property.

  • 0.8
  • 0.8

Returns

  • Number
Titanium.Media
( ) : Number
Gets the value of the QUALITY_640x480 property. ...

Gets the value of the QUALITY_640x480 property.

  • 0.8
  • 0.8

Returns

  • Number
Titanium.Media
( ) : Number
Gets the value of the QUALITY_IFRAME_1280x720 property. ...

Gets the value of the QUALITY_IFRAME_1280x720 property.

  • 6.0.0
  • 6.0.0

Returns

  • Number
Titanium.Media
( ) : Number
Gets the value of the QUALITY_IFRAME_960x540 property. ...

Gets the value of the QUALITY_IFRAME_960x540 property.

  • 6.0.0
  • 6.0.0

Returns

  • Number
Gets the value of the systemMusicPlayer property. ...

Gets the value of the systemMusicPlayer property.

  • 0.8
  • 0.8

Returns

Titanium.Media
( ) : Number
Gets the value of the volume property. ...

Gets the value of the volume property.

  • 0.8
  • 0.8

Returns

  • Number
Titanium.Media
( ) : Booleandeprecated
Returns true if the app has audio permissions. ...

Returns true if the app has audio permissions.

deprecated since 6.1.0

Use <Titanium.Media.hasAudioRecorderPermissions> instead.

On iOS 7.0, recording audio requires explicit permission from the user. After the user grants or denies permission, the system remembers the choice for future use in the same app. If permission is not granted, or if the user has not yet responded to the permission prompt, any audio recording sessions record only silence.

In addition, Apple introduced the Info.plist key NSMicrophoneUsageDescription that is used to display an own description while authorizing microphone permissions. In iOS 10, this key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

  • 6.0.0
  • 6.0.0

Returns

  • Boolean
Titanium.Media
( ) : Boolean
Returns true if the app has audio permissions. ...

Returns true if the app has audio permissions.

On iOS 7.0, recording audio requires explicit permission from the user. After the user grants or denies permission, the system remembers the choice for future use in the same app. If permission is not granted, or if the user has not yet responded to the permission prompt, any audio recording sessions record only silence.

In addition, Apple introduced the Info.plist key NSMicrophoneUsageDescription that is used to display an own description while authorizing microphone permissions. In iOS 10, this key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

  • 6.2.0
  • 6.1.0
  • 6.1.0

Returns

  • Boolean
Titanium.Media
( ) : Boolean
Returns true if the app has camera access. ...

Returns true if the app has camera access.

  • 5.1.0
  • 5.1.0
  • 5.1.0

Returns

  • Boolean
Titanium.Media
( ) : Boolean
Returns true if the app has camera access. ...

Returns true if the app has camera access.

Music-library permissions are only needed in iOS 9.3 and later and will be ignored on older iOS versions. Because of that, the method will return true for devices that run iOS < 9.3.

  • 6.0.0
  • 6.0.0

Returns

  • Boolean
Titanium.Media
( ) : Boolean
Returns true if the app has photo gallery permissions. ...

Returns true if the app has photo gallery permissions.

  • 6.0.0
  • 6.0.0

Returns

  • Boolean
Titanium.Media
( )
Hides the device camera UI. ...

Hides the device camera UI.

Must be called after calling showCamera and only when autohide is set to false. This method causes the media capture UI to be hidden.

  • 3.2.0
  • 0.8
  • 0.8

Returns

  • void
Titanium.Media
( )
Hides the music library. ...

Hides the music library.

Must be called after calling openMusicLibrary and only when autohide is set to false.

  • 0.8
  • 0.8

Returns

  • void
Titanium.Media
( source, type ) : Boolean
Returns true if the source supports the specified media type. ...

Returns true if the source supports the specified media type.

You can query whether a given media type is supported by the device's camera (source == 'camera') or photo library (source == 'photo').

An additional value, photogallery can be used to query the media supported by the device's camera roll or saved image album, which is a subset of the iOS photo library. However, when calling openPhotoGallery on iOS, the entire library is displayed, and there is currently no way to restrict the gallery to show only the camera roll/saved images album.

  • 0.8
  • 0.8

Parameters

Returns

  • Boolean
Titanium.Media
( options )
Shows the music library and allows the user to select one or more tracks. ...

Shows the music library and allows the user to select one or more tracks.

If autohide is set to false, you must hide the library explicitly using hideMusicLibrary.

  • 0.8
  • 0.8

Parameters

Returns

  • void
Titanium.Media
( options )
Opens the photo gallery image picker. ...

Opens the photo gallery image picker.

In iOS 6, Apple introduced the Info.plist key NSPhotoLibraryUsageDescription that is used to display an own description while authorizing gallery permissions. In iOS 10, this key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

Parameters

Returns

  • void
Titanium.Media
( options )
Displays the given image. ...

Displays the given image.

  • 0.8

Parameters

Returns

  • void
Titanium.Media
( query ) : Titanium.Media.Item[]
Searches the music library for items matching the specified search predicates. ...

Searches the music library for items matching the specified search predicates.

Use hasMusicLibraryPermissions to check the granted permissions and requestMusicLibraryPermissions to request the permissions. This is especially important when running on an iOS 10 device, because the music-library access will crash without having the privacy-key NSAppleMusicUsageDescription that is specified in requestMusicLibraryPermissions.

  • 0.8
  • 0.8

Parameters

Returns

Removes the specified callback as an event listener for the named event. ...

Removes the specified callback as an event listener for the named event.

Multiple listeners can be registered for the same event, so the callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to remove. Must be the same function passed to addEventListener.

Returns

  • void
Titanium.Media
( callback )deprecated
Request the user's permission for audio recording. ...

Request the user's permission for audio recording.

deprecated since 6.1.0

Use <Titanium.Media.requestAudioRecorderPermissions> instead.

On iOS 7.0, recording audio requires explicit permission from the user. After the user grants or denies permission, the system remembers the choice for future use in the same app. If permission is not granted, or if the user has not yet responded to the permission prompt, any audio recording sessions record only silence.

In addition, Apple introduced the Info.plist key NSMicrophoneUsageDescription that is used to display an own description while authorizing microphone permissions. In iOS 10, this key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

  • 5.1.0
  • 5.1.0

Parameters

Returns

  • void
Titanium.Media
( callback )
Request the user's permission for audio recording. ...

Request the user's permission for audio recording.

On iOS 7.0, recording audio requires explicit permission from the user. After the user grants or denies permission, the system remembers the choice for future use in the same app. If permission is not granted, or if the user has not yet responded to the permission prompt, any audio recording sessions record only silence.

In addition, Apple introduced the Info.plist key NSMicrophoneUsageDescription that is used to display an own description while authorizing microphone permissions. In iOS 10, this key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

  • 6.2.0
  • 6.1.0
  • 6.1.0

Parameters

Returns

  • void
Titanium.Media
( callback )deprecated
Request the user's permission for audio recording. ...

Request the user's permission for audio recording.

deprecated since 5.1.0

Use <Titanium.Media.requestAudioRecorderPermissions> instead.

On iOS 7.0, recording audio requires explicit permission from the user. After the user grants or denies permission, the system remembers the choice for future use in the same app. If permission is not granted, or if the user has not yet responded to the permission prompt, any audio recording sessions record only silence.

In addition, Apple introduced the Info.plist key NSMicrophoneUsageDescription that is used to display an own description while authorizing microphone permissions. In iOS 10, this key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

  • 3.1.3
  • 3.1.3

Parameters

Returns

  • void
Titanium.Media
( callback )deprecated
Requests for camera access. ...

Requests for camera access.

deprecated

5.1.0 Please use <Titanium.Media.requestCameraPermissions> instead.

Requires: iOS 7.0 and later

This method allows the app to request for camera access, before or without the user granting it in showCamera. The request view will only show if user has not yet made a decision. If he has, the callback will return his earlier decision, and if any changes has to be made, the user has to change it in the device settings.

  • 4.0.0
  • 4.0.0

Parameters

Returns

  • void
Titanium.Media
( callback )
Requests for camera access. ...

Requests for camera access.

Requires: iOS 7.0 and later

On Android, the request view will show if the permission is not accepted by the user, and the user did not check the box "Never ask again" when denying the request. If the user checks the box "Never ask again," the user has to manually enable the permission in device settings.

This method requests Manifest.permission.CAMERA on Android. If you require other permissions, you can also use Titanium.Android.requestPermissions.

In iOS 6, Apple introduced the Info.plist key NSCameraUsageDescription that is used to display an own description while authorizing camera permissions. In iOS 10, this key is mandatory when taking a photo and the application will crash if your app does not include the key. Check the Apple docs for more information. When using the camera to take a video, you also need the NSMicrophoneUsageDescription key. In addition, the authorization dialog will only show if user has not made a decision, yet. If the user has, the callback will return the earlier decision. To change the permission the user needs to change it in the device settings.

  • 5.1.0
  • 5.1.0
  • 5.1.0

Parameters

Returns

  • void
Titanium.Media
( callback )
Request permissions for the native music-library. ...

Request permissions for the native music-library.

Music-library permissions are only needed in iOS 9.3 and later and will be ignored on older iOS versions. Because of that, the callback will ignore the permission-check and always return {success: true} for devices that run iOS < 9.3.

Important: On iOS 10, Apple introduced the Info.plist key NSAppleMusicUsageDescription that is used to display an own description while authorizing the music library. This key is mandatory and the application will crash if your app does not include the key. Check the Apple docs for more information.

  • 6.0.0
  • 6.0.0

Parameters

Returns

  • void
Titanium.Media
( callback )
Requests for photo gallery permissions. ...

Requests for photo gallery permissions.

Requires: iOS 8.0 and later

In iOS 6, Apple introduced the Info.plist key NSPhotoLibraryUsageDescription that is used to display an own description while authorizing photo gallery permissions. In iOS 10, this key is mandatory when accessing the photo gallery and the application will crash if your app does not include the key. Check the Apple docs for more information. If the user has, the callback will return the earlier decision. To change the permission the user needs to change it in the device settings.

This API is available in iOS 8 and later. Earlier versions of iOS, as well as apps that do not include this method, will present the system-dialog while the dialog is opened with openPhotoGallery.

  • 6.0.0
  • 6.0.0

Parameters

Returns

  • void
Titanium.Media
( media, callbacks )
Saves media to the device's photo gallery / camera roll. ...

Saves media to the device's photo gallery / camera roll.

This operation is asynchronous. The caller can supply callbacks to be triggered when the save operation completes.

Media can be passed as either a Blob object or a File object. If the media argument is not one of these types, an error is generated.

Note that when passing a file (or a blob created from a file), the file name must have the appropriate extension for the data--for example, image.jpg or video1.mov work, but video1.tmp does not. Currently, the .mp4 extension is not supported, but MP4 files may be imported by saving them with the .mov extension.

On Android this method only supports saving images to the device gallery prior to Titanium SDK 6.1.0.

  • 3.3.0
  • 0.8
  • 0.8

Parameters

  • media : Titanium.Blob/Titanium.Filesystem.File

    Media to save to the camera roll or media gallery.

  • callbacks : Object

    Pass a dictionary with the following supported keys: success a function that will be called when the save succeeds, and error a function that will be called upon receiving an error.

Returns

  • void
Titanium.Media
( audioSessionCategory )
Sets the value of the audioSessionCategory property. ...

Sets the value of the audioSessionCategory property.

  • 3.4.2
  • 3.4.2

Parameters

  • audioSessionCategory : Number

    New value for the property.

Returns

  • void
Titanium.Media
( audioSessionMode )removed
Sets the value of the audioSessionMode property. ...

Sets the value of the audioSessionMode property.

This method has been removed since 6.0.0

Use <Titanium.Media.audioSessionCategory> instead.

  • 0.8
  • 0.8

Parameters

  • audioSessionMode : Number

    New value for the property.

Returns

  • void
Titanium.Media
( availableCameraMediaTypes )
Sets the value of the availableCameraMediaTypes property. ...

Sets the value of the availableCameraMediaTypes property.

  • 0.8
  • 0.8

Parameters

  • availableCameraMediaTypes : Array<Object>

    New value for the property.

Returns

  • void
Titanium.Media
( availablePhotoGalleryMediaTypes )
Sets the value of the availablePhotoGalleryMediaTypes property. ...

Sets the value of the availablePhotoGalleryMediaTypes property.

  • 0.8
  • 0.8

Parameters

  • availablePhotoGalleryMediaTypes : Array<Object>

    New value for the property.

Returns

  • void
Titanium.Media
( availablePhotoMediaTypes )
Sets the value of the availablePhotoMediaTypes property. ...

Sets the value of the availablePhotoMediaTypes property.

  • 0.8
  • 0.8

Parameters

  • availablePhotoMediaTypes : Array<Object>

    New value for the property.

Returns

  • void
Titanium.Media
( averageMicrophonePower )
Sets the value of the averageMicrophonePower property. ...

Sets the value of the averageMicrophonePower property.

  • 0.8
  • 0.8

Parameters

  • averageMicrophonePower : Number

    New value for the property.

Returns

  • void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Titanium.Media
( cameraFlashMode )
Sets the value of the cameraFlashMode property. ...

Sets the value of the cameraFlashMode property.

  • 3.3.0
  • 1.4.0
  • 1.4.0

Parameters

  • cameraFlashMode : Number

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Titanium.Media
( route )
Overrides the default audio route when using the AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD session mode. ...

Overrides the default audio route when using the AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD session mode.

By default, when using the AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD session mode, the audio output is routed to the speaker in the receiver. This method lets you specify that audio should be routed to the built-in speaker.

If you override the audio route while audio is playing the changes won't not take effect until the audio is restarted.

  • 0.8
  • 0.8

Parameters

Returns

  • void
Titanium.Media
( options )
Shows the camera. ...

Shows the camera.

By default, the native camera controls are displayed. To add your own camera controls, you can add an overlay view by setting the overlay property on the options argument.

Android Platform Notes

To suppress the default controls, set autohide to false and then set the overlay property to a view that contains a control (such as a button) to take the photo. You must then control the camera explicitly, using the takePicture and hideCamera methods.

iOS Platform Notes

To suppress the default controls, set showControls and autohide to false.

If the showControls option is false, you must control the camera explicitly, using the takePicture and hideCamera methods.

Images taken with the camera will not have accurate geolocation data embedded in the images; the latitude and longitude will be set to '0'. This is not an error, but a limitation which Apple has put on the camera API.

Important: Use hasCameraPermissions and requestCameraPermissions to ask for camera permissions. This is especially important when running on iOS 10 and later, since the application may crash otherwise.

Parameters

Returns

  • void
Titanium.Media
( )
Starts monitoring the microphone sound level. ...

Starts monitoring the microphone sound level.

  • 0.8
  • 0.8

Returns

  • void
Titanium.Media
( )
Starts video capture using the camera specified. ...

Starts video capture using the camera specified.

  • 5.4.0
  • 0.8
  • 0.8

Returns

  • void
Titanium.Media
( )
Stops monitoring the microphone sound level. ...

Stops monitoring the microphone sound level.

  • 0.8
  • 0.8

Returns

  • void
Titanium.Media
( )
Stops video capture using the camera specified. ...

Stops video capture using the camera specified.

  • 5.4.0
  • 0.8
  • 0.8

Returns

  • void
Titanium.Media
( camera )
Switches between front and rear-facing cameras. ...

Switches between front and rear-facing cameras. Make sure to set one of the below constants to determine the camera you want to switch to.

In Android, this can only be called when using a custom overlay (see showCamera).

  • 3.2.0
  • 1.8.1
  • 1.8.1

Parameters

  • camera : Number

    Constant indicating to which camera you want to switch.

    This API can be assigned the following constants:

Returns

  • void
Titanium.Media
( )
Uses the device camera to capture a photo. ...

Uses the device camera to capture a photo.

Must be called after calling showCamera and only when autohide is set to false.

This method causes the media capture device to capture a photo and call the success callback.

Returns

  • void
Titanium.Media
( callback )
Takes a screen shot of the visible UI on the device. ...

Takes a screen shot of the visible UI on the device.

This method is asynchronous. The screenshot is returned in the callback argument. The callback argument's media property contains the screenshot image as a Blob object.

Parameters

Returns

  • void
Titanium.Media
( [pattern] )
Makes the device vibrate. ...

Makes the device vibrate.

On Android, a pattern argument can be provided to specify a vibration pattern.

The pattern is an array of Number values. Each number in the array is interpreted as a duration in milliseconds. The first number is the delay before the pattern starts, and the remaining numbers are interpreted as alternating periods of on and off times. For example, the following pattern:

[ 0, 500, 100, 500, 100, 500 ]

Would cause the vibration to start immediately (delay = 0), and perform three long vibrations (500 ms) separated by short pauses (100ms).

Parameters

  • pattern : Array<Number> (optional)

    Array of values identifying a vibrate pattern (only used on Android).

Returns

  • void
Defined By

Events

Titanium.Media
Fires when the camera overlay is ready to take pictures. ...

Fires when the camera overlay is ready to take pictures.

  • 6.0.0

Properties

  • source : Object

    Source object that fired the event.

    •  
    •  
    •  
  • type : String

    Name of the event fired.

    •  
    •  
    •  
  • bubbles : Boolean

    True if the event will try to bubble up if possible.

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
Titanium.Media
deprecated
Fired when an audio line type change is detected. ...

Fired when an audio line type change is detected.

deprecated since 3.4.2

Titanium no longer fires this event. Use the <Titanium.Media.routechange> event instead.

  • 0.8
  • 0.8

Properties

  • source : Object

    Source object that fired the event.

    •  
    •  
    •  
  • type : String

    Name of the event fired.

    •  
    •  
    •  
  • bubbles : Boolean

    True if the event will try to bubble up if possible.

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
Titanium.Media
deprecated
Fired when the availablity of recording input changes. ...

Fired when the availablity of recording input changes.

deprecated since 3.4.2

Titanium no longer fires this event. Use the <Titanium.Media.canRecord> property to check if an input hardware is available.

  • 0.8
  • 0.8

Properties

  • available : Boolean

    Indicates whether the recording device is available.

  • source : Object

    Source object that fired the event.

    •  
    •  
    •  
  • type : String

    Name of the event fired.

    •  
    •  
    •  
  • bubbles : Boolean

    True if the event will try to bubble up if possible.

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
Titanium.Media
Fired when an audio line type change is detected. ...

Fired when an audio line type change is detected.

  • 3.4.2
  • 3.4.2

Properties

  • reason : String

    The reason for route change.

  • oldRoute : RouteDescription

    Returns a description of the old route, consisting of zero or more input ports and zero or more output ports.

  • currentRoute : RouteDescription

    Returns a description of the current route, consisting of zero or more input ports and zero or more output ports.

  • source : Object

    Source object that fired the event.

    •  
    •  
    •  
  • type : String

    Name of the event fired.

    •  
    •  
    •  
  • bubbles : Boolean

    True if the event will try to bubble up if possible.

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
Titanium.Media
Fired when the volume output changes. ...

Fired when the volume output changes.

  • 0.8
  • 0.8

Properties

  • volume : Number

    New volume level in dB.

  • source : Object

    Source object that fired the event.

    •  
    •  
    •  
  • type : String

    Name of the event fired.

    •  
    •  
    •  
  • bubbles : Boolean

    True if the event will try to bubble up if possible.

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •