@maccesar/titools 2.10.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS-VERCEL-RESEARCH.md +23 -12
- package/README.md +81 -182
- package/agents/ti-pro.md +8 -14
- package/lib/cleanup.js +13 -0
- package/lib/commands/skills.js +2 -1
- package/lib/commands/update.js +4 -1
- package/lib/config.js +9 -11
- package/lib/platform.js +1 -1
- package/package.json +2 -3
- package/skills/purgetss/SKILL.md +12 -0
- package/skills/purgetss/references/animation-advanced.md +0 -9
- package/skills/purgetss/references/app-branding.md +20 -0
- package/skills/purgetss/references/appearance-module.md +85 -27
- package/skills/purgetss/references/apply-directive.md +60 -0
- package/skills/purgetss/references/arbitrary-values.md +41 -0
- package/skills/purgetss/references/cli-commands.md +52 -17
- package/skills/purgetss/references/custom-rules.md +36 -19
- package/skills/purgetss/references/customization-deep-dive.md +37 -15
- package/skills/purgetss/references/grid-layout.md +45 -26
- package/skills/purgetss/references/icon-fonts.md +27 -25
- package/skills/purgetss/references/installation-setup.md +28 -2
- package/skills/purgetss/references/ios-large-titles.md +31 -15
- package/skills/purgetss/references/multi-density-images.md +57 -0
- package/skills/purgetss/references/opacity-modifier.md +11 -2
- package/skills/purgetss/references/semantic-colors.md +44 -1
- package/skills/purgetss/references/tikit-components.md +1 -3
- package/skills/alloy-guides/SKILL.md +0 -190
- package/skills/alloy-guides/references/CLI_TASKS.md +0 -233
- package/skills/alloy-guides/references/CONCEPTS.md +0 -171
- package/skills/alloy-guides/references/CONTROLLERS.md +0 -279
- package/skills/alloy-guides/references/MODELS.md +0 -1214
- package/skills/alloy-guides/references/PURGETSS.md +0 -46
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +0 -235
- package/skills/alloy-guides/references/VIEWS_STYLES.md +0 -375
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
- package/skills/alloy-guides/references/VIEWS_XML.md +0 -581
- package/skills/alloy-guides/references/WIDGETS.md +0 -160
- package/skills/alloy-howtos/SKILL.md +0 -181
- package/skills/alloy-howtos/references/best_practices.md +0 -121
- package/skills/alloy-howtos/references/cli_reference.md +0 -230
- package/skills/alloy-howtos/references/config_files.md +0 -158
- package/skills/alloy-howtos/references/custom_tags.md +0 -148
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +0 -78
- package/skills/alloy-howtos/references/samples.md +0 -156
- package/skills/ti-api/SKILL.md +0 -109
- package/skills/ti-api/references/api-android.md +0 -675
- package/skills/ti-api/references/api-app-platform.md +0 -636
- package/skills/ti-api/references/api-core.md +0 -764
- package/skills/ti-api/references/api-data-network.md +0 -641
- package/skills/ti-api/references/api-media.md +0 -655
- package/skills/ti-api/references/api-modules-ble-bluetooth.md +0 -657
- package/skills/ti-api/references/api-modules-coremotion-urlsession.md +0 -411
- package/skills/ti-api/references/api-modules-map.md +0 -632
- package/skills/ti-api/references/api-modules-nfc.md +0 -725
- package/skills/ti-api/references/api-modules-social-misc.md +0 -526
- package/skills/ti-api/references/api-services.md +0 -700
- package/skills/ti-api/references/api-ui-android.md +0 -499
- package/skills/ti-api/references/api-ui-extras.md +0 -702
- package/skills/ti-api/references/api-ui-ios-animator.md +0 -378
- package/skills/ti-api/references/api-ui-ios.md +0 -756
- package/skills/ti-api/references/api-ui-lists.md +0 -581
- package/skills/ti-api/references/api-ui-text-input.md +0 -607
- package/skills/ti-api/references/api-ui-views.md +0 -572
- package/skills/ti-api/references/api-ui-windows-navigation.md +0 -676
- package/skills/ti-api/references/api-xml-global.md +0 -743
- package/skills/ti-guides/SKILL.md +0 -75
- package/skills/ti-guides/references/advanced-data-and-images.md +0 -155
- package/skills/ti-guides/references/android-manifest.md +0 -97
- package/skills/ti-guides/references/app-distribution.md +0 -373
- package/skills/ti-guides/references/application-frameworks.md +0 -366
- package/skills/ti-guides/references/cli-reference.md +0 -700
- package/skills/ti-guides/references/coding-best-practices.md +0 -150
- package/skills/ti-guides/references/commonjs-advanced.md +0 -279
- package/skills/ti-guides/references/hello-world.md +0 -99
- package/skills/ti-guides/references/hyperloop-native-access.md +0 -458
- package/skills/ti-guides/references/javascript-primer.md +0 -402
- package/skills/ti-guides/references/reserved-words.md +0 -36
- package/skills/ti-guides/references/resources.md +0 -172
- package/skills/ti-guides/references/style-and-conventions.md +0 -104
- package/skills/ti-guides/references/tiapp-config.md +0 -655
- package/skills/ti-howtos/SKILL.md +0 -143
- package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -609
- package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
- package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
- package/skills/ti-howtos/references/cross-platform-development.md +0 -358
- package/skills/ti-howtos/references/debugging-profiling.md +0 -473
- package/skills/ti-howtos/references/extending-titanium.md +0 -684
- package/skills/ti-howtos/references/google-maps-v2.md +0 -172
- package/skills/ti-howtos/references/ios-map-kit.md +0 -149
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -595
- package/skills/ti-howtos/references/local-data-sources.md +0 -310
- package/skills/ti-howtos/references/location-and-maps.md +0 -267
- package/skills/ti-howtos/references/media-apis.md +0 -268
- package/skills/ti-howtos/references/notification-services.md +0 -539
- package/skills/ti-howtos/references/remote-data-sources.md +0 -339
- package/skills/ti-howtos/references/tutorials.md +0 -552
- package/skills/ti-howtos/references/using-modules.md +0 -182
- package/skills/ti-howtos/references/web-content-integration.md +0 -288
- package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -125
|
@@ -1,655 +0,0 @@
|
|
|
1
|
-
# Ti.Media API Reference
|
|
2
|
-
|
|
3
|
-
## Ti.Media
|
|
4
|
-
> The top-level Media module.
|
|
5
|
-
> Extends Ti.Module
|
|
6
|
-
> Platforms: both
|
|
7
|
-
> Type: module
|
|
8
|
-
|
|
9
|
-
The Media module is used to access the device's media-related functionality, such
|
|
10
|
-
as using the device's camera and photo gallery, playing media files, or recording
|
|
11
|
-
audio or video.
|
|
12
|
-
For examples of using the Media APIs, refer to the
|
|
13
|
-
[Working with Media APIs guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Working_with_Media_APIs/)
|
|
14
|
-
in addition to the other media submodule API documentation.
|
|
15
|
-
**Note**: Some third party Android camera apps may choose to ignore video recording quality
|
|
16
|
-
settings. If you wish to specifically set the video quality, don't assume
|
|
17
|
-
`EXTRA_VIDEO_QUALITY` intent will be respected by the camera app and use Titanium's built-in
|
|
18
|
-
camera window which can be used to assign the `overlay` property when calling the
|
|
19
|
-
`showCamera()` method.
|
|
20
|
-
|
|
21
|
-
### Properties (unique: 28/178)
|
|
22
|
-
| Property | Type | Default | Platform | Description |
|
|
23
|
-
|----------|------|---------|----------|-------------|
|
|
24
|
-
| QUALITY_640x480 | Number | — | both | Media type constant for medium-quality video recording. |
|
|
25
|
-
| QUALITY_IFRAME_1280x720 | Number | — | both | Media type constant for medium-quality video recording. |
|
|
26
|
-
| QUALITY_IFRAME_960x540 | Number | — | ios | Media type constant for medium-quality video recording. |
|
|
27
|
-
| appMusicPlayer | Ti.Media.MusicPlayer | — | ios | An instance of <Titanium.Media.MusicPlayer> representing the app-specific music… |
|
|
28
|
-
| audioPlaying | Boolean | — | ios | Returns `true` if the device is playing audio. |
|
|
29
|
-
| audioSessionCategory | String | — | ios | A constant for the audio session category to be used. |
|
|
30
|
-
| availableCameras | Array<Number> | — | both | Array indicating which cameras are available, `CAMERA_FRONT`, `CAMERA_REAR` or … |
|
|
31
|
-
| aspectRatio | Number | Titanium.Media.ASPECT_RATIO_4_3 | android | Aspect ratio of the image. |
|
|
32
|
-
| scalingMode | Number | Titanium.Media.IMAGE_SCALING_ASPECT_FILL | android | Scaling mode of the preview image. |
|
|
33
|
-
| verticalAlign | Number | Titanium.Media.VERTICAL_ALIGN_CENTER | android | Vertical align of the preview image for aspect fit. |
|
|
34
|
-
| useCameraX | Boolean | false | android | To use the new CameraX classes for "camera with overlay" set `useCameraX` to `t… |
|
|
35
|
-
| availableCameraMediaTypes | Array<String> | — | ios | Array of media type constants supported for the camera. |
|
|
36
|
-
| availablePhotoGalleryMediaTypes | Array<String> | — | ios | Array of media type constants supported for saving to the device's camera roll … |
|
|
37
|
-
| availablePhotoMediaTypes | Array<String> | — | ios | Array of media type constants supported for the photo library. |
|
|
38
|
-
| averageMicrophonePower | Number | — | ios | Current average microphone level in dB or -1 if microphone monitoring is disabl… |
|
|
39
|
-
| cameraFlashMode | Number | <Titanium.Media.CAMERA_FLASH_AUTO> on iOS, <Titanium.Media.CAMERA_FLASH_OFF> on Android | both | Determines how the flash is fired when using the device's camera. |
|
|
40
|
-
| canRecord | Boolean | — | both | `true` if the device has a recording input device available. |
|
|
41
|
-
| currentRoute | RouteDescription | — | ios | Returns a description of the current route, consisting of zero or more input po… |
|
|
42
|
-
| isCameraSupported | Boolean | — | both | `true` if the device has camera support. |
|
|
43
|
-
| cameraAuthorization | Number | — | ios | Returns the authorization status for the camera. |
|
|
44
|
-
| cameraOutputSizes | Object | — | android | Returns an object of possible `targetImageWidth` and `targetImageHeight` values… |
|
|
45
|
-
| maxZoomLevel | Number | — | android | Returns the max zoom level of the camera. |
|
|
46
|
-
| minZoomLevel | Number | — | android | Returns the min zoom level of the camera. |
|
|
47
|
-
| peakMicrophonePower | Number | — | ios | Current microphone level peak power in dB or -1 if microphone monitoring is dis… |
|
|
48
|
-
| systemMusicPlayer | Ti.Media.MusicPlayer | — | ios | An instance of <Titanium.Media.MusicPlayer> representing the system-wide music … |
|
|
49
|
-
| volume | Number | — | ios | Current volume of the playback device. |
|
|
50
|
-
| torch | Boolean | — | android | Enable or disable the camera torch. |
|
|
51
|
-
| zoomLevel | Number | — | android | Sets the zoom level of the camera. |
|
|
52
|
-
|
|
53
|
-
### Constants (147)
|
|
54
|
-
- **ASPECT_RATIO_16_\***: ASPECT_RATIO_16_9
|
|
55
|
-
- **ASPECT_RATIO_4_\***: ASPECT_RATIO_4_3
|
|
56
|
-
- **AUDIO_FILEFORMAT_\***: AUDIO_FILEFORMAT_3GP2, AUDIO_FILEFORMAT_3GPP, AUDIO_FILEFORMAT_AIFF, AUDIO_FILEFORMAT_AMR, AUDIO_FILEFORMAT_CAF, AUDIO_FILEFORMAT_MP3, AUDIO_FILEFORMAT_MP4, AUDIO_FILEFORMAT_MP4A, AUDIO_FILEFORMAT_WAVE
|
|
57
|
-
- **AUDIO_FORMAT_\***: AUDIO_FORMAT_AAC, AUDIO_FORMAT_ALAW, AUDIO_FORMAT_ILBC, AUDIO_FORMAT_IMA4, AUDIO_FORMAT_ULAW
|
|
58
|
-
- **AUDIO_FORMAT_APPLE_\***: AUDIO_FORMAT_APPLE_LOSSLESS
|
|
59
|
-
- **AUDIO_FORMAT_LINEAR_\***: AUDIO_FORMAT_LINEAR_PCM
|
|
60
|
-
- **AUDIO_SESSION_CATEGORY_\***: AUDIO_SESSION_CATEGORY_AMBIENT, AUDIO_SESSION_CATEGORY_PLAYBACK, AUDIO_SESSION_CATEGORY_RECORD
|
|
61
|
-
- **AUDIO_SESSION_CATEGORY_PLAY_AND_\***: AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD
|
|
62
|
-
- **AUDIO_SESSION_CATEGORY_SOLO_\***: AUDIO_SESSION_CATEGORY_SOLO_AMBIENT
|
|
63
|
-
- **AUDIO_SESSION_OVERRIDE_ROUTE_\***: AUDIO_SESSION_OVERRIDE_ROUTE_NONE, AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER
|
|
64
|
-
- **AUDIO_SESSION_PORT_\***: AUDIO_SESSION_PORT_LINEIN, AUDIO_SESSION_PORT_BUILTINMIC, AUDIO_SESSION_PORT_HEADSETMIC, AUDIO_SESSION_PORT_LINEOUT, AUDIO_SESSION_PORT_HEADPHONES, AUDIO_SESSION_PORT_BLUETOOTHA2DP, AUDIO_SESSION_PORT_BUILTINRECEIVER, AUDIO_SESSION_PORT_BUILTINSPEAKER, AUDIO_SESSION_PORT_HDMI, AUDIO_SESSION_PORT_AIRPLAY, AUDIO_SESSION_PORT_BLUETOOTHHFP, AUDIO_SESSION_PORT_USBAUDIO, AUDIO_SESSION_PORT_BLUETOOTHLE, AUDIO_SESSION_PORT_CARAUDIO
|
|
65
|
-
- **AUDIO_STATE_\***: AUDIO_STATE_BUFFERING, AUDIO_STATE_INITIALIZED, AUDIO_STATE_PAUSED, AUDIO_STATE_PLAYING, AUDIO_STATE_STARTING, AUDIO_STATE_STOPPED, AUDIO_STATE_STOPPING
|
|
66
|
-
- **AUDIO_STATE_WAITING_FOR_\***: AUDIO_STATE_WAITING_FOR_DATA
|
|
67
|
-
- **CAMERA_\***: CAMERA_FRONT, CAMERA_REAR
|
|
68
|
-
- **CAMERA_AUTHORIZATION_\***: CAMERA_AUTHORIZATION_AUTHORIZED, CAMERA_AUTHORIZATION_DENIED, CAMERA_AUTHORIZATION_RESTRICTED, CAMERA_AUTHORIZATION_UNKNOWN
|
|
69
|
-
- **CAMERA_FLASH_\***: CAMERA_FLASH_AUTO, CAMERA_FLASH_OFF, CAMERA_FLASH_ON
|
|
70
|
-
- **DEVICE_\***: DEVICE_BUSY
|
|
71
|
-
- **IMAGE_SCALING_\***: IMAGE_SCALING_AUTO, IMAGE_SCALING_NONE, IMAGE_SCALING_FILL
|
|
72
|
-
- **IMAGE_SCALING_ASPECT_\***: IMAGE_SCALING_ASPECT_FILL, IMAGE_SCALING_ASPECT_FIT
|
|
73
|
-
- **MEDIA_TYPE_\***: MEDIA_TYPE_PHOTO, MEDIA_TYPE_LIVEPHOTO, MEDIA_TYPE_VIDEO
|
|
74
|
-
- **MUSIC_MEDIA_GROUP_\***: MUSIC_MEDIA_GROUP_TITLE, MUSIC_MEDIA_GROUP_ALBUM, MUSIC_MEDIA_GROUP_ARTIST, MUSIC_MEDIA_GROUP_COMPOSER, MUSIC_MEDIA_GROUP_GENRE, MUSIC_MEDIA_GROUP_PLAYLIST
|
|
75
|
-
- **MUSIC_MEDIA_GROUP_ALBUM_\***: MUSIC_MEDIA_GROUP_ALBUM_ARTIST
|
|
76
|
-
- **MUSIC_MEDIA_GROUP_PODCAST_\***: MUSIC_MEDIA_GROUP_PODCAST_TITLE
|
|
77
|
-
- **MUSIC_MEDIA_TYPE_\***: MUSIC_MEDIA_TYPE_ALL, MUSIC_MEDIA_TYPE_AUDIOBOOK, MUSIC_MEDIA_TYPE_MUSIC, MUSIC_MEDIA_TYPE_PODCAST
|
|
78
|
-
- **MUSIC_MEDIA_TYPE_ANY_\***: MUSIC_MEDIA_TYPE_ANY_AUDIO
|
|
79
|
-
- **MUSIC_PLAYER_REPEAT_\***: MUSIC_PLAYER_REPEAT_ALL, MUSIC_PLAYER_REPEAT_DEFAULT, MUSIC_PLAYER_REPEAT_NONE, MUSIC_PLAYER_REPEAT_ONE
|
|
80
|
-
- **MUSIC_PLAYER_SHUFFLE_\***: MUSIC_PLAYER_SHUFFLE_ALBUMS, MUSIC_PLAYER_SHUFFLE_DEFAULT, MUSIC_PLAYER_SHUFFLE_NONE, MUSIC_PLAYER_SHUFFLE_SONGS
|
|
81
|
-
- **MUSIC_PLAYER_STATE_\***: MUSIC_PLAYER_STATE_INTERRUPTED, MUSIC_PLAYER_STATE_PAUSED, MUSIC_PLAYER_STATE_PLAYING, MUSIC_PLAYER_STATE_STOPPED
|
|
82
|
-
- **MUSIC_PLAYER_STATE_SEEK_\***: MUSIC_PLAYER_STATE_SEEK_BACKWARD, MUSIC_PLAYER_STATE_SEEK_FORWARD
|
|
83
|
-
- **NO_\***: NO_CAMERA, NO_VIDEO, NO_FOCUS
|
|
84
|
-
- **QUALITY_\***: QUALITY_SD, QUALITY_HD, QUALITY_FHD, QUALITY_UHD, QUALITY_HIGH, QUALITY_LOW, QUALITY_MEDIUM
|
|
85
|
-
- **UNKNOWN_\***: UNKNOWN_ERROR
|
|
86
|
-
- **VERTICAL_ALIGN_\***: VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_TOP, VERTICAL_ALIGN_BOTTOM
|
|
87
|
-
- **VIDEO_CONTROL_\***: VIDEO_CONTROL_DEFAULT, VIDEO_CONTROL_EMBEDDED, VIDEO_CONTROL_FULLSCREEN, VIDEO_CONTROL_HIDDEN, VIDEO_CONTROL_NONE
|
|
88
|
-
- **VIDEO_FINISH_REASON_PLAYBACK_\***: VIDEO_FINISH_REASON_PLAYBACK_ENDED, VIDEO_FINISH_REASON_PLAYBACK_ERROR
|
|
89
|
-
- **VIDEO_FINISH_REASON_USER_\***: VIDEO_FINISH_REASON_USER_EXITED
|
|
90
|
-
- **VIDEO_LOAD_STATE_\***: VIDEO_LOAD_STATE_FAILED, VIDEO_LOAD_STATE_PLAYABLE, VIDEO_LOAD_STATE_UNKNOWN
|
|
91
|
-
- **VIDEO_MEDIA_TYPE_\***: VIDEO_MEDIA_TYPE_AUDIO, VIDEO_MEDIA_TYPE_METADATA, VIDEO_MEDIA_TYPE_MUXED, VIDEO_MEDIA_TYPE_SUBTITLE, VIDEO_MEDIA_TYPE_TEXT, VIDEO_MEDIA_TYPE_TIMECODE, VIDEO_MEDIA_TYPE_VIDEO
|
|
92
|
-
- **VIDEO_MEDIA_TYPE_CLOSED_\***: VIDEO_MEDIA_TYPE_CLOSED_CAPTION
|
|
93
|
-
- **VIDEO_MEDIA_TYPE_DEPTH_\***: VIDEO_MEDIA_TYPE_DEPTH_DATA
|
|
94
|
-
- **VIDEO_MEDIA_TYPE_METADATA_\***: VIDEO_MEDIA_TYPE_METADATA_OBJECT
|
|
95
|
-
- **VIDEO_PLAYBACK_STATE_\***: VIDEO_PLAYBACK_STATE_INTERRUPTED, VIDEO_PLAYBACK_STATE_PAUSED, VIDEO_PLAYBACK_STATE_PLAYING, VIDEO_PLAYBACK_STATE_STOPPED
|
|
96
|
-
- **VIDEO_PLAYBACK_STATE_SEEKING_\***: VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD, VIDEO_PLAYBACK_STATE_SEEKING_FORWARD
|
|
97
|
-
- **VIDEO_REPEAT_MODE_\***: VIDEO_REPEAT_MODE_NONE, VIDEO_REPEAT_MODE_ONE
|
|
98
|
-
- **VIDEO_SCALING_\***: VIDEO_SCALING_NONE, VIDEO_SCALING_RESIZE
|
|
99
|
-
- **VIDEO_SCALING_ASPECT_\***: VIDEO_SCALING_ASPECT_FILL, VIDEO_SCALING_ASPECT_FIT
|
|
100
|
-
- **VIDEO_SCALING_MODE_\***: VIDEO_SCALING_MODE_FILL
|
|
101
|
-
- **VIDEO_SCALING_RESIZE_\***: VIDEO_SCALING_RESIZE_ASPECT
|
|
102
|
-
- **VIDEO_SCALING_RESIZE_ASPECT_\***: VIDEO_SCALING_RESIZE_ASPECT_FILL
|
|
103
|
-
- **VIDEO_TIME_OPTION_\***: VIDEO_TIME_OPTION_EXACT
|
|
104
|
-
- **VIDEO_TIME_OPTION_CLOSEST_\***: VIDEO_TIME_OPTION_CLOSEST_SYNC
|
|
105
|
-
- **VIDEO_TIME_OPTION_NEAREST_\***: VIDEO_TIME_OPTION_NEAREST_KEYFRAME
|
|
106
|
-
- **VIDEO_TIME_OPTION_NEXT_\***: VIDEO_TIME_OPTION_NEXT_SYNC
|
|
107
|
-
- **VIDEO_TIME_OPTION_PREVIOUS_\***: VIDEO_TIME_OPTION_PREVIOUS_SYNC
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
### Methods (35)
|
|
111
|
-
| Method | Returns | Platform | Description |
|
|
112
|
-
|--------|---------|----------|-------------|
|
|
113
|
-
| beep(—) | void | ios | Plays a device beep notification. |
|
|
114
|
-
| hideCamera(—) | void | both | Hides the device camera UI. |
|
|
115
|
-
| hideMusicLibrary(—) | void | ios | Hides the music library. |
|
|
116
|
-
| isMediaTypeSupported(source, type) | Boolean | ios | Returns `true` if the source supports the specified media type. |
|
|
117
|
-
| openMusicLibrary(options) | void | ios | Shows the music library and allows the user to select one or more tracks. |
|
|
118
|
-
| openPhotoGallery(options) | void | both | Opens the photo gallery image picker. |
|
|
119
|
-
| previewImage(options) | void | android | Displays the given image. |
|
|
120
|
-
| saveToPhotoGallery(media, callbacks) | void | both | Saves media to the device's photo gallery / camera roll. |
|
|
121
|
-
| setOverrideAudioRoute(route) | void | ios | Overrides the default audio route when using the <Titanium.Media.AUDIO_SESSION_… |
|
|
122
|
-
| showCamera(options) | void | both | Shows the camera. |
|
|
123
|
-
| hasMusicLibraryPermissions(—) | Boolean | ios | Returns `true` if the app has music library access. |
|
|
124
|
-
| requestMusicLibraryPermissions(callback) | void | ios | Request permissions for the native music-library. |
|
|
125
|
-
| queryMusicLibrary(query) | Array<Titanium.Media.Item> | ios | Searches the music library for items matching the specified search predicates. |
|
|
126
|
-
| startMicrophoneMonitor(—) | void | ios | Starts monitoring the microphone sound level. |
|
|
127
|
-
| stopMicrophoneMonitor(—) | void | ios | Stops monitoring the microphone sound level. |
|
|
128
|
-
| takePicture(—) | void | both | Uses the device camera to capture a photo. |
|
|
129
|
-
| startVideoCapture(—) | void | both | Starts video capture using the camera specified. |
|
|
130
|
-
| stopVideoCapture(—) | void | both | Stops video capture using the camera specified. |
|
|
131
|
-
| pauseVideoCapture(—) | void | android | Pauses video capturing. |
|
|
132
|
-
| resumeVideoCapture(—) | void | android | Resumes video capturing. |
|
|
133
|
-
| switchCamera(camera) | void | both | Switches between front and rear-facing cameras. Make sure to set one of the bel… |
|
|
134
|
-
| hasCameraPermissions(—) | Boolean | both | Returns `true` if the app has camera access. |
|
|
135
|
-
| requestCameraPermissions(callback) | Promise<RequestCameraAccessResult> | both | Requests for camera access. |
|
|
136
|
-
| hasPhotoGalleryPermissions(—) | Boolean | both | Returns `true` if the app has photo gallery permissions. |
|
|
137
|
-
| requestPhotoGalleryPermissions(callback) | Promise<RequestPhotoGalleryAccessResult> | both | Requests for photo gallery permissions. |
|
|
138
|
-
| takeScreenshot(callback) | void | both | Takes a screen shot of the visible UI on the device. |
|
|
139
|
-
| vibrate(pattern) | void | both | Makes the device vibrate. |
|
|
140
|
-
| hasAudioPermissions(—) | Boolean | ios | Returns `true` if the app has audio permissions. |
|
|
141
|
-
| hasAudioRecorderPermissions(—) | Boolean | both | Returns `true` if the app has audio permissions. |
|
|
142
|
-
| requestAudioRecorderPermissions(callback) | Promise<MediaAuthorizationResponse> | both | Request the user's permission for audio recording. |
|
|
143
|
-
| createAudioPlayer(parameters) | Ti.Media.AudioPlayer | both | Creates and returns an instance of <Titanium.Media.AudioPlayer>. |
|
|
144
|
-
| createAudioRecorder(parameters) | Ti.Media.AudioRecorder | both | Creates and returns an instance of <Titanium.Media.AudioRecorder>. |
|
|
145
|
-
| createSound(parameters) | Ti.Media.Sound | both | Creates and returns an instance of <Titanium.Media.Sound>. |
|
|
146
|
-
| createSystemAlert(parameters) | Ti.Media.SystemAlert | ios | Creates and returns an instance of <Titanium.Media.SystemAlert>. |
|
|
147
|
-
| createVideoPlayer(parameters) | Ti.Media.VideoPlayer | both | Creates and returns an instance of <Titanium.Media.VideoPlayer>. |
|
|
148
|
-
|
|
149
|
-
### Events (3)
|
|
150
|
-
| Event | Platform | Description |
|
|
151
|
-
|-------|----------|-------------|
|
|
152
|
-
| cameraready | android | Fires when the camera overlay is ready to take pictures. |
|
|
153
|
-
| routechange | ios | Fired when an audio line type change is detected. |
|
|
154
|
-
| volume | ios | Fired when the volume output changes. |
|
|
155
|
-
|
|
156
|
-
### Related Types
|
|
157
|
-
|
|
158
|
-
#### CameraOptionsType
|
|
159
|
-
> Simple object for specifying options to [showCamera](Titanium.Media.showCamera).
|
|
160
|
-
|
|
161
|
-
| Property | Type | Description |
|
|
162
|
-
|----------|------|-------------|
|
|
163
|
-
| success | Callback<CameraMediaItemType> | Function to call when the camera is closed after a successful capture/selection. |
|
|
164
|
-
| open | Callback<CameraOpen> | Function to call when the camera is shown |
|
|
165
|
-
| error | Callback<FailureResponse> | Function to call upon receiving an error. |
|
|
166
|
-
| cancel | Callback<FailureResponse> | Function to call if the user presses the cancel button. |
|
|
167
|
-
| recording | Callback<CameraRecordingCallback> | Function to call during recording. Returns size and duration. |
|
|
168
|
-
| androidback | Callback<FailureResponse> | Function to call if the user presses the back button. |
|
|
169
|
-
| autohide | Boolean | Specifies if the camera should be hidden automatically after the media capture … |
|
|
170
|
-
| animated | Boolean | Specifies if the dialog should be animated upon showing and hiding. |
|
|
171
|
-
| saveToPhotoGallery | Boolean | Specifies if the media should be saved to the photo gallery upon successful cap… |
|
|
172
|
-
| allowEditing | Boolean | Specifies if the media should be editable after capture/selection. |
|
|
173
|
-
| zoomEnabled | Boolean | Specifies if pinch to zoom is enabled or not. |
|
|
174
|
-
| targetImageWidth | Number | Maximum width of the saved image. Depending on your phone and your value this m… |
|
|
175
|
-
| targetImageHeight | Number | Maximum height of the saved image. Depending on your phone and your value this … |
|
|
176
|
-
| mediaTypes | Array<String> | Array of media type constants to allow. Note: If you want to select live photos… |
|
|
177
|
-
| videoMaximumDuration | Number | Maximum duration (in milliseconds) to allow video capture before completing. |
|
|
178
|
-
| videoQuality | Number | Constant to indicate the video quality during capture. |
|
|
179
|
-
| whichCamera | Number | Opens the camera with the specified camera direction. |
|
|
180
|
-
| showControls | Boolean | Indicates if the built-in camera controls should be displayed. |
|
|
181
|
-
| overlay | Ti.UI.View | View to added as an overlay to the camera UI (on top). |
|
|
182
|
-
| transform | Ti.UI.Matrix2D | Transformation matrix to apply to the camera or photogallery view. |
|
|
183
|
-
| inPopOver | Boolean | Show the camera in a popover. |
|
|
184
|
-
| popoverView | Ti.UI.View | View to position the camera or photo gallery popover on top of. |
|
|
185
|
-
| arrowDirection | Number | Controls the type of arrow and position of the popover. |
|
|
186
|
-
| autorotate | Boolean | Determines if the camera preview should rotate or not. |
|
|
187
|
-
|
|
188
|
-
#### MediaQueryType
|
|
189
|
-
> A specifier for a media library query. By default, filters perform an exact match.
|
|
190
|
-
|
|
191
|
-
| Property | Type | Description |
|
|
192
|
-
|----------|------|-------------|
|
|
193
|
-
| grouping | Number | A constant that specifies the ordering of the result array. |
|
|
194
|
-
| mediaType | MediaQueryInfoType \| Number | The media type to filter on. |
|
|
195
|
-
| title | MediaQueryInfoType \| String | The title to filter on. Value should be a String. |
|
|
196
|
-
| albumTitle | MediaQueryInfoType \| String | The album title to filter on. Value should be a String. |
|
|
197
|
-
| artist | MediaQueryInfoType \| String | The artist to filter on. Value should be a String. |
|
|
198
|
-
| albumArtist | MediaQueryInfoType \| String | The album artist to filter on. Value should be a String. |
|
|
199
|
-
| genre | MediaQueryInfoType \| String | The genre to filter on. Value should be a String. |
|
|
200
|
-
| composer | MediaQueryInfoType \| String | The composer to filter on. Value should be a String. |
|
|
201
|
-
| isCompilation | MediaQueryInfoType \| Boolean | Filter by whether or not the item is a compilation. The value should be a Boole… |
|
|
202
|
-
| playCount | MediaQueryInfoType \| Number | The play count to filter on. Value should be a Number. |
|
|
203
|
-
| persistentID | MediaQueryInfoType \| Number | The persistent ID to filter on. Value should be a Number. |
|
|
204
|
-
| albumPersistentID | MediaQueryInfoType \| Number | The album persistent ID to filter on. Value should be a Number. |
|
|
205
|
-
| albumArtistPersistentID | MediaQueryInfoType \| Number | The album artist persistent ID to filter on. Value should be a Number. |
|
|
206
|
-
| genrePersistentID | MediaQueryInfoType \| Number | The genre persistent ID to filter on. Value should be a Number. |
|
|
207
|
-
| composerPersistentID | MediaQueryInfoType \| Number | The composer persistent ID to filter on. Value should be a Number. |
|
|
208
|
-
| isCloudItem | MediaQueryInfoType \| Boolean | Filter by whether or not the item is a cloud item. Value should be a Boolean. |
|
|
209
|
-
| hasProtectedAsset | MediaQueryInfoType \| Boolean | Filter by whether or not the item is a protected asset. Value should be a Boole… |
|
|
210
|
-
| podcastTitle | MediaQueryInfoType \| String | The podcast title to filter on. Value should be a String. |
|
|
211
|
-
| podcastPersistentID | MediaQueryInfoType \| Number | The podcast persistent ID to filter on. Value should be a Number. |
|
|
212
|
-
|
|
213
|
-
#### MusicLibraryOptionsType
|
|
214
|
-
> Simple object for specifying options to [openMusicLibrary](Titanium.Media.openMusicLibrary).
|
|
215
|
-
|
|
216
|
-
| Property | Type | Description |
|
|
217
|
-
|----------|------|-------------|
|
|
218
|
-
| success | Callback<MusicLibraryResponseType> | Function to call when the music library selection is made. |
|
|
219
|
-
| error | Callback<FailureResponse> | Function to call upon receiving an error. |
|
|
220
|
-
| cancel | Callback<FailureResponse> | Function to call if the user presses the cancel button. |
|
|
221
|
-
| autohide | Boolean | Specifies that the library should be hidden automatically after media selection… |
|
|
222
|
-
| animated | Boolean | Boolean if the dialog should be animated when showing and hiding. |
|
|
223
|
-
| mediaTypes | Number \| Array<Number> | An array of media type constants defining selectable media. |
|
|
224
|
-
| allowMultipleSelections | Boolean | Set to `true` to allow the user to select multiple items from the library. |
|
|
225
|
-
|
|
226
|
-
*Plus 2 more types: *
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Ti.Media.Android
|
|
231
|
-
> Android-specific media-related functionality.
|
|
232
|
-
> Extends Ti.Module
|
|
233
|
-
> Platforms: android
|
|
234
|
-
> Type: module
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
### Methods (2)
|
|
238
|
-
| Method | Returns | Platform | Description |
|
|
239
|
-
|--------|---------|----------|-------------|
|
|
240
|
-
| scanMediaFiles(paths, mimeTypes, callback) | void | android | Scans newly created or downloaded media files to make them available to other A… |
|
|
241
|
-
| setSystemWallpaper(image, scale) | void | android | Set the system homescreen wallpaper. |
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
## Ti.Media.AudioPlayer
|
|
247
|
-
> An audio player object used for streaming audio to the device, and low-level control of the audio playback.
|
|
248
|
-
> Extends Ti.Proxy
|
|
249
|
-
> Platforms: both
|
|
250
|
-
|
|
251
|
-
On Android, when you are done playing a given audio file, you must call the
|
|
252
|
-
[release](Titanium.Media.AudioPlayer.release) method to stop buffering audio data and
|
|
253
|
-
release associated system resources. Since 7.5.0, this method is available on iOS as well
|
|
254
|
-
and will release all audio-player related resources. After this method has been called,
|
|
255
|
-
the object should not be accessed anymore.
|
|
256
|
-
|
|
257
|
-
On iOS, you can control how the audio stream interacts with other system sounds
|
|
258
|
-
by setting <Titanium.Media.audioSessionCategory>. Since Titanium 7.5.0, this API
|
|
259
|
-
uses the [AVPlayer API](https://developer.apple.com/documentation/avfoundation/avplayer) for a more modern
|
|
260
|
-
and performant audio playback.
|
|
261
|
-
|
|
262
|
-
Use the <Titanium.Media.createAudioPlayer> method to create an audio player.
|
|
263
|
-
|
|
264
|
-
### Properties (unique: 20/38)
|
|
265
|
-
| Property | Type | Default | Platform | Description |
|
|
266
|
-
|----------|------|---------|----------|-------------|
|
|
267
|
-
| allowBackground | Boolean | false | android | Boolean to indicate if audio should continue playing even if the associated And… |
|
|
268
|
-
| audioFocus | Boolean | false | android | Focuses on the current audio player and stops other audio playing. |
|
|
269
|
-
| audioSessionId | Number | — | android | Returns the audio session id. |
|
|
270
|
-
| audioType | Number | <Titanium.Media.AudioPlayer.AUDIO_TYPE_MEDIA> | android | Changes the audio-stream-type. |
|
|
271
|
-
| bitRate | Number | — | ios | Bit rate of the current playback stream. |
|
|
272
|
-
| duration | Number | — | both | Estimated duration in milliseconds of the file being played. |
|
|
273
|
-
| idle | Boolean | — | ios | Boolean indicating if the player is idle. |
|
|
274
|
-
| muted | Boolean | — | both | Indicates whether or not audio output of the player is muted. |
|
|
275
|
-
| externalPlaybackActive | Boolean | — | ios | Indicates whether the player is currently playing video in "external playback" … |
|
|
276
|
-
| allowsExternalPlayback | Boolean | true | ios | Indicates whether the player allows switching to "external playback" mode. |
|
|
277
|
-
| rate | Number | 0 | ios | Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a des… |
|
|
278
|
-
| paused | Boolean | — | both | Boolean indicating if audio playback is paused. |
|
|
279
|
-
| playing | Boolean | — | both | Boolean indicating if audio is currently playing. |
|
|
280
|
-
| progress | Number | — | ios | Current playback progress, in milliseconds. |
|
|
281
|
-
| state | Number | — | ios | Current state of playback, specified using one of the `STATE` constants defined… |
|
|
282
|
-
| url | String | — | both | URL for the audio stream. |
|
|
283
|
-
| volume | Number | — | both | Volume of the audio, from 0.0 (muted) to 1.0 (loudest). |
|
|
284
|
-
| waiting | Boolean | — | ios | Boolean indicating if the playback is waiting for audio data from the network. |
|
|
285
|
-
| bufferSize | Number | — | ios | Size of the buffer used for streaming, in milliseconds. |
|
|
286
|
-
| time | Number | — | android | Current playback position of the audio. |
|
|
287
|
-
|
|
288
|
-
### Constants (15)
|
|
289
|
-
- **AUDIO_TYPE_\***: AUDIO_TYPE_ALARM, AUDIO_TYPE_SIGNALLING, AUDIO_TYPE_MEDIA, AUDIO_TYPE_NOTIFICATION, AUDIO_TYPE_RING, AUDIO_TYPE_VOICE
|
|
290
|
-
- **STATE_\***: STATE_BUFFERING, STATE_INITIALIZED, STATE_PAUSED, STATE_PLAYING, STATE_STARTING, STATE_STOPPED, STATE_STOPPING
|
|
291
|
-
- **STATE_WAITING_FOR_\***: STATE_WAITING_FOR_DATA, STATE_WAITING_FOR_QUEUE
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
### Methods (14)
|
|
295
|
-
| Method | Returns | Platform | Description |
|
|
296
|
-
|--------|---------|----------|-------------|
|
|
297
|
-
| getPaused(—) | Boolean | ios | Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property. |
|
|
298
|
-
| isPaused(—) | Boolean | android | Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property. |
|
|
299
|
-
| getPlaying(—) | Boolean | ios | Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property. |
|
|
300
|
-
| isPlaying(—) | Boolean | android | Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property. |
|
|
301
|
-
| pause(—) | void | both | Pauses audio playback. |
|
|
302
|
-
| play(—) | void | android | Starts or resumes audio playback. |
|
|
303
|
-
| setPaused(paused) | void | ios | Sets the value of the [paused](Titanium.Media.AudioPlayer.paused) property. |
|
|
304
|
-
| seekToTime(time) | void | ios | Moves the playback cursor and invokes the specified block when the seek operati… |
|
|
305
|
-
| release(—) | void | both | Stops buffering audio data and releases audio resources. |
|
|
306
|
-
| getAudioSessionId(—) | Number | android | Returns the audio session id. |
|
|
307
|
-
| start(—) | void | both | Starts or resumes audio playback. |
|
|
308
|
-
| restart(—) | void | both | Restarts (stops and stars) audio playback. |
|
|
309
|
-
| stateDescription(state) | String | ios | Converts a [state](Titanium.Media.AudioPlayer.state) value into a text descript… |
|
|
310
|
-
| stop(—) | void | both | Stops audio playback. |
|
|
311
|
-
|
|
312
|
-
### Events (6)
|
|
313
|
-
| Event | Platform | Description |
|
|
314
|
-
|-------|----------|-------------|
|
|
315
|
-
| change | both | Fired when the state of the playback changes. |
|
|
316
|
-
| complete | both | Fired when the audio has finished playing. |
|
|
317
|
-
| metadata | ios | Fired when the timed metadata was encountered most recently within the media as… |
|
|
318
|
-
| error | both | Fired when there's an error. |
|
|
319
|
-
| progress | both | Fired once per second with the current progress during playback. |
|
|
320
|
-
| seek | ios | Fired once the [seekToTime](Titanium.Media.AudioPlayer.seek) method completes. |
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
## Ti.Media.AudioRecorder
|
|
325
|
-
> An audio recorder object used for recording audio from the device microphone.
|
|
326
|
-
> Extends Ti.Proxy
|
|
327
|
-
> Platforms: both
|
|
328
|
-
|
|
329
|
-
Use the <Titanium.Media.createAudioRecorder> method to create an audio recorder.
|
|
330
|
-
|
|
331
|
-
Ensure to request the permissions for audio-recording before starting a new record-session.
|
|
332
|
-
This can be done by using <Titanium.Media.hasAudioRecorderPermissions> to check whether
|
|
333
|
-
audio-permissions are granted and <Titanium.Media.requestAudioRecorderPermissions> to
|
|
334
|
-
request audio-permissions.
|
|
335
|
-
|
|
336
|
-
**Android Platform Note**: On Android, you also need to include the following permission
|
|
337
|
-
into the `<android>` section of the tiapp.xml:
|
|
338
|
-
|
|
339
|
-
``` xml
|
|
340
|
-
|
|
341
|
-
### Properties (unique: 5/8)
|
|
342
|
-
| Property | Type | Default | Platform | Description |
|
|
343
|
-
|----------|------|---------|----------|-------------|
|
|
344
|
-
| compression | Number | <Titanium.Media.AUDIO_FORMAT_LINEAR_PCM> | ios | Audio compression to be used for the recording. |
|
|
345
|
-
| format | Number | <Titanium.Media.AUDIO_FILEFORMAT_CAF> | ios | Audio format to be used for the recording. |
|
|
346
|
-
| paused | Boolean | — | both | Indicates if the audio recorder is paused. |
|
|
347
|
-
| recording | Boolean | — | both | Indicates if the audio recorder is recording. |
|
|
348
|
-
| stopped | Boolean | — | both | Indicates if the audio recorder is stopped. |
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
### Methods (4)
|
|
352
|
-
| Method | Returns | Platform | Description |
|
|
353
|
-
|--------|---------|----------|-------------|
|
|
354
|
-
| pause(—) | void | both | Pauses the current audio recording. |
|
|
355
|
-
| resume(—) | void | both | Resumes a paused recording. |
|
|
356
|
-
| start(—) | void | both | Starts an audio recording. |
|
|
357
|
-
| stop(—) | Ti.Filesystem.File | both | Stops the current audio recording and returns the recorded audio file. |
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## Ti.Media.Item
|
|
363
|
-
> A representation of a media item returned by [openMusicLibrary](Titanium.Media.openMusicLibrary) or [queryMusicLibrary](Titanium.Media.queryMusicLibrary).
|
|
364
|
-
> Extends Ti.Proxy
|
|
365
|
-
> Platforms: ios
|
|
366
|
-
|
|
367
|
-
This is a read-only object that describes a single media item, not a playlist.
|
|
368
|
-
Titanium does not support access to playlists.
|
|
369
|
-
|
|
370
|
-
`Item` objects cannot be created explicitly. The
|
|
371
|
-
[openMusicLibrary](Titanium.Media.openMusicLibrary) returns `Item` objects in its
|
|
372
|
-
`success` callback function, while [queryMusicLibrary](Titanium.Media.queryMusicLibrary)
|
|
373
|
-
returns an array of `Item` objects.
|
|
374
|
-
|
|
375
|
-
### Properties (unique: 36/38)
|
|
376
|
-
| Property | Type | Default | Platform | Description |
|
|
377
|
-
|----------|------|---------|----------|-------------|
|
|
378
|
-
| albumArtist | String | — | ios | Artist credited for the album containing this item. |
|
|
379
|
-
| albumArtistPersistentID | Number | — | ios | The persistent identifier for an album artist. |
|
|
380
|
-
| albumPersistentID | Number | — | ios | The key for the persistent identifier for an album. |
|
|
381
|
-
| albumTitle | String | — | ios | Title of the album containing this item. |
|
|
382
|
-
| albumTrackCount | Number | — | ios | Number of tracks for the album containing this item. |
|
|
383
|
-
| albumTrackNumber | Number | — | ios | Track number for this item. |
|
|
384
|
-
| artist | String | — | ios | Artist credited for this item. |
|
|
385
|
-
| artwork | Ti.Blob | — | ios | Image for the item's artwork as a `Blob` object, or `null` if no artwork is ava… |
|
|
386
|
-
| assetURL | String | — | ios | A URL pointing to the media item. |
|
|
387
|
-
| beatsPerMinute | Number | — | ios | The number of musical beats per minute for the media item. |
|
|
388
|
-
| bookmarkTime | String | — | ios | The user's place in the media item the most recent time it was played. |
|
|
389
|
-
| comments | String | — | ios | Textual information about the media item. |
|
|
390
|
-
| composer | String | — | ios | Composer of this item. |
|
|
391
|
-
| dateAdded | Date | — | ios | Date when the item was added to the music library. |
|
|
392
|
-
| discCount | Number | — | ios | Total number of discs for the album containing this item. |
|
|
393
|
-
| discNumber | Number | — | ios | Disc number for this item in the album. |
|
|
394
|
-
| genre | String | — | ios | Genre of this item. |
|
|
395
|
-
| genrePersistentID | Number | — | ios | The persistent identifier for a genre. |
|
|
396
|
-
| hasProtectedAsset | Boolean | — | ios | True if the item represents a protected asset. |
|
|
397
|
-
| isCloudItem | Boolean | — | ios | True if the media item is an iCloud item. |
|
|
398
|
-
| isCompilation | Boolean | — | ios | True if this item is part of a compilation album. |
|
|
399
|
-
| isExplicit | Boolean | — | ios | True if this item is marked as "Explicit". |
|
|
400
|
-
| lastPlayedDate | Date | — | ios | The most recent calendar date on which the user played the media item. |
|
|
401
|
-
| lyrics | String | — | ios | Lyrics for this item. |
|
|
402
|
-
| mediaType | Number | — | ios | The type of the media. |
|
|
403
|
-
| persistentID | String | — | ios | The key for the persistent identifier for the media item. |
|
|
404
|
-
| playCount | Number | — | ios | Number of times the item has been played. |
|
|
405
|
-
| playbackDuration | Number | — | ios | Length (in seconds) of this item. |
|
|
406
|
-
| playbackStoreID | Number | — | ios | Used to enqueue store tracks by their ID. |
|
|
407
|
-
| podcastTitle | String | — | ios | Title of a podcast item. |
|
|
408
|
-
| podcastPersistentID | Number | — | ios | The persistent identifier for an audio podcast. |
|
|
409
|
-
| rating | Number | — | ios | Rating for this item. |
|
|
410
|
-
| releaseDate | Date | — | ios | Date when this this item was released. |
|
|
411
|
-
| skipCount | Number | — | ios | Number of times this item has been skipped. |
|
|
412
|
-
| title | String | — | ios | Title of this item. |
|
|
413
|
-
| userGrouping | String | — | ios | Grouping information for the media item. |
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
---
|
|
419
|
-
|
|
420
|
-
## Ti.Media.MusicPlayer
|
|
421
|
-
> This object represents a music controller.
|
|
422
|
-
> Extends Ti.Proxy
|
|
423
|
-
> Platforms: ios
|
|
424
|
-
|
|
425
|
-
A `MusicPlayer` lets you manage and playback a queue of media [Item](Titanium.Media.Item) objects.
|
|
426
|
-
|
|
427
|
-
To retrieve an instance of a MusicPlayer object, use either the
|
|
428
|
-
|
|
429
|
-
### Properties (unique: 5/7)
|
|
430
|
-
| Property | Type | Default | Platform | Description |
|
|
431
|
-
|----------|------|---------|----------|-------------|
|
|
432
|
-
| currentPlaybackTime | Number | — | ios | Current point in song playback, in seconds. |
|
|
433
|
-
| nowPlaying | Ti.Media.Item | — | ios | An `Item` object representing the currently playing media item. |
|
|
434
|
-
| playbackState | Number | — | ios | Playback state. |
|
|
435
|
-
| repeatMode | Number | — | ios | Repeat setting. |
|
|
436
|
-
| shuffleMode | Number | — | ios | Shuffle setting. |
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
### Methods (10)
|
|
440
|
-
| Method | Returns | Platform | Description |
|
|
441
|
-
|--------|---------|----------|-------------|
|
|
442
|
-
| pause(—) | void | ios | Pauses playback of the current media item. |
|
|
443
|
-
| play(—) | void | ios | Begins playback of the current media item. |
|
|
444
|
-
| seekBackward(—) | void | ios | Begins seeking backward in the currently playing media. |
|
|
445
|
-
| seekForward(—) | void | ios | Begins seeking forward in the currently playing media item. |
|
|
446
|
-
| setQueue(queue) | void | ios | Sets the media queue. |
|
|
447
|
-
| skipToBeginning(—) | void | ios | Skips to the beginning of the currently playing media item. |
|
|
448
|
-
| skipToNext(—) | void | ios | Skips to the next media item in the queue. |
|
|
449
|
-
| skipToPrevious(—) | void | ios | Skips to the previous media item in the queue. |
|
|
450
|
-
| stop(—) | void | ios | Stops playback of the current media queue. |
|
|
451
|
-
| stopSeeking(—) | void | ios | Ends a seek operation and returns to the previous playback state. See also: [se… |
|
|
452
|
-
|
|
453
|
-
### Events (2)
|
|
454
|
-
| Event | Platform | Description |
|
|
455
|
-
|-------|----------|-------------|
|
|
456
|
-
| playingchange | ios | Fired when the currently playing media item changes. |
|
|
457
|
-
| statechange | ios | Fired when the music player's playback state changes. |
|
|
458
|
-
|
|
459
|
-
---
|
|
460
|
-
|
|
461
|
-
## Ti.Media.Sound
|
|
462
|
-
> An object for playing basic audio resources.
|
|
463
|
-
> Extends Ti.Proxy
|
|
464
|
-
> Platforms: both
|
|
465
|
-
|
|
466
|
-
The `Sound` object loads the entire media resource in memory before playing. If you need to
|
|
467
|
-
support streaming, use the [AudioPlayer](Titanium.Media.AudioPlayer) API.
|
|
468
|
-
|
|
469
|
-
You can control how the sound interacts with other system sounds
|
|
470
|
-
by setting <Titanium.Media.audioSessionCategory>.
|
|
471
|
-
|
|
472
|
-
Use the <Titanium.Media.createSound> method to create a `Sound` object. You can play audio
|
|
473
|
-
in any format supported by the target platform(s), as described in the following documents:
|
|
474
|
-
|
|
475
|
-
* [Android](https://developer.android.com/guide/topics/media/media-formats#core)
|
|
476
|
-
* [iOS](https://developer.apple.com/audio/)
|
|
477
|
-
|
|
478
|
-
### Properties (unique: 9/27)
|
|
479
|
-
| Property | Type | Default | Platform | Description |
|
|
480
|
-
|----------|------|---------|----------|-------------|
|
|
481
|
-
| allowBackground | Boolean | false | android | Determines whether the audio should continue playing even when its activity is … |
|
|
482
|
-
| audioType | Number | <Titanium.Media.AudioPlayer.AUDIO_TYPE_MEDIA> | android | Changes the audio-stream-type. |
|
|
483
|
-
| duration | Number | — | both | Duration of the audio resource. |
|
|
484
|
-
| looping | Boolean | false | both | Determines whether the audio should loop upon completion. |
|
|
485
|
-
| paused | Boolean | — | both | Indicates if the audio is paused. |
|
|
486
|
-
| playing | Boolean | — | both | Indicates if the audio is playing. |
|
|
487
|
-
| time | Number | — | both | Current playback position of the audio. |
|
|
488
|
-
| url | String | — | both | URL identifying the audio resource. |
|
|
489
|
-
| volume | Number | — | both | Volume of the audio from 0.0 (muted) to 1.0 (loudest). |
|
|
490
|
-
|
|
491
|
-
### Constants (15)
|
|
492
|
-
- **AUDIO_TYPE_\***: AUDIO_TYPE_ALARM, AUDIO_TYPE_SIGNALLING, AUDIO_TYPE_MEDIA, AUDIO_TYPE_NOTIFICATION, AUDIO_TYPE_RING, AUDIO_TYPE_VOICE
|
|
493
|
-
- **STATE_\***: STATE_BUFFERING, STATE_INITIALIZED, STATE_PAUSED, STATE_PLAYING, STATE_STARTING, STATE_STOPPED, STATE_STOPPING
|
|
494
|
-
- **STATE_WAITING_FOR_\***: STATE_WAITING_FOR_DATA, STATE_WAITING_FOR_QUEUE
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
### Methods (10)
|
|
498
|
-
| Method | Returns | Platform | Description |
|
|
499
|
-
|--------|---------|----------|-------------|
|
|
500
|
-
| isLooping(—) | Boolean | both | Returns the value of the [looping](Titanium.Media.Sound.looping) property. |
|
|
501
|
-
| isPaused(—) | Boolean | both | Returns the value of the [paused](Titanium.Media.Sound.paused) property. |
|
|
502
|
-
| isPlaying(—) | Boolean | both | Returns the value of the [playing](Titanium.Media.Sound.playing) property. |
|
|
503
|
-
| pause(—) | void | both | Pauses the audio. |
|
|
504
|
-
| play(—) | void | both | Starting playing the sound, or resume playing a paused sound. |
|
|
505
|
-
| release(—) | void | both | Releases all internal resources. |
|
|
506
|
-
| reset(—) | void | both | Resets the audio playback position to the beginning. |
|
|
507
|
-
| setLooping(looping) | void | both | Sets the value of the [looping](Titanium.Media.Sound.looping) property. |
|
|
508
|
-
| setPaused(paused) | void | ios | Sets the value of the [paused](Titanium.Media.Sound.paused) property. |
|
|
509
|
-
| stop(—) | void | both | Stops playing the audio and resets the playback position to the beginning of th… |
|
|
510
|
-
|
|
511
|
-
### Events (5)
|
|
512
|
-
| Event | Platform | Description |
|
|
513
|
-
|-------|----------|-------------|
|
|
514
|
-
| change | android | Fired when the state of the playback changes. |
|
|
515
|
-
| complete | both | Fired when the audio has finished playing. |
|
|
516
|
-
| error | both | Fired when an error occurs while playing the audio. |
|
|
517
|
-
| interrupted | ios | Fired when audio playback is interrupted by the device. |
|
|
518
|
-
| resume | ios | Fired when audio playback is resumed after an interruption. |
|
|
519
|
-
|
|
520
|
-
---
|
|
521
|
-
|
|
522
|
-
## Ti.Media.SystemAlert
|
|
523
|
-
> An object for playing system sounds.
|
|
524
|
-
> Extends Ti.Proxy
|
|
525
|
-
> Platforms: ios
|
|
526
|
-
|
|
527
|
-
You can use this module to provide audible system alerts.
|
|
528
|
-
|
|
529
|
-
You can use it to play short (30 seconds or shorter) sounds. The interface does not provide level, positioning,
|
|
530
|
-
looping, or timing control, and does not support simultaneous playback: You can play only one sound at a time.
|
|
531
|
-
|
|
532
|
-
This module differs from the Sound module because it honors the ringtone volume, not the Music volume.
|
|
533
|
-
|
|
534
|
-
Use the <Titanium.Media.createSystemAlert> method to create a `SystemAlert` object.
|
|
535
|
-
|
|
536
|
-
Know more about [System Sound Services](https://developer.apple.com/reference/audiotoolbox/1657326-system_sound_services).
|
|
537
|
-
|
|
538
|
-
### Properties (unique: 1/3)
|
|
539
|
-
| Property | Type | Default | Platform | Description |
|
|
540
|
-
|----------|------|---------|----------|-------------|
|
|
541
|
-
| url | String | — | ios | URL identifying the audio resource. |
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
### Methods (1)
|
|
545
|
-
| Method | Returns | Platform | Description |
|
|
546
|
-
|--------|---------|----------|-------------|
|
|
547
|
-
| play(—) | void | ios | Start playing the system alert. |
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
---
|
|
551
|
-
|
|
552
|
-
## Ti.Media.VideoPlayer
|
|
553
|
-
> A native control for playing videos.
|
|
554
|
-
> Extends Ti.UI.View
|
|
555
|
-
> Platforms: both
|
|
556
|
-
|
|
557
|
-
The video player is a native view that can be used to play videos, either stored
|
|
558
|
-
locally or streamed from a web server. The player can occupy the full screen, or can
|
|
559
|
-
be used as a view that can be added to other views.
|
|
560
|
-
|
|
561
|
-
Use the <Titanium.Media.createVideoPlayer> method to create a video player.
|
|
562
|
-
|
|
563
|
-
All platforms support specifying the video content as a URL, either to a local file or
|
|
564
|
-
a remote stream. This is done by setting the [url](Titanium.Media.VideoPlayer.url) property.
|
|
565
|
-
|
|
566
|
-
### iOS Implementation Notes
|
|
567
|
-
|
|
568
|
-
On iOS, video content can also be specified as a [Blob](Titanium.Blob) or
|
|
569
|
-
[File](Titanium.Filesystem.File) object using the
|
|
570
|
-
[media](Titanium.Media.VideoPlayer.media) property.
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
*(See full overview in titanium-docs)*
|
|
574
|
-
|
|
575
|
-
### Properties (unique: 27/99)
|
|
576
|
-
| Property | Type | Default | Platform | Description |
|
|
577
|
-
|----------|------|---------|----------|-------------|
|
|
578
|
-
| allowsAirPlay | Boolean | — | ios | Whether or not the current movie can be played on a remote device. |
|
|
579
|
-
| autoplay | Boolean | true | both | Indicates if a movie should automatically start playback. |
|
|
580
|
-
| autoHide | Boolean | false | android | Indicates if player is hidden by default and shown when its ready. |
|
|
581
|
-
| backgroundView | Ti.UI.View | — | ios | Sets the background view for customization which is always displayed behind mov… |
|
|
582
|
-
| currentPlaybackTime | Number | — | both | Current playback time of the current movie in milliseconds. |
|
|
583
|
-
| duration | Number | 0 | both | The duration of the current movie in milliseconds, or 0.0 if not known. |
|
|
584
|
-
| endPlaybackTime | Number | 0 | both | The end time of movie playback, in milliseconds. |
|
|
585
|
-
| fairPlayConfiguration | FairPlayConfiguration | — | ios | Handle DRM-encrypted video assets using the [Apple FairPlay Streaming API](http… |
|
|
586
|
-
| fullscreen | Boolean | false | android | Determines if the movie is presented in the entire screen (obscuring all other … |
|
|
587
|
-
| initialPlaybackTime | Number | 0 | both | The start time of movie playback, in milliseconds. |
|
|
588
|
-
| loadState | Number | — | both | Returns the network load state of the movie player. |
|
|
589
|
-
| media | Ti.Blob \| Ti.Filesystem.File \| String | — | ios | Media object to play, as either a `Ti.Filesystem.File`, a `Ti.Blob`, or an URL … |
|
|
590
|
-
| mediaControlStyle | Number | System default video controls (<Titanium.Media.VIDEO_CONTROL_DEFAULT>). | android | The style of the playback controls. |
|
|
591
|
-
| mediaTypes | String | <Titanium.Media.VIDEO_MEDIA_TYPE_VIDEO> | ios | The type of media in the player's current item first track. |
|
|
592
|
-
| moviePlayerStatus | Number | — | ios | Returns the status of the movie player. |
|
|
593
|
-
| naturalSize | MovieSize | — | ios | Returns the natural size of the movie. |
|
|
594
|
-
| speed | Number | — | android | Playback speed of the video. |
|
|
595
|
-
| overlayView | Ti.UI.View | — | ios | Use the overlay view to add additional custom views between the video content a… |
|
|
596
|
-
| pictureInPictureEnabled | Boolean | true | ios | Whether or not the receiver allows Picture in Picture playback. |
|
|
597
|
-
| playableDuration | Number | 0 | both | Currently playable duration of the movie, in milliseconds, for progressively do… |
|
|
598
|
-
| playbackState | Number | — | both | Current playback state of the video player. |
|
|
599
|
-
| playing | Boolean | — | both | Boolean to indicate if the player has started playing. |
|
|
600
|
-
| repeatMode | Number | Titanium.Media.VIDEO_REPEAT_MODE_NONE | both | Determines how the movie player repeats when reaching the end of playback. |
|
|
601
|
-
| scalingMode | Number | <Titanium.Media.VIDEO_SCALING_RESIZE_ASPECT> on Android, <Titanium.Media.VIDEO_SCALING_RESIZE> on iOS | both | Determines how the content scales to fit the view. |
|
|
602
|
-
| showsControls | Boolean | true | both | Whether or not the receiver shows playback controls. Default is true. |
|
|
603
|
-
| url | String | — | both | URL of the media to play. |
|
|
604
|
-
| volume | Number | 1 | both | Volume of the audio portion of the video. |
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
### Methods (6)
|
|
608
|
-
| Method | Returns | Platform | Description |
|
|
609
|
-
|--------|---------|----------|-------------|
|
|
610
|
-
| cancelAllThumbnailImageRequests(—) | void | both | Cancels all pending asynchronous thumbnail requests. |
|
|
611
|
-
| pause(—) | void | both | Pauses playing the video. |
|
|
612
|
-
| play(—) | void | both | Starts playing the video. |
|
|
613
|
-
| release(—) | void | both | Releases the internal video resources immediately. |
|
|
614
|
-
| requestThumbnailImagesAtTimes(times, option, callback) | void | both | Asynchronously request thumbnail images for one or more points in time in the v… |
|
|
615
|
-
| stop(—) | void | both | Stops playing the video. |
|
|
616
|
-
|
|
617
|
-
### Events (15)
|
|
618
|
-
| Event | Platform | Description |
|
|
619
|
-
|-------|----------|-------------|
|
|
620
|
-
| click | android | Fired when the device detects a click against the view. |
|
|
621
|
-
| singletap | android | Fired when the device detects a single tap against the view. |
|
|
622
|
-
| touchcancel | android | Fired when a touch event is interrupted by the device. |
|
|
623
|
-
| touchend | android | Fired when a touch event is completed. |
|
|
624
|
-
| touchmove | android | Fired as soon as the device detects movement of a touch. |
|
|
625
|
-
| complete | both | Fired when movie playback ends or a user exits playback. |
|
|
626
|
-
| durationavailable | both | Fired when the video duration is available. |
|
|
627
|
-
| error | both | Fired when movie playback encounters an error. |
|
|
628
|
-
| load | both | Fired when the movie play loads. |
|
|
629
|
-
| loadstate | both | Fired when the network [loadState](Titanium.Media.VideoPlayer.loadState) change… |
|
|
630
|
-
| naturalsizeavailable | ios | Fired when the natural size of the current movie is determined. |
|
|
631
|
-
| playbackstate | both | Fired when the [playbackState](Titanium.Media.VideoPlayer.playbackState) change… |
|
|
632
|
-
| playing | both | Fired when the currently playing movie changes. |
|
|
633
|
-
| preload | android | Fired when the movie has preloaded and is ready to play. |
|
|
634
|
-
| resize | ios | Fired when the movie player is resized. |
|
|
635
|
-
|
|
636
|
-
### Related Types
|
|
637
|
-
|
|
638
|
-
#### FairPlayConfiguration
|
|
639
|
-
> An object representing a FairPlay Streaming configuration.
|
|
640
|
-
|
|
641
|
-
| Property | Type | Description |
|
|
642
|
-
|----------|------|-------------|
|
|
643
|
-
| licenseURL | String | The FairPlay Streaming license URL to handle the server-side authentication flo… |
|
|
644
|
-
| certificate | Ti.Blob | The FairPlay Streaming public certificate to authenticate the content key reque… |
|
|
645
|
-
|
|
646
|
-
#### MovieSize
|
|
647
|
-
> Simple object used to describe the size of a movie.
|
|
648
|
-
|
|
649
|
-
| Property | Type | Description |
|
|
650
|
-
|----------|------|-------------|
|
|
651
|
-
| width | Number | Width of the movie. |
|
|
652
|
-
| height | Number | Height of the movie. |
|
|
653
|
-
|
|
654
|
-
---
|
|
655
|
-
|