类型 函数 返回值 无 修订版本 版本 2024.3703 关键词 pause(暂停), iTunes 另请参阅 iTunes iTunes.play()(播放) iTunes.pause()(暂停) iTunes.stop()(停止)
恢复从 iTunes 库中选择并当前处于暂停状态的项目。
iTunes.resume()
local iTunes = require( "plugin.iTunes" )
-- Table to store media items
local mediaItems = {}
-- Function that is executed when song playback is complete
local function onPlaybackEnded()
print( "Playback completed!" )
end
-- Function that is executed after media item(s) have been chosen
local function onMediaChosen( event )
if ( event.data ) then
for i=1,#event.data do
mediaItems[i] = event.data[i]
end
--play the first item chosen
iTunes.play( mediaItems[1].url, onPlaybackEnded )
--pause the song
iTunes.pause()
--resume the song
iTunes.resume()
end
end
local iTunesOptions =
{
allowsPickingMultipleItems = true,
promptTitle = "Select some songs"
}
iTunes.show( iTunesOptions, onMediaChosen )