Class

MusicKit

Use the MusicKit namespace to configure MusicKit JS and to access app instances, control music playback, and fetch data from the Apple Music API.

Topics

Configuring the Player

configure

Configure a MusicKit instance.

getInstance

Returns the configured MusicKit instance.

MusicKit.AppConfiguration

A configuration for an app.

MusicKit.Configuration

A dictionary used to configure the MusicKit instance.

MusicKit.MusicKitInstance

This object provides access to a player instance, and through the player instance, access to control playback.

Media Playback

MusicKit.Player

A media player that represents the media player for a MusicKit instance.

MusicKit.PlaybackBitrate

The playback bit rate of the music player.

MusicKit.PlaybackStates

The playback states of the music player.

MusicKit.PlayerRepeatMode

Possible values for the repeat mode for the music player.

MusicKit.PlayerShuffleMode

The shuffle mode for the music player.

Media Catalog

MusicKit.API

This class represents the Apple Music API.

Media Library

MusicKit.Library

This class represents a user's Cloud Library.

Media Items

MusicKit.MediaItem

This class represents a single media item.

MusicKit.MediaItemOptions

The options to use when defining a media item.

descriptor

This property describes a media item.

Playlist Queues

MusicKit.Queue

An array of media items to be played.

MusicKit.SetQueueOptions

The options to use when setting a music player's playback queue.

Errors

MusicKit.MKError

A class that describes an error that may occur when using MusicKit JS, including server and local errors.

Utilities

formatArtworkURL

Returns a formatted artwork URL.

formattedMilliseconds

Returns an object with milliseconds formatted into hours and minutes.

formattedSeconds

Returns an object with seconds formatted into hours and minutes.

generateEmbedCode

Generates Apple Music web player markup.

MusicKit.Events

A dictionary containing events for a MusicKit instance.

Instance Properties

Type Methods