Skip to content
Client
Server

Reference / @open-music-sdk/lib-preview-player / tPreviewPlayerOptions

Interface: tPreviewPlayerOptions ​

Defined in: lib/lib-preview-player/src/player.ts:73

The options of previewPlayer. Both are checked and taken when the player is made.

Properties ​

audio? ​

ts
readonly optional audio?: tPreviewAudio;

Defined in: lib/lib-preview-player/src/player.ts:79

The audio element to play through. Default: one made with new Audio(), which a browser has and a server has not. Your own keeps its controls, and what they do shows in state: a pause, or a volume set on the element. The player never adds the element to the page or takes it out.


hosts? ​

ts
readonly optional hosts?: readonly string[];

Defined in: lib/lib-preview-player/src/player.ts:87

The hosts a clip may come from, as 1 to 16 bare host names in small letters, such as ["itunes.apple.com"]. With this, a track whose clip is not https on one of them or on a subdomain of one, with no port and no credentials, is skipped as "host". Default: where a clip points is not checked at all. Apple does not document which host serves its clips. Against the live API on 18 October 2026, the clips of 50 chart songs were all on audio-ssl.itunes.apple.com, which the example allows; Apple may serve others elsewhere.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.