# Playable specifications

> Review the build and MRAID requirements for playable creatives with Unity Ads.

A playable is a short interactive experience that gives players an impression of what your game or app is about. Playables run inside the Unity Ads webview, either as a standalone playable ad or as a playable end card after a video ad. For recommendations on how to design playables that engage players, refer to [Playable best practices](../best-practices/playable).

For the details of each requirement, refer to the linked section. Every playable creative must meet the following requirements to pass moderation:

1. **Build requirements**

   | Requirement                                                      | Summary                                                                                                                          |
   | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
   | [File](#file-requirements)                                       | A single minified `index.html` file less than 5 MB, with all assets inlined, that runs on Android 5 or later and iOS 13 or later |
   | [Layout](#layout-requirements)                                   | One responsive build for portrait and landscape, with interactive content clear of Unity's controls                              |
   | [Audio and video](#audio-and-video-requirements)                 | Respects the iOS mute switch, stops audio when the ad isn't viewable, and hides native video controls                            |
   | [Network and attribution](#network-and-attribution-requirements) | No network requests at runtime, and no attribution events of its own                                                             |

2. **MRAID requirements**

   | Requirement                                             | Summary                                                                                                  |
   | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
   | [MRAID feature support](#mraid-feature-support)         | Full-screen ads only, with no unsupported MRAID features                                                 |
   | [Viewability](#viewability-requirements)                | Starts only after the MRAID `ready` event when the ad is viewable, and pauses when the ad isn't viewable |
   | [App store redirects](#app-store-redirect-requirements) | Opens the store with `mraid.open`, only after gameplay and a player tap                                  |

3. **Additional requirements**

   | Requirement                                           | Summary                                                                          |
   | ----------------------------------------------------- | -------------------------------------------------------------------------------- |
   | [Playable end cards](#playable-end-card-requirements) | All playable requirements, plus a call to action button that opens the app store |
   | [Gambling creatives](#gambling-creative-requirements) | A managed account                                                                |
   | [iOS apps](#ios-app-requirements)                     | Only the Apple App Store logo, following Apple's marketing guidelines            |

## Build requirements

Build requirements describe how you package and code the playable file itself, including its file format, layout, audio, and network behavior. Your playable file must meet the build requirements in the following tabs:

1. **File**

   ### File requirements

   The device downloads only the HTML file from the content delivery network (CDN), and Unity Ads ignores anything outside that file. Your playable file must meet the following requirements:

   | Requirement                          | Specification                                                                                                                                                                                                 |
   | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **File format**                      | A single HTML file (`index.html`)                                                                                                                                                                             |
   | **File size**                        | Less than 5 MB                                                                                                                                                                                                |
   | **Asset encoding**                   | Every image, audio, and video asset inlined as base64 data                                                                                                                                                    |
   | **Asset references**                 | No references to other files, folders, or assets through relative paths or remote URLsA playable that works locally but shows a blank screen in the ad unit usually still references an asset by path or URL. |
   | **Minification**                     | Whitespace removed and names shortened                                                                                                                                                                        |
   | **Minimum operating system version** | * Android 5 or later
   * iOS 13 or later                                                                                                                                                                        |

2. **Layout**

   ### Layout requirements

   Unity Ads serves your playable in both portrait and landscape orientations, and you can't select the orientation manually.

   Additionally, Unity displays its own controls in the top and bottom areas of the screen. These controls include the countdown, the close button, and UI for privacy and consent. The controls that appear depend on the type of ad, the region, and the player's consent state. These controls can also change over time.

   Your playable must meet the following layout requirements:

   | Requirement               | Specification                                                                                                                                                                                                                                                                   |
   | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Orientation**           | Portrait and landscape, from a single responsive buildSupport for single-orientation playables is marked for deprecation, and all new playable creatives must be responsive. Single-orientation playables in existing creative packs or campaigns continue to work as expected. |
   | **Resizing**              | Adjusts when the screen size or orientation changes                                                                                                                                                                                                                             |
   | **Reserved screen areas** | Text, buttons, and other interactive content stay out of the top and bottom areas of the screen, where Unity draws its own ad unit controls                                                                                                                                     |
   | **Container UI**          | Doesn't block the close button or any other container UI element                                                                                                                                                                                                                |
   | **Prohibited UI**         | No custom close buttons, fake close buttons, fake system UI, or deceptive alerts                                                                                                                                                                                                |


   **Reserved areas and safe zone in a playable:**
   ![A wireframe of a playable ad. Bands at the top and bottom of the screen are reserved for the Unity overlay and native platform features. The safe zone between them holds important elements, logos, and calls to action.](/api/media?file=user-acquisition/media/images/layout-guide-playable.svg)

3. **Audio and video**

   ### Audio and video requirements

   Your playable's audio and video must meet the following requirements:

   | Requirement                 | Specification                                                                                                                                                                                                             |
   | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **iOS mute switch**         | The ad is silent when the iOS mute switch is on.To meet this requirement, use the Web Audio API as the primary audio path, and use `HTMLAudioElement` only as a fallback. `HTMLAudioElement` ignores the iOS mute switch. |
   | **Audio when not viewable** | Audio stops when the ad isn't viewable, such as when the app moves to the background or the screen locks.To meet this requirement, mute and resume audio from your `viewableChange` handler.                              |
   | **Video controls**          | Native video controls are hidden.To meet this requirement, add the following CSS to your playable:```css
   video::-webkit-media-controls {
     display: none !important;
   }
   ```                                                |

4. **Network and attribution**

   ### Network and attribution requirements

   Your playable must meet the following network and attribution requirements:

   | Requirement          | Specification                                                                                                                                                                                                |
   | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   | **Network requests** | The playable runs without network requests (XHR). It can't load images, configuration, or other content from a server at runtime.                                                                            |
   | **Analytics calls**  | Unity can permit analytics calls that collect player interaction data. The calls can't contain personal data, such as user or device identifiers, and must follow all applicable laws and platform policies. |
   | **Attribution**      | The playable doesn't fire its own attribution events. Unity handles start, view, and click attribution server-side.                                                                                          |

## MRAID requirements

Playables must support Mobile Rich Media Ad Interface Definitions (MRAID) 3.0, the common API for rich media ads that run in mobile apps. The Unity Ads webview injects MRAID, so your playable doesn't need an MRAID script tag. For the full specification, refer to [Mobile Rich Media Ad Interface Definitions (MRAID)](https://www.iab.com/guidelines/mobile-rich-media-ad-interface-definitions-mraid/) (Interactive Advertising Bureau).

Your playable must meet the MRAID requirements in the following tabs:

1. **Features**

   ### MRAID feature support

   Unity Ads supports only MRAID 3.0 full-screen ads.

   Ensure that your playable doesn't use any of the following unsupported MRAID features:

   * `expand`
   * `resize`
   * Custom close buttons
   * `sms`
   * `tel`
   * `calendar`
   * `storePicture`

   Custom close buttons aren't supported because the Unity Ads SDK controls when players can close or skip an ad.

2. **Viewability**

   ### Viewability requirements

   Your playable must meet the following viewability requirements:

   | Requirement | Specification                                                        |
   | ----------- | -------------------------------------------------------------------- |
   | **Start**   | Only after the MRAID `ready` event, and only when the ad is viewable |
   | **Pause**   | When the ad isn't viewable                                           |

   Don't start playable content on page load. Content that runs before the ad is viewable uses up the player's first seconds and looks broken.

   The following example waits for MRAID to be ready, starts the playable when the ad is viewable, and pauses it when the ad isn't viewable:

   ```javascript title="Start and pause on viewability"
   // Wait for MRAID to be ready before you set up the playable.
   if (mraid.getState() === "loading") {
     mraid.addEventListener("ready", onReady);
   } else {
     onReady();
   }

   function onReady() {
     // Listen for viewability changes to pause and resume the playable.
     mraid.addEventListener("viewableChange", onViewableChange);

     // Start the playable only if the ad is already viewable.
     if (mraid.isViewable()) {
       startPlayable();
     }
   }

   function onViewableChange(viewable) {
     if (viewable) {
       // Start the playable, or resume it if it already started.
       startPlayable();
     } else {
       // Pause gameplay and mute audio.
       pausePlayable();
     }
   }
   ```

3. **App store redirects**

   ### App store redirect requirements

   Your playable must meet the following app store redirect requirements:

   | Requirement | Specification                                                                    |
   | ----------- | -------------------------------------------------------------------------------- |
   | **Method**  | `mraid.open`                                                                     |
   | **Trigger** | A player tap on a call to action (CTA), after the player interacts with gameplay |

   Redirects without player interaction aren't allowed, and the player's first tap can't open the app store. Deceptive redirects aren't allowed either. A deceptive redirect is a gameplay element that opens the app store instead of doing what the player expects.

   To open the correct store, detect the platform from the user agent. Newer iPadOS versions report Macintosh in the user agent, so test for Android and treat all other platforms as iOS. The following example opens the store page for the player's platform:

   ```javascript title="Open the store page"
   // Call this function only from a player tap on your CTA, after the player interacts with gameplay.
   function openStore() {
     var ua = navigator.userAgent || navigator.vendor;
     var url = "https://apps.apple.com/app/idyourgame";

     if (/android/i.test(ua)) {
       url = "https://play.google.com/store/apps/details?id=yourgame";
     }

     mraid.open(url);
   }
   ```

## Additional requirements

Playable end cards, gambling creatives, and playables for iOS apps must meet the following additional requirements:

1. **Playable end cards**

   ### Playable end card requirements

   A playable end card is a playable that runs after a video ad. Playable end cards must meet all the [build](#build-requirements) and [MRAID](#mraid-requirements) requirements for playables.

   Additionally, playable end cards must include a call to action (CTA) button that opens the Google Play store or Apple App Store.

   > **Note:**
   >
   > A playable end card can start at the same time as the video in the creative pack.

2. **Gambling creatives**

   ### Gambling creative requirements

   Because gambling ads are sensitive for many publishers, Unity requires gambling advertisers to have managed accounts.

   > **Important:**
   >
   > Moderation rejects gambling creatives from unmanaged partners.

   To become a managed partner or learn more about Unity's gambling ad policies, [contact Unity](https://unity.com/support-services). For more information, refer to [Unity's legal website](https://unity.com/legal).

3. **iOS apps**

   ### iOS app requirements

   Playables for iOS apps must follow Apple's requirements for creatives.

   > **Note:**
   >
   > The Apple App Store has unique rules for creatives. To adhere to Apple requirements, only depict the Apple App Store logo in creatives for iOS apps. Refer to [Apple's marketing guidelines](https://developer.apple.com/app-store/marketing/guidelines/#badges) for more information.
