Skip to content

media

A media item attached to a product: image, video (adaptive streaming), or 3D model.

Properties

PropertyDescription
media.altAlt text.
media.aspect_ratioWidth ÷ height.
media.attached_to_variant?Boolean predicate for attached_to_variant on this media.
media.durationBuyer-visible duration value for this media.
media.embed_urlBuyer-visible URL for embed, or nil/empty when unavailable.
media.external_idIdentifier for the related external record, or nil/empty when unavailable.
media.file_size_bytesBuyer-visible file_size_bytes value for this media.
media.file_typePublic file type value.
media.filenameBuyer-visible filename value for this media.
media.heightHeight in px.
media.hostHost being served.
media.idUnique identifier.
media.media_typeMedia type (‘image’, ‘video’, ‘model’).
media.mime_typePublic mime type value.
media.positionPosition/order index.
media.presentationBuyer-visible presentation value for this media.
media.preview_imagePreview image for the media.
media.product_idIdentifier for the related product record, or nil/empty when unavailable.
media.sourcesBuyer-visible sources value for this media.
media.srcSource URL.
media.urlRelative URL of the resource.
media.variantsVariants exposed in this resource context.
media.widthWidth in px.

Property list is generated from the storefront engine (AnyMediaDrop), so it always matches what your theme can use. Use {{ media | json }} only as a curated debug snapshot; it can omit lazy or otherwise public properties.