# media

A picture or video from an offer gallery.

<!-- Generated by `bin/console app:dev:reference` from the platform code and docs/dev/_data/. Do not edit by hand. -->

A picture or video from an offer gallery. Pass it to `|image_url`.

Available on: [offer page](../page-types.md#product).

## Properties

| Property | Type | Description |
| --- | --- | --- |
| `media.id` | string | Media identifier. |
| `media.mediaType` | string | `image` or `video`. |
| `media.alt` | string | Alternative text. |
| `media.width` | number or null | Width of the original in pixels. |
| `media.height` | number or null | Height of the original in pixels. |
| `media.url` | string | Address of the original file. |
| `media.posterUrl` | string or null | Poster frame of a video. |

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| `media.urlForWidth(width)` | string | The rendition closest to a width - used by `\|image_url(width: …)`. Prefer the filter. |

