Skip to content
Client
Server

Reference / @open-music-sdk/react / tUsePreviewPlayerOptions

Interface: tUsePreviewPlayerOptions ​

Defined in: integrations/react/src/client.ts:217

What usePreviewPlayer takes: the player's options, with the element or a ref to it.

Extends ​

Properties ​

audio? ​

ts
readonly optional audio?: 
  | tPreviewAudio
  | {
  current:   | tPreviewAudio
     | null;
};

Defined in: integrations/react/src/client.ts:219

The element to play through, or a ref to one, read when the component mounts. Default: one made with new Audio().

Union Members ​

tPreviewAudio


Type Literal ​
ts
{
  current:   | tPreviewAudio
     | null;
}
current ​
ts
readonly current: 
  | tPreviewAudio
  | null;

The element the ref holds once it is rendered; null before, which the mount refuses.


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.

Inherited from ​

ts
Omit.hosts

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