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
Omit<tPreviewPlayerOptions,"audio">
Properties
audio?
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
Type Literal
{
current: | tPreviewAudio
| null;
}current
readonly current:
| tPreviewAudio
| null;The element the ref holds once it is rendered; null before, which the mount refuses.
hosts?
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
Omit.hosts