Uploader

Drag-and-drop file uploader with progress tracking and theme support.

Usage

Load the component via CDN, then drop the element into your page. Provide a Client-Side API key and, optionally, a collection ID to upload into. If the API key is scoped to a collection, the collection ID is resolved automatically.

<script type="module" src="https://components.audiodelivery.net/uploader.js"></script>

<audiodn-uploader
  api-key="YOUR_API_KEY"
  collection-id="COLLECTION_ID"
></audiodn-uploader>

Attributes

Attribute Type Default Description
api-key string Client-Side API key (safe to use in front-end code). Either api-key or upload-session-id is required. When set, the session is automatically renewed before it expires.
upload-session-id string Server-provisioned upload session ID. Either upload-session-id or api-key is required. Use this when your server creates sessions on behalf of the client.
collection-id string Target collection to upload tracks into. Optional when the API key is scoped to a collection.
accent-color string "#fe008a" Accent color for the upload progress and buttons
disabled boolean false Disables the uploader when set

Default

Drag-and-drop file uploader with progress tracking. Requires an API key and collection ID.

<audiodn-uploader
  api-key="YOUR_API_KEY"
  collection-id="COLLECTION_ID"
></audiodn-uploader>

Themes

Override CSS custom properties on the host to restyle the uploader. Uses the same --adn-* API as the player.

Light / Dark (system preference)

.theme-uploader-lightdark {
  --adn-main-border: 1px solid light-dark(#ccc, #444);
  --adn-bg: light-dark(#fff, #111);
  --adn-bg-light: light-dark(#eee, #222);
  --adn-color-font: light-dark(#222, #eee);
  --adn-color-font-muted: light-dark(#666, #aaa);
  --adn-color-accent: light-dark(#0066cc, #4da6ff);
  --adn-color-accent-alt: light-dark(#fff, #111);
  --adn-border-color: light-dark(#ccc, #444);
  --adn-radius: 6px;
}
<audiodn-uploader
  class="theme-uploader-lightdark"
  api-key="YOUR_API_KEY"
  collection-id="COLLECTION_ID"
></audiodn-uploader>

Midnight

.theme-uploader-midnight {
  --adn-bg: #1a1a2e;
  --adn-bg-light: #2a2a4e;
  --adn-color-font: #e0e0e0;
  --adn-color-font-muted: #8888aa;
  --adn-color-accent: #7c3aed;
  --adn-color-accent-rgb: 124, 58, 237;
  --adn-color-accent-alt: #fff;
  --adn-border-color: #3a3a5e;
  --adn-color-highlight: rgba(124, 58, 237, 0.12);
  --adn-radius: 12px;
  --adn-main-border: 1px solid #3a3a5e;
  --adn-box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
<audiodn-uploader
  class="theme-uploader-midnight"
  api-key="YOUR_API_KEY"
  collection-id="COLLECTION_ID"
></audiodn-uploader>