Skip to content
Client
Server

Reference / @open-music-sdk/util-artwork / tArtworkSrcSetOptions

Interface: tArtworkSrcSetOptions ​

Defined in: artwork.ts:55

What artworkSrcSet and artworkImage take: artworkUrl's options, and which densities to offer.

Extends ​

Properties ​

crop? ​

ts
readonly optional crop?: string;

Defined in: artwork.ts:45

Apple's code for how the image is cut to the box, such as "bb", the whole image fitted inside it, or "sr", the box filled. Default: the one the template names, or "bb" where it leaves that open as {c}.

Apple does not document the codes, so any code of the right shape is taken, its case kept: letters and digits, with single dots or hyphens between them, 32 characters at most, the dots and hyphens included, as in bb-60 or SC.DN01, which comes with some editorial artwork. A code that is neither bb nor cc, with or without a hyphen and more after it, is taken to fill the box exactly, as every other code tried did; if yours does not, lay the image out yourself.

Inherited from ​

tArtworkOptions.crop


densities? ​

ts
readonly optional densities?: readonly number[];

Defined in: artwork.ts:57

The pixel densities to offer, 16 at most. Default 1, 2 and 3.


format? ​

ts
readonly optional format?: "jpg" | "jpeg" | "png" | "webp" | "heic" | "heif";

Defined in: artwork.ts:34

The file format. Default: the one the template names, or "jpg" where it leaves that open as {f}.

Inherited from ​

tArtworkOptions.format


height? ​

ts
readonly optional height?: number;

Defined in: artwork.ts:32

Height in CSS pixels. Default: the height that keeps the artwork's own shape at width, or width where its shape is unknown.

Inherited from ​

tArtworkOptions.height


hosts? ​

ts
readonly optional hosts?: readonly string[];

Defined in: artwork.ts:51

The hosts artwork may come from, such as ["mzstatic.com"], where Apple serves its catalog artwork. With this, a URL that is not https on one of them or on a subdomain of one, with no port and no credentials, is a TypeError and nothing is returned. Default: where the URL points is not checked at all.

Inherited from ​

tArtworkOptions.hosts

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