This object represents a music controller.
A MusicPlayer
lets you manage and playback a queue of media Item objects.
To retrieve an instance of a MusicPlayer object, use either the Titanium.Media.appMusicPlayer or the Titanium.Media.systemMusicPlayer property.
Use the Media module's openMusicLibrary and queryMusicLibrary methods to access the media items in the device's media library.
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
.
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
Current point in song playback, in seconds.
Current point in song playback, in seconds.
This property is read/write, so you can update the music player's current position by setting this property.
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.
An Item
object representing the currently playing media item.
An Item
object representing the currently playing media item.
Playback state.
This API can be assigned the following constants:
Repeat setting.
This API can be assigned the following constants:
Shuffle setting.
This API can be assigned the following constants:
Volume level for the music player from 0.0 (muted) to 1.0 (loudest).
Requires: iOS 7.0 and earlier
This property has no effect on devices running iOS 8.0 and later.
This adjusts the volume of the application's session.
The iOS simulator ignores this volume setting. This is a known issue with Apple's simulator.
Adds the specified callback as an event listener for the named event.
Name of the event.
Callback function to invoke when the event is fired.
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.
A dictionary of properties to apply.
Fires a synthesized event to any registered listeners.
Name of the event.
A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.
Pauses playback of the current media item.
Begins playback of the current media item.
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);
Name of the event.
Callback function to remove. Must be the same function passed to addEventListener
.
Begins seeking backward in the currently playing media.
Seeking speed increases as seeking continues.
Call stopSeeking to return to normal play.
Begins seeking forward in the currently playing media item.
While seeking forward audio plays faster than usual. The speed increases as seeking continues.
Call stopSeeking to return to normal play.
Sets the value of the bubbleParent property.
New value for the property.
Sets the value of the currentPlaybackTime property.
New value for the property.
Sets the value of the lifecycleContainer property.
New value for the property.
Sets the media queue.
Sets the media queue to a single media item or a list of items.
Starting in Titanium 6.1.0 you can also pass a String that identifies the Media item. This string has to be the Titanium.Media.Item.persistentID property that identifies a media item uniquely.
One or more media items.
Sets the value of the repeatMode property.
New value for the property.
Sets the value of the shuffleMode property.
New value for the property.
Sets the value of the volume property.
New value for the property.
Skips to the beginning of the currently playing media item.
Skips to the next media item in the queue.
If there are no more media items in the queue, ends playback.
Skips to the previous media item in the queue.
If there are no previous media items in the queue, ends playback.
Stops playback of the current media queue.
Ends a seek operation and returns to the previous playback state.
See also: seekForward and seekBackward.
Fired when the currently playing media item changes.
deprecated since 3.0.0
Use <Titanium.Media.MusicPlayer.playingchange> instead.
See nowPlaying to identify the current media item.
Source object that fired the event.
Name of the event fired.
True if the event will try to bubble up if possible.
Set to true to stop the event from bubbling.
Fired when the currently playing media item changes.
See nowPlaying to identify the current media item.
Source object that fired the event.
Name of the event fired.
True if the event will try to bubble up if possible.
Set to true to stop the event from bubbling.
Fired when the music player's playback state changes.
deprecated since 3.0.0
Use <Titanium.Media.MusicPlayer.statechange> instead.
See playbackState to identify the current playback state.
Source object that fired the event.
Name of the event fired.
True if the event will try to bubble up if possible.
Set to true to stop the event from bubbling.
Fired when the music player's playback state changes.
See playbackState to identify the current playback state.
Source object that fired the event.
Name of the event fired.
True if the event will try to bubble up if possible.
Set to true to stop the event from bubbling.
Fired when the volume changes.
deprecated since 3.0.0
Use <Titanium.Media.MusicPlayer.volumechange> instead.
This event has been deprecated and renamed volumechange (lower case).
Use the volume property to set or determine the current volume level for this player.
Source object that fired the event.
Name of the event fired.
True if the event will try to bubble up if possible.
Set to true to stop the event from bubbling.
Fired when the volume changes.
Use the volume property to set or determine the current volume level for this player.
Source object that fired the event.
Name of the event fired.
True if the event will try to bubble up if possible.
Set to true to stop the event from bubbling.