# Static assets on VOD

With static assets, each break points directly at its ad creatives: video or image files that you host on your own CDN. No ad server is involved — the SDK fetches the creative from the URL on the break and plays it when the viewer reaches the break. Use this workflow on movies, episodes, replays, and clips for direct-sold campaigns, sponsorships, promos, and branded overlays where you already know which creative to show.

|                | Static assets on VOD                                                       |
| -------------- | -------------------------------------------------------------------------- |
| Delivery mode  | Server-guided (SGAI)                                                       |
| Ad decisioning | None: the break names the creative                                         |
| Break creation | Scheduled at positions in the asset, or detected from the ad markers in it |
| Your app needs | The OptiView Ads SDK for your platform; nothing else                       |

## Before you start

* A [VOD channel](https://optiview.dolby.com/docs/ads/workflows/vod.md#set-up-a-vod-channel). The examples use the `mediatime` timebase.
* The OptiView Ads SDK in your app: [Web](https://optiview.dolby.com/docs/ads/player-integration/optiview-ads-sdk/web.md), [Android](https://optiview.dolby.com/docs/ads/player-integration/optiview-ads-sdk/android.md), [iOS](https://optiview.dolby.com/docs/ads/player-integration/optiview-ads-sdk/ios.md), or [React Native](https://optiview.dolby.com/docs/ads/player-integration/optiview-ads-sdk/react-native.md). Static assets need no ad server, no Google Ad Manager account, and no extra configuration in the app.
* Your creatives on a CDN that the viewers' devices can reach.

## Schedule a break

A static asset sets `type` to `static` and `uri` to the URL of the creative. On a `mediatime` channel, `start` is the position in the asset, in seconds. This mid-roll plays 10 minutes in, and viewers cannot skip it by seeking:

```bash
curl -X POST 'https://us.ads.optiview.dolby.com/api/v1/channels/<channel-id>/breaks' \
  -u "$ADS_API_KEY:$ADS_API_SECRET" \
  -H 'Content-Type: application/json' \
  -H 'X-Org-ID: <org-id>' \
  -d '{
    "start": 600,
    "duration": 30,
    "controls": { "snapback": true },
    "variant": {
      "format": "single",
      "assets": [
        {
          "type": "static",
          "mediaType": "video",
          "mimeType": "application/x-mpegurl",
          "uri": "https://cdn.example.com/ads/spot.m3u8",
          "interaction": { "clickThrough": "https://www.example.com/offer" }
        }
      ]
    }
  }'
```

The `uri` can also be a list of URLs targeted per device type. See [Static assets](https://optiview.dolby.com/docs/ads/concepts/breaks.md#static-assets) and [Asset URI targeting](https://optiview.dolby.com/docs/ads/concepts/breaks.md#asset-uri-targeting) for the full asset model.

### Pre-roll, post-roll, and pause ads

Set `start` to a player event instead of a position:

| Break     | `start`                                 |
| --------- | --------------------------------------- |
| Pre-roll  | `{ "type": "event", "event": "start" }` |
| Post-roll | `{ "type": "event", "event": "end" }`   |
| Pause ad  | `{ "type": "event", "event": "pause" }` |

A pause ad is typically an image in the `overlay` layout. See [Event based triggers](https://optiview.dolby.com/docs/ads/concepts/breaks.md#event-based-triggers).

### Detect the breaks

Instead of scheduling every break, add the asset as an [origin](https://optiview.dolby.com/docs/ads/concepts/origins.md) and configure a [marker rule](https://optiview.dolby.com/docs/ads/concepts/marker-detection.md) whose [template](https://optiview.dolby.com/docs/ads/concepts/templates.md) holds the static assets. Every matching ad marker in the asset, such as an SCTE-35 signal, becomes a break at its position.

## How the break plays

* The SDK fetches the channel's [Break Manifest](https://optiview.dolby.com/docs/ads/concepts/break-manifest.md) once when the session starts. It lists every break, and the SDK loads each creative shortly before its break.
* With `snapback`, a viewer who seeks past a break is taken back to the break first; afterwards, playback continues where the viewer was seeking to. Without it, viewers can skip the break by seeking. See [Seeking and snapback](https://optiview.dolby.com/docs/ads/workflows/vod.md#seeking-and-snapback).
* A break plays at most once per session.

## Supported layouts

Static assets work in every [layout](https://optiview.dolby.com/docs/ads/concepts/breaks.md#layouts):

| Layout          | Static asset                                                                  |
| --------------- | ----------------------------------------------------------------------------- |
| Single          | A video that replaces the content.                                            |
| Double box      | A video next to your content, with an image or video `companion` behind both. |
| L-shape ad      | A video, with an image or video `companion` that fills the L-shaped backdrop. |
| L-shape content | An image that fills the L-shaped backdrop while your content keeps playing.   |
| Overlay         | An image or video on top of your content.                                     |

An image stays on screen for the asset's `duration`, or for the break's `duration` when the asset has none.

Static assets can also be used for [pause ads](https://optiview.dolby.com/docs/ads/concepts/breaks.md#pause): an image, or a progressive MP4 video that plays muted, shown while the viewer is paused.

## Creative formats

* **HLS (`.m3u8`)** is the recommended format for video creatives on every platform. On connected TVs in particular, the SDK can load an HLS creative ahead of the break, so the ad starts faster.
* **Progressive MP4** also works. On Web, the SDK plays MP4 creatives through the browser's own video element.
* **Images** are used for overlays, companions, L-shape backdrops, and pause ads.

Set `mimeType` on the asset when you know it. The SDK then knows upfront how to play the creative, instead of having to find out, which makes ad preparation faster.

## Tracking and reporting

The SDK reports an OptiView Ads [impression](https://optiview.dolby.com/docs/ads/how-to-guides/ad-impressions.md) for every break it presents, and emits ad events — such as the start and end of each break and ad — that your app can listen to. See the API reference of your platform for the full list of events.

Static assets carry no third-party tracking URLs. If an advertiser needs to count impressions in their own ad server, deliver the creative through a [VAST tag](https://optiview.dolby.com/docs/ads/workflows/vod/vast.md) instead: the VAST response carries the advertiser's tracking URLs, which are fired while the ad plays.

## Troubleshooting

* **The break does not play.** Check that the channel's [Break Manifest](https://optiview.dolby.com/docs/ads/concepts/break-manifest.md) contains the break, and that the creative URL is publicly reachable.
* **Web: the creative fails to load.** The SDK downloads HLS creatives with HTTP requests from your page, so your CDN must allow cross-origin requests (CORS) from your app's origin.
* **A creative cannot be played.** The SDK emits an `aderror` event for the asset, continues with the next asset in the break if there is one, and otherwise returns to your content.

## Related resources

| Resource                                                                                      | Description                                                   |
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [VOD](https://optiview.dolby.com/docs/ads/workflows/vod.md)                                   | VOD channels: timebase, seeking, and delivery modes.          |
| [Breaks](https://optiview.dolby.com/docs/ads/concepts/breaks.md)                              | Layouts, variants, controls, and the asset model.             |
| [Templates](https://optiview.dolby.com/docs/ads/concepts/templates.md)                        | Store a break with its static assets once, and reuse it.      |
| [Your ad server (VAST) on VOD](https://optiview.dolby.com/docs/ads/workflows/vod/vast.md)     | Let your ad server decide which creative to play.             |
| [Static assets on live](https://optiview.dolby.com/docs/ads/workflows/live/static-assets.md)  | The same workflow for live streams.                           |
| [Ad impression tracking](https://optiview.dolby.com/docs/ads/how-to-guides/ad-impressions.md) | How OptiView Ads counts the breaks presented to your viewers. |
