OwnMediaHostDocs
API reference

Serving & embedding

Embed hosted images and video in your application.

Check the returned URL for your release.The platform README uses /a/… aliases and /private/… links; the API document uses /i/… and tokenized /f/… links. These supplied documents differ. Use the actual URL returned by your installed API instead of constructing it.

Files are served directly via their public URL paths:

URL PatternDescription
/f/{public_id}Direct file access by public ID
/f/{public_id}.{ext}Direct file with explicit extension
/i/{alias_path}Access via vanity alias
/thumbnails/{public_id}.jpgAuto-generated thumbnail

Embedding in HTML

html
<!-- Image -->
<img src="https://media.example.com/f/xK9mP2" alt="Sunset Beach" />

<!-- Video -->
<video src="https://media.example.com/f/aB3cDe" controls></video>

<!-- Via alias -->
<img src="https://media.example.com/i/hero-banner" alt="Hero" />

React Component

jsx
function MediaImage({ publicId, alt }) {
  const BASE = 'https://media.example.com';
  return (
    <img
      src={`${BASE}/f/${publicId}`}
      alt={alt}
      decoding="async"
      style={{ maxWidth: '100%', height: 'auto' }}
    />
  );
}

function MediaVideo({ publicId }) {
  const BASE = 'https://media.example.com';
  return (
    <video
      src={`${BASE}/f/${publicId}`}
      controls
      playsInline
      style={{ maxWidth: '100%' }}
    />
  );
}

Based on the supplied platform and API documentation. View project source ↗