Type function
Return value [TYPE][api.type.TYPE]
Revision 2014.2419
Sample code
See also


Displays the iTunes library picker and enables you to pick one or more items to playback at a later date.

Syntax onComplete ) options, onComplete )
onComplete (required)

Listener. The callback function that is executed after dismissing the iTunes library picker.

options (optional)

Table. Table of parameters. See Format for options below.

Format for options

The options table contains the following properties:

allowsPickingMultipleItems (optional)

Boolean. If set to true, the iTunes picker will allow you to select multiple items to play. Default is false.

promptTitle (optional)

String. This is the title that appears on the iTunes picker navigation bar. Default is "Select song to play"


-- Require the iTunes library
local iTunes = require( "CoronaProvider.plugin.iTunes" )
local widget = require( "widget" )

-- Function that gets executed after media item(s) have been chosen
local function onMediaChosen( event )
    -- If a song was picked, print it's details
    if then
        for i = 1, do
            print( "url",[i].url )
            print( "album artist",[i].albumArtist )
            print( "album title",[i].albumTitle )
            print( "song title",[i].songTitle )
            print( "performing artist",[i].performingArtist )
            print( "composer",[i].composer )
            print( "genre",[i].genre )
            print( "lyrics",[i].lyrics )
            print( "podcast title",[i].podcastTitle )

-- Function to show the iTunes picker
local function showItunesLibrary()
    -- Options to pass to
    local options =
        allowsPickingMultipleItems = true,
        promptTitle = "Select some songs!",

    -- Show the users iTunes library options, onMediaChosen )

-- Button to show the picker
local showPicker = widget.newButton
    label = "Show Picker",
    onRelease = showItunesLibrary,
showPicker.x = display.contentCenterX
showPicker.y = stopButton.y + ( showPicker.contentHeight + 45 )