{
 "id": "music-player",
 "name": "Music player",
 "purpose": "A compact player card: album art, title and artist, a waveform you can seek, elapsed and total time, previous, play and next, and volume.",
 "use_when": [
  "in a media or podcast app",
  "a now-playing card for one audio track, voice note or episode, docked beside other content"
 ],
 "avoid_when": [
  "a list of tracks to choose from: use track-list",
  "a list of podcast episodes: use podcast-episodes",
  "video playback: use video-player"
 ],
 "type": "content",
 "style": "friendly",
 "width": "narrow",
 "tags": {
  "audience": "consumer",
  "industries": [
   "any"
  ],
  "keywords": [
   "audio",
   "player",
   "waveform",
   "media",
   "playback"
  ]
 },
 "root": ".odl-music-player",
 "parts": [
  {
   "name": "art",
   "selector": ".odl-art",
   "what": "album art, decorative",
   "slot": "media"
  },
  {
   "name": "eyebrow",
   "selector": ".odl-eyebrow",
   "what": "where the track sits, such as side and track number",
   "slot": "text"
  },
  {
   "name": "title",
   "selector": ".odl-music-player h3",
   "what": "the track title",
   "slot": "text"
  },
  {
   "name": "artist",
   "selector": ".odl-by span:first-child",
   "what": "the artist",
   "slot": "text"
  },
  {
   "name": "album",
   "selector": ".odl-album",
   "what": "the album",
   "slot": "text"
  },
  {
   "name": "like",
   "selector": ".odl-like",
   "what": "a like toggle",
   "slot": "action"
  },
  {
   "name": "seek",
   "selector": ".odl-seek input",
   "what": "a range input over a drawn waveform; the played part is filled",
   "slot": "input"
  },
  {
   "name": "times",
   "selector": ".odl-times",
   "what": "elapsed and total time",
   "slot": "text"
  },
  {
   "name": "transport",
   "selector": ".odl-transport button",
   "what": "previous, play or pause, and next",
   "slot": "action"
  },
  {
   "name": "volume",
   "selector": ".odl-volume input",
   "what": "volume slider, hidden on a phone",
   "slot": "input"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "title",
   "artist",
   "duration_seconds"
  ],
  "properties": {
   "art": {
    "type": "string",
    "maxLength": 300,
    "part": "art"
   },
   "eyebrow": {
    "type": "string",
    "maxLength": 32,
    "part": "eyebrow"
   },
   "title": {
    "type": "string",
    "maxLength": 40,
    "part": "title"
   },
   "artist": {
    "type": "string",
    "maxLength": 32,
    "part": "artist"
   },
   "album": {
    "type": "string",
    "maxLength": 32,
    "part": "album"
   },
   "liked": {
    "type": "boolean",
    "part": "like"
   },
   "duration_seconds": {
    "type": "integer",
    "minimum": 1,
    "maximum": 5999,
    "part": "seek"
   },
   "position_seconds": {
    "type": "integer",
    "minimum": 0,
    "maximum": 5999,
    "part": "seek"
   },
   "next_title": {
    "type": "string",
    "maxLength": 40,
    "part": "transport"
   },
   "volume": {
    "type": "integer",
    "minimum": 0,
    "maximum": 100,
    "part": "volume"
   }
  }
 },
 "states": {
  "shown": [
   "paused",
   "playing",
   "seeking",
   "liked",
   "hover",
   "focus"
  ],
  "edge": {
   "empty": {
    "status": "not_built",
    "how": "with nothing queued, show a muted art square, 'Nothing playing' as the title and disable the transport"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if the track will not play, put a short message where the times are and offer Next"
   },
   "disabled": {
    "status": "not_built",
    "how": "set disabled on Previous or Next at the start or end of the queue and style it with the muted text colour"
   },
   "overflow": {
    "status": "handled",
    "how": "on a phone the volume slider goes and the art gets smaller",
    "evidence": "@container (max-width: 26rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "artist and album are cut with an ellipsis; the title wraps",
    "evidence": ".odl-by span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }"
   },
   "missing_image": {
    "status": "handled",
    "evidence": "data-od-media",
    "how": "the Smart UI renderer swaps a photo that fails to load for a block of the same size with its alt text"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-accent-bold",
  "--ds-color-bg-accent-bold-hover",
  "--ds-color-bg-accent-bold-pressed",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-on-accent",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-4",
  "--ds-radius-container",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-size-control-lg",
  "--ds-size-control-md",
  "--ds-size-icon-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-12",
  "--ds-space-4",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inset-lg",
  "--ds-space-inset-xl",
  "--ds-space-stack-lg",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-body-sm",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "Seek and volume are native range inputs with names, and seek reads its time as \"1:47 of 3:53\"; play changes its name to Pause while playing, and the album art is decorative.",
  "roles": [
   "region"
  ],
  "keyboard": [
   "Tab reaches Like, Seek, Previous, Play, Next, then Volume",
   "Enter or Space presses the focused button; Play switches to Pause while playing",
   "Arrow keys on Seek move by one second and update the time",
   "Arrow keys on Volume change the level"
  ],
  "controls": {
   "button": 4,
   "input": 2,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/music-player/component.html",
  "bytes": 21652,
  "script": true
 },
 "source": "brand/showcase/components/08-music-player",
 "photos": 1,
 "urls": {
  "html": "https://opendesigner.dev/library/music-player.html",
  "json": "https://opendesigner.dev/library/music-player.json",
  "page": "https://opendesigner.dev/library/music-player/"
 },
 "get": {
  "curl": "curl -fsSLo music-player.html https://opendesigner.dev/library/music-player.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add music-player --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component music-player to this project: https://opendesigner.dev/library/music-player.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
