<SYSTEM>This documentation covers examples of how developers might use Mux Video</SYSTEM>

# Moderate video content

Use technical and operational strategies to moderate user-generated video on your platform. This guide shows how to limit access to videos, detect high delivery traffic, and set a clear content policy.

If your platform accepts **user-generated content** in any form, you know that people will upload everything and anything. For video this can be particularly high stakes, with the potential for users to upload anything from popular media content to inappropriate footage.

While large platforms may staff big teams of Trust & Safety specialists, **you don't need an army to implement content moderation strategies of your own**. Below we've rounded up a number of technical and operational strategies that Mux customers can use to keep their content libraries healthy.

## Technical strategies

### Secure Video Playback

Mux's secure video playback tools can help make it more difficult for bad actors to use your videos for their own purposes.

When first testing out Mux, it's common to set a video's playback policy to `public` so you can easily view the video via its public URL. Once testing is done, we recommend that UGC platforms switch to using [signed playback policies](/docs/guides/secure-video-playback#1-create-an-asset-or-live-stream-with-a-signed-playback-policy) to help curb abuse. These allow you to use a [JWT](/docs/guides/signing-jwts) to time-limit requests for your content and to set [playback restrictions](/docs/guides/secure-video-playback#3-create-an-optional-playback-restriction-for-your-mux-account-environment) specifying which referring domains can serve your content.

### High Delivery Webhook

For certain platforms, we currently offer an internal feature that sends notifications via webhook when we detect high delivery traffic on an asset. This can be helpful to catch unauthorized content quickly, before it results in increased spend or risk to your platform. To get this feature enabled for your account, [contact Support](/support).

### Alert Forwarding

Our Trust & Safety team contacts all administrators on your account in the event of account usage or content that violates our [Terms of Service](https://www.mux.com/terms). Our team may take actions that include the deletion of assets, disabling of live streams, and in rare cases disabling of environments. Because bad actors will often repeatedly upload the same unauthorized content, we recommend making sure these messages reach you right away so you can take appropriate actions to address the source (e.g., closing the user's account).

To ensure emails from our team get escalated, add an email group or paging service email as an admin on your Mux account. (For example, see PagerDuty's docs on [email routing](https://support.pagerduty.com/docs/email-integration-guide).)

### Video Content Moderation

As our own engineers have blogged about, [you either die an MVP or live long enough to build content moderation](https://www.mux.com/blog/you-either-die-an-mvp-or-live-long-enough-to-build-content-moderation). A basic content moderation flow should take some information about the video asset (a sample of still frames, the transcript of its audio track, a copy of its metadata) and evaluate it based on algorithmic rules to escalate potentially troublesome content. For a peek at how Mux has iterated on our own approach, check out [this talk](https://www.youtube.com/watch?v=eydIWjJodeY\&list=PLkyaYNWEKcOesxC4VpHJtbjnzuN6r1NGg) that one of our experts gave at Demuxed 2023.

Mux Robots can run this flow for you. The [`moderate` workflow](/docs/guides/robots-moderate) scores thumbnail samples and transcript windows from an asset for sexual and violent content, and can [automatically unpublish flagged assets](/docs/guides/robots-moderate#take-action-on-flagged-content) by removing their playback IDs until a human has reviewed them. Every platform's risk tolerance is different, so see [choose a sampling interval and thresholds](/docs/guides/robots-moderate#choose-a-sampling-interval-and-thresholds) for how to tune the workflow to yours. Automated moderation is triage; pair it with the reporting and policy measures described below.

If you'd rather build your own pipeline, check out these docs & blogs for retrieving the relevant data:

* [Get images from a video](/docs/guides/get-images-from-a-video)
* [Add auto-generated captions to your videos and use transcripts](/docs/guides/add-autogenerated-captions-and-use-transcripts)
* [Create timeline hover previews](/docs/guides/create-timeline-hover-previews) (helpful for human reviewers)
* [No-code partner integration blog](https://www.mux.com/blog/video-content-moderation-in-five-minutes-without-code-using-avflow-hive-and-mux)

Many customers grab images from their content via Mux APIs to feed into third-party services that can provide object detection and specialized content classification. While we recommend relying primarily on thumbnails, we also support MP4 downloads for those services that prefer a video. The results coming out of these services can be used as the trigger for automated workflows that end up in your own Slack channel or on platforms like Pagerduty or Opsgenie. Through those flows, you can action simple cases automatically and escalate edge cases to a human reviewer. You can use a tool like [n8n](https://n8n.io/) to build these workflows with no-code blocks.

### Mux Data

If high risk content is ending up in a page where you control the player, you can integrate [Mux Data](/docs/guides/data) to get a lot of visibility into viewing sessions and track engagement (including the unwanted kind).

Aggregating these Views will help you gain insights into the types of platforms & devices being used to stream your content.

If you're using Mux Data's Media tier, you can also take advantage of two additional features:

* Once Views are appearing in your Dashboard, you can set up [alerting](/docs/guides/setup-alerts) based on concurrent viewership. These alerts can be tuned and filtered, so you only get notifications for platforms or users you're interested in. Even more, you can create your own [custom dimensions](/docs/guides/extend-data-with-custom-metadata) to supplement the built-in metrics.
* And if you need to analyze your data outside of the Mux Dashboard, you can export it via [CSV files](/docs/guides/export-raw-video-view-data#call-the-export-api-to-get-daily-aggregated-data) or [Streaming Exports](/docs/guides/export-raw-video-view-data#stream-views-as-they-complete).

One thing worth noting: the High Delivery Webhook's "delivery rate" is different than the "Views" tracked by Mux Data. Both can be used for telemetry, but they are looking at [different parts of the video pipeline](/docs/guides/mux-data-faqs#is-mux-video-delivery-usage-api-similar-to-watch-time-in-mux-data).

## Operational strategies

## Content Policy

One simple way to address issues with user-provided content is to make sure your content policies are clear. These rules can be in your Terms of Service, Acceptable Use Policy, Community Guidelines, or a separate content policy.

Consider covering the following common topics (you're even welcome to copy this and make it your own):

* You represent and warrant that:
  * You will provide and maintain accurate account information.
  * You will ensure that you have the necessary licenses, rights, and permissions to upload your content and host it on our service (including any rights to third-party music, images, or footage included in your content).
  * You won't use our service for unlawful purposes or in any way that would violate applicable laws, rules, and regulations.
  * You won't upload any content that infringes on anyone's copyright, trademark, or other intellectual property rights.
* You won't upload any content that is:
  * false or misleading, including content that constitutes impersonation or defamation
  * violent, harmful, illegal, or dangerous, including content harmful to children
  * hateful, abusive, offensive, racist, sexist, or otherwise inappropriate
  * graphic, sexually explicit, or mature in nature
  * You agree not to use our service in a way that could create an undue burden or impact service to other users.
  * You agree not to circumvent any security or moderation features of our service.
  * If we find any violations of applicable law, our legal terms, or our policies, you acknowledge that we may take action at our discretion, including removing content and restricting or terminating your account.

You can also share details of how you'll enforce the policy, such as a strikes-based system.

For some examples of artful content policies, check out [Patreon](https://www.patreon.com/policy/guidelines), [Strava](https://www.strava.com/community-standards), and [Crowdcast](https://www.crowdcast.io/community-guidelines). If you have a legal advisor, make sure to discuss any obligations that may apply to your company (e.g., under [DMCA](https://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act)) and include coverage of those.

### Contact Mechanisms

While your platform will need its own active measures for content moderation, you can also incorporate third-party reporting into your approach. At minimum, you should have an email address specifically for complaints, such as `copyright@yourdomain.com` or `abuse@yourdomain.com`, but you can also build a simple intake form that will create a support ticket in your system. Make sure incoming messages will be routed to someone with training on how to handle them appropriately. Evaluate whether your contact info should be listed in the US [DMCA Agent Directory](https://www.copyright.gov/dmca-directory/).

You can also implement in-product reporting capabilities that allow other users to report a video that may violate your content policies.

This is another good place to consult your legal advisor, as some copyright safe harbor laws include specific requirements around contact details and response turnaround times to keep yourself free from liability.

### User Signup Flow

When users sign up for an account on your platform, you likely collect a short list of details (e.g., email) while keeping things as simple/frictionless as possible. If your platform is seeing patterns of abuse, consider altering this flow to disincentivize signups/posting by bad actors:

* Collect additional personal information (e.g., full name) to increase the sense of accountability
* Send a verification link to their email to verify its authenticity before allowing users to post videos
* Add a buffer of time before new users can post videos or start a live stream
* Add a viewership limit to videos posted by users who have joined within the last day
* If your service is paid but includes a free trial, require entry of payment info before the free trial begins


# Synchronize video playback

Synchronize live stream playback across viewers and with other components on your page. Use this guide to build watch parties, live chats, or fitness stats that stay in time with the video.

## Introduction to video playback synchronization

You may have encountered many video streaming products and services enabling the following experiences:

* Plan a watch party where each viewer is watching the video at the exact moment at the same time.
  And when one viewer pauses the video, the video playback pauses for every viewer at the same time at the exact moment.
* Synchronize video playback with other components like chats, activity feeds, fitness stats collection, etc.

You can build similar and possibly many more interactive experiences like those mentioned above by aligning your web page
or application components using a common source of truth, i.e., [epoch time](https://en.wikipedia.org/wiki/Unix_time).
The underlying assumption to achieve synchronization is that your viewer's device remains synced to an NTP server.

Mux records the epoch time of each frame received for the live stream and includes that timing information in
the HLS Manifest as [`EXT-X-PROGRAM-DATE-TIME` (aka PDT) tag](https://datatracker.ietf.org/doc/html/rfc8216#section-4.3.2.6).
The PDT tag value is represented in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
This tag is added every few seconds with monotonically increasing epoch time representing the next frame's recorded epoch time.

Below is an example of the HLS rendition (2nd level) manifest with repeating PDT tags for every 2s of the
live stream recorded:

```text
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:2
#EXT-X-MAP:URI="https://chunk-gce-us-east1-production.cfcdn.mux.com/v1/chunk/3aJUOua6jsMHYybcqXRBpcXH82aCYXTu02TPTKHzIokndAPmz300ZThlCZbeNAy1t73003iytFZNJdjcvjTsOrCVTaGZgQ9J00uU/18446744073709551615.m4s?skid=default&signature=NjBmMjFkODBfYWVhMjIyZTdmMDU0ZmI0YWU2ZWJkZTJiYTY4MzhmYWQzNWQ2YzMyMTVlYjdjNmM0NzZiZjBmZGU0ODU1MTUyNQ=="
#EXT-X-PLAYLIST-TYPE:VOD

#EXT-X-PROGRAM-DATE-TIME:2021-06-28T17:53:25.533+00:00
#EXTINF:2,
https://chunk-gce-us-east1-production.cfcdn.mux.com/v1/chunk/3aJUOua6jsMHYybcqXRBpcXH82aCYXTu02TPTKHzIokndAPmz300ZThlCZbeNAy1t73003iytFZNJdjcvjTsOrCVTaGZgQ9J00uU/0.m4s?skid=default&signature=NjBmMjFkODBfOWJkMzMyMTc5YzgwY2VmMTdlYzIwODgzZGI2NWFiMThiM2U1NDM0NzM0NDZhMmQwOThhZmI0NDQ5OWY5N2VmMA==

#EXT-X-PROGRAM-DATE-TIME:2021-06-28T17:53:27.533+00:00
#EXTINF:2,
https://chunk-gce-us-east1-production.cfcdn.mux.com/v1/chunk/3aJUOua6jsMHYybcqXRBpcXH82aCYXTu02TPTKHzIokndAPmz300ZThlCZbeNAy1t73003iytFZNJdjcvjTsOrCVTaGZgQ9J00uU/1.m4s?skid=default&signature=NjBmMjFkODBfMjA1ZWNmYzgzYWRhMzNjMTY5YmEyYmM2NzE4MDk5N2I1MWE3NzhjODlhNGIzNWI3NGIwNTA5ZTIxOWQyNjI5OQ==

#EXT-X-PROGRAM-DATE-TIME:2021-06-28T17:53:29.533+00:00
#EXTINF:2,
https://chunk-gce-us-east1-production.cfcdn.mux.com/v1/chunk/3aJUOua6jsMHYybcqXRBpcXH82aCYXTu02TPTKHzIokndAPmz300ZThlCZbeNAy1t73003iytFZNJdjcvjTsOrCVTaGZgQ9J00uU/2.m4s?skid=default&signature=NjBmMjFkODBfZTIyOTA5YWFjZjMzYTY4MzQ4YWEzZDBiNDkyODk1NTg2ODE2M2YwZjI3NmY2MTVhOTM5MTA2MzQ4ODIyNTNkOQ==

#EXT-X-PROGRAM-DATE-TIME:2021-06-28T17:53:31.533+00:00
#EXTINF:2,
https://chunk-gce-us-east1-production.cfcdn.mux.com/v1/chunk/3aJUOua6jsMHYybcqXRBpcXH82aCYXTu02TPTKHzIokndAPmz300ZThlCZbeNAy1t73003iytFZNJdjcvjTsOrCVTaGZgQ9J00uU/3.m4s?skid=default&signature=NjBmMjFkODBfNDRkZTNhYTE5M2RhYTA4MTA4MWFkODc0YzgyMDcyMGMwODFmZWIxOGRiNWM4YzJhMTM0YTNiNGRhYmYyMWE1Nw==

#EXT-X-ENDLIST
```

## How to get epoch time value

Every modern video player exposes an API to get `EXT-X-PROGRAM-DATE-TIME` tag value.
Your application can synchronize video playback to other components using this epoch time.
An example demonstrating how to implement synchronization:

* Watch this Demuxed 2018 presentation by Seth Maddison on
  [How to Synchronize your Watches: Cross-platform stream synchronization of HLS and DASH](https://youtu.be/lSe4hcKRlYk)

## Supported Video Players

The list below shows the various video players providing API to get `EXT-X-PROGRAM-DATE-TIME` tag value.
If your player isn't listed here, [please reach out](/support).

* [Mux Player for Web](/docs/guides/player-advanced-usage#synchronize-video-playback) (maintenance mode)
* [hls.js](https://hls-js-dev.netlify.app/api-docs/)
* [JW Player](https://docs.jwplayer.com/players/reference/seek-events#ontime)
* [THEOplayer](https://docs.theoplayer.com/knowledge-base/03-playback/04-program-date-time.md)
* [Bitmovin](https://cdn.bitmovin.com/player/web/8/docs/interfaces/core_events.segmentplaybackevent.html#datetime)
* [React Native](https://github.com/react-native-video/react-native-video#currentplaybacktime)
* [Apple AVPlayer](https://developer.apple.com/documentation/avfoundation/avplayeritem/1386188-currentdate)
* [Android ExoPlayer](https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/hls/playlist/HlsMediaPlaylist.html#hasProgramDateTime)

If your application wants to synchronize viewers playing videos on different devices, your application can
subscribe to communication channels for receiving and sending epoch time values. Many cloud-based or other
commercial products developed using WebSockets are available for implementing such a communication channel.

## Add `exclude_pdt` parameter

By default, HLS playback using `stream.mux.com/{PLAYBACK_ID}.m3u8` URL always adds `EXT-X-PROGRAM-DATE-TIME` tag with
recorded epoch time value. If you add the `exclude_pdt=true` parameter to the playback URL, then Mux will exclude this tag
from the HLS rendition manifest.

There are few reasons to exclude the HLS tag:

* Video Player, like React Native, updates the current play position time value with the `EXT-X-PROGRAM-DATE-TIME` tag value.
  So if your application expects a zero-based play position time, the viewer could experience playback issues when the video
  player starts reporting epoch time instead.
* Your application is using a legacy video player or a player version without support for this HLS tag.

## Using signed URLs

Mux videos have two types of playback policy, `public` or `signed`. If your `playback_id` is `signed`,
then all query parameters, including `exclude_pdt` need to be added to the claims body.

Take a look at the [signed URLs guide](/docs/guides/secure-video-playback) for details.

## FAQs

### Is the epoch time available with on-demand video?

Yes. Mux records epoch time for all live streams. So, the HLS manifest includes the epoch time every few seconds
with the `EXT-X-PROGRAM-DATE-TIME` tag value when the live stream is active, or for the on-demand playback of the
live stream recording.

The epoch time is not available in the HLS manifest when the input is a video file.

### Can I retrieve the epoch time through the API?

Yes. The <ApiRefLink href="/docs/api-reference/video/assets">asset resource object</ApiRefLink> includes
`recording_times` which represents the live stream start epoch time and the duration recorded.
You can store the live stream timing information using the`recording_times`
for managing the live stream's status information.


# Use videos in your website design

Add background videos and hero videos to your website with Mux. Use this guide when you build a marketing page or a landing page that needs decorative video.

# Use videos in your website design

Video has a wide range of uses, but when you're building a marketing page there are two very common choices: Background videos and Hero videos.

This guide covers the best way to add both types of video to your website.

## Two types of video

### What are background videos?

<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10/media/mux-background-video.js" />

<div style={{ position: 'relative', width: '100%' }}>
  <mux-background-video src="https://stream.mux.com/kF01v9aKFlY63i2GkQKQGDv5Y9PbMGdtQD92j5qJCYWU.m3u8" style={{ width: '100%', height: 'auto', display: 'block' }}>
    <img src="https://image.mux.com/kF01v9aKFlY63i2GkQKQGDv5Y9PbMGdtQD92j5qJCYWU/thumbnail.webp?time=0" alt="Background video example" style={{ width: '100%', height: 'auto', display: 'block' }} />
  </mux-background-video>

  <div
    style={{
  position: 'absolute',
  top: 0,
  left: 0,
  right: 0,
  bottom: 0,
  display: 'flex',
  alignItems: 'center',
  justifyContent: 'center',
  padding: '20px'
}}
  >
    <div
      style={{
    backgroundColor: 'rgba(0, 0, 0, 0.6)',
    padding: '16px',
    borderRadius: '8px',
    backdropFilter: 'blur(4px)',
    color: 'white',
    maxWidth: "400px",
  }}
    >
      <p style={{ margin: '0 0 12px 0', fontSize: '14px' }}>Short, looping clips that autoplay silently, such as hero banners, product previews, or ambient visuals.</p>

      <ul style={{ margin: 0, paddingLeft: '20px', listStyleType: 'disc', fontSize: '14px' }}>
        <li>Short (often 5-60 seconds long)</li>
        <li>Muted</li>
        <li>Loop continuously</li>
        <li>Autoplay on page load</li>
      </ul>
    </div>
  </div>
</div>

### What are hero videos?

Informational videos such as product demos, explainers, customer testimonials, and promotional content. These have sound, playback controls, and can be any length.

* Any length
* User-controlled (play, pause, seek)
* Sound enabled

#### Hero Video example

<iframe src="https://player.mux.com/lSHERjOdEb4T01F5JzfX01qGPrITp6i01hvqYGdhpvHcyM" style={{ "width": "100%", "border": "none", "aspect-ratio": "16/9" }} allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowFullScreen />

***

## Background video

The recommended way to add background videos to your website is with the **Video.js background video component**: the `<mux-background-video>` custom element for HTML, or `MuxBackgroundVideo` for React. It streams a Mux HLS URL and is built for decorative video:

* **Always muted, looping and autoplaying**: no controls, audio or captions to configure
* **Right-sized**: picks the largest rendition that fits the viewer's screen
* **Lightweight**: a small HLS engine built for background playback only

### 1. Add the Background Component to Your Page

Add the following to your page. This example uses a sample video. You'll replace the playback ID with your own in the next step.

```html

<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10/media/mux-background-video.js"></script>

<style>
  .hero {
    position: relative;
    min-height: 480px;
  }

  .hero-media {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .hero-media img,
  .hero-media mux-background-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    --media-object-fit: cover;
  }

  .hero-content {
    position: relative;
  }
</style>

<section class="hero">
  <div class="hero-media" aria-hidden="true">
    <img src="https://image.mux.com/{PLAYBACK_ID}/thumbnail.webp?time=0" alt="" />
    <mux-background-video
      src="https://stream.mux.com/{PLAYBACK_ID}.m3u8"
      crossorigin="anonymous"
    ></mux-background-video>
  </div>
  <div class="hero-content">
    <h1>Your headline</h1>
  </div>
</section>

```

```jsx react

// npm install @videojs/react @videojs/spf
import { MuxBackgroundVideo } from '@videojs/react/media/mux-background-video';

const fill = {
  position: 'absolute',
  inset: 0,
  width: '100%',
  height: '100%',
  objectFit: 'cover',
};

export default function Hero() {
  return (
    <section style={{ position: 'relative', minHeight: 480 }}>
      <div aria-hidden="true" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
        <img src="https://image.mux.com/{PLAYBACK_ID}/thumbnail.webp?time=0" alt="" style={fill} />
        <MuxBackgroundVideo
          src="https://stream.mux.com/{PLAYBACK_ID}.m3u8"
          crossOrigin="anonymous"
          style={fill}
        />
      </div>
      <div style={{ position: 'relative' }}>
        <h1>Your headline</h1>
      </div>
    </section>
  );
}

```



The `<img>` behind the video acts as a poster while the video loads. The wrapper has `aria-hidden="true"` because both the poster and the video are decorative.

### 2. Upload Your Video and Replace the Playback ID

To use your own video:

1. Go to **Assets** in the Mux Dashboard and click **Upload**
2. Select your video file
3. For video quality, select **Basic** (recommended for background videos)
4. Click **Upload**

Once the upload is complete, copy your **Playback ID** from the asset details page and replace `{PLAYBACK_ID}` in your code.

<Callout type="info">
  The background video component requires [Basic](/docs/guides/use-video-quality-levels#basic) or [Premium](/docs/guides/use-video-quality-levels#premium) video quality.
</Callout>

### 3. Set Maximum Resolution

Limit the resolution to match your layout and save bandwidth. Add a `max_resolution` parameter to the stream URL:

```html
<mux-background-video
  src="https://stream.mux.com/{PLAYBACK_ID}.m3u8?max_resolution=720p"
  crossorigin="anonymous"
></mux-background-video>
```

In React, pass the same URL to the `src` prop of `MuxBackgroundVideo`.

### 4. Let Viewers Stop the Motion

Give viewers a button to stop the background video, and don't play it when their browser asks for reduced motion. To pause it, call `pause()` on the native video inside it: the element's `target` property in HTML, or `ref` in React. See [Let viewers stop the motion](/docs/guides/mux-background-video#let-viewers-stop-the-motion) for an HTML and React example.

For Mux Data, migration from `@mux/mux-background-video` and the rest of the API, see [Add a background video](/docs/guides/mux-background-video).

***

## Alternative: Static MP4 Files

You can also serve background videos as static MP4 files instead of using HLS streaming. Each approach has its own strengths.

**Why choose MP4:**

* No JavaScript required—just a `<video>` tag
* Works on legacy devices and browsers
* Better for very short clips (under 10 seconds)
* Downloaded once and cached by the browser

**Why choose HLS (Video.js background video):**

* Picks a rendition that fits the viewer's screen, instead of one file for every device
* No extra storage cost for static renditions
* Videos are ready to play sooner after upload

MP4 files have a small additional cost for storage. See [video pricing](/docs/pricing/overview#static-rendition-mp4s-storage) for details.

### Enable Static Renditions

To use MP4 files, enable static renditions when creating your asset. You can do this in both the Mux Dashboard and via the API by including the `static_renditions` property:

```json
{
  "playback_policies": ["public"],
  "video_quality": "basic",
  "static_renditions": [{ "resolution": "highest" }]
}
```

**In the Mux Dashboard:** Click **Advanced** when uploading to reveal the JSON editor, then add the `static_renditions` property shown above.

**Via the API:** Include the `static_renditions` property in your [asset creation request](/api/reference/video#operation/create-asset).

### Embed the Video

```html
<video
  src="https://stream.mux.com/{PLAYBACK_ID}/highest.mp4"
  poster="https://image.mux.com/{PLAYBACK_ID}/thumbnail.jpg"
  autoplay
  loop
  muted
  playsinline
></video>
```

The key attributes:

* `autoplay` — Start immediately
* `muted` — Required for autoplay to work in browsers
* `loop` — Replay continuously
* `playsinline` — Prevent fullscreen on mobile

For more details on static renditions, see [Use static MP4 and M4A renditions](/docs/guides/enable-static-mp4-renditions).

***

## Hero Videos

For product demos, explainers, testimonials, and promotional content, you need a different approach than background videos. These videos are typically longer, users actively watch them, and they need playback controls (play, pause, seek, volume).

The **Mux iframe embed** (`player.mux.com`) is built for this use case. You paste one `<iframe>` into your page, with no JavaScript to install, and get adaptive quality that adjusts to network conditions, full playback controls, and custom branding.

If you'd rather build the player into your own code, for example to customize the UI or control playback from your app, use [Video.js](/docs/guides/playback-videojs-with-mux) instead. Don't install the Mux Player packages (`@mux/mux-player` or `@mux/mux-player-react`) for new projects: Mux Player for Web is in maintenance mode.

## The iframe embed

* **Adaptive streaming** — Quality adjusts automatically to network conditions
* **Full controls** — Play, pause, seek, volume, fullscreen
* **Custom branding** — Match your website's colors
* **Captions** — Built-in support for accessibility
* **Works everywhere** — Responsive and mobile-friendly

## Implementation

### 1. Upload Your Video

In the Mux Dashboard:

1. Go to **Assets** and click **Upload**
2. Select your video file
3. For video quality, select **Basic** (recommended for website videos)
4. Optionally enable **Auto-generated captions** to automatically generate captions from your video's audio for improved accessibility
5. Click **Upload**

Once the upload is complete, copy your **Playback ID** from the asset details page.

### 2. Embed the Player

Add an iframe to your page. You can also copy this code directly from the **Playback and Thumbnails** tab on the asset details page in the Dashboard. See [Embed videos with an iframe](/docs/guides/player-mux-com) for the parameters you can add to the URL, and [Embed parameters](/docs/guides/player-mux-com-reference) for every parameter.

```html
<iframe
  src="https://player.mux.com/{PLAYBACK_ID}"
  style="aspect-ratio: 16/9; width: 100%;"
  allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
  allowfullscreen="true"
></iframe>
```

You now have a fully functional video player that looks like this.

<iframe src="https://player.mux.com/lSHERjOdEb4T01F5JzfX01qGPrITp6i01hvqYGdhpvHcyM" style={{"width": "100%", "border": "none", "aspect-ratio": "16/9"}} allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen />

## Customization

You can customize the player by adding parameters to the URL.

### Brand Colors

You can set `accent-color` to match your brand. This colors the play button, progress bar, and controls:

```html
<iframe
  src="https://player.mux.com/{PLAYBACK_ID}?accent-color=%235D3FD3"
  style="aspect-ratio: 16/9; width: 100%;"
  allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
  allowfullscreen="true"
></iframe>
```

### Thumbnail

Mux automatically generates a thumbnail from your video. You can also pick the time of the frame with `poster-time`, or point `poster` at your own image URL.

```html
<!-- Default thumbnail -->
src="https://player.mux.com/{PLAYBACK_ID}"

<!-- Thumbnail at 10 seconds -->
src="https://player.mux.com/{PLAYBACK_ID}?poster-time=10"
```

See [Get images from a video](/docs/guides/get-images-from-a-video) for more thumbnail options.

### Sizing

Control the player size with CSS:

```html
<iframe
  src="https://player.mux.com/{PLAYBACK_ID}"
  style="aspect-ratio: 16/9; width: 100%; max-width: 800px;"
  allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
  allowfullscreen="true"
></iframe>
```

## Captions

If you enabled auto-generated captions during upload, the player automatically shows the captions button once they're ready. No additional configuration needed.

Mux supports auto-generated captions in English, French, German, Italian, Portuguese, Spanish, and many other languages.

See [Add subtitles to your videos](/docs/guides/add-subtitles-to-your-videos) for more details.

## FAQ

### How do I make sure my videos are cached properly

For looping videos, the browser will cache the video and not re-request it on each loop. With short videos, caching typically happens quickly—once the video is fully downloaded, subsequent loops play from cache.

**How to verify:**
Open DevTools, watch the Network tab, and let a video loop a few times. Cached requests may not show up at all, or they may indicate that they were "(from cache)" or "(from disk cache)".
