View every query parameter that the player.mux.com iframe embed accepts, what it does in Video.js, the deprecated parameters and their replacements, and the player.js, oEmbed, and Mux Data details.
player.mux.com is a video player page that Mux hosts for every playback ID. Embed it with an <iframe> and configure it with query parameters; there is nothing to install. It plays with Video.js. Add ?player=mux-player to keep an embed on Mux Player.
<div style="position: relative; padding-top: 56.25%;">
<iframe
src="https://player.mux.com/{PLAYBACK_ID}?accent-color=%23fa50b5&metadata-video-id=video-123"
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
allowfullscreen="true"
></iframe>
</div>encodeURIComponent().?muted or ?muted=true) and off when left out or set to false.?Muted=true is an unknown parameter, not muted). Values that fail validation and parameters not listed here (such as utm_source, or a Mux Player parameter player.mux.com does not support) are ignored.Signed playback, custom domains, resolution limits and instant clips. These shape the stream URL and the requests the player makes. For a signed playback ID, the stream URL carries only the playback token: set resolution limits and clip times in the token instead.
| Parameter | Type | Default | Description | Example |
|---|---|---|---|---|
playback-token | string | Signed token for a signed playback ID. Video.js: stream URL token. | ?playback-token=PLAYBACK_TOKEN | |
thumbnail-token | string | Signed token for poster images of a signed playback ID. Video.js: poster image URL token. | ?thumbnail-token=THUMBNAIL_TOKEN | |
storyboard-token | string | Signed token for timeline hover previews of a signed playback ID. Video.js: timeline hover preview requests. | ?storyboard-token=STORYBOARD_TOKEN | |
drm-token | string | Signed token for DRM-protected playback. Video.js: DRM license requests. | ?drm-token=DRM_TOKEN | |
max-resolution | 270p, 360p, 480p, 540p, 720p, 1080p, 1440p, 2160p | Highest resolution Mux delivers, for example to lower delivery cost; ignored with playback-token, where it belongs in the token. Video.js: stream URL max_resolution. | ?max-resolution=720p | |
min-resolution | 270p, 360p, 480p, 540p, 720p, 1080p, 1440p, 2160p | Lowest resolution Mux delivers; ignored with playback-token, where it belongs in the token. Video.js: stream URL min_resolution. | ?min-resolution=480p | |
asset-start-time | number (seconds) | Plays a clip of the video that starts this many seconds into the asset; ignored with playback-token, where it belongs in the token. Video.js: stream and timeline hover preview URLs asset_start_time; default poster time. | ?asset-start-time=10 | |
asset-end-time | number (seconds) | Plays a clip of the video that ends this many seconds into the asset; ignored with playback-token, where it belongs in the token. Video.js: stream and timeline hover preview URLs asset_end_time. | ?asset-end-time=20 | |
custom-domain | hostname | mux.com | Your custom domain for streaming and images. Video.js: stream and image hosts (stream. and image. prefixes). | ?custom-domain=media.example.com |
How the player starts and plays.
| Parameter | Type | Default | Description | Example |
|---|---|---|---|---|
autoplay | boolean | off | Starts playback as soon as the browser allows it; add muted so browsers permit it. Video.js: autoplay on the media element. | ?autoplay=true |
preload | "", none, metadata, auto | browser default | How much of the video to load before the viewer presses play. Video.js: preload on the media element (an empty value means auto). | ?preload=none |
loop | boolean | off | Restarts the video when it ends. Video.js: loop on the media element. | ?loop=true |
muted | boolean | off | Starts with the sound off. Video.js: muted on the media element. | ?muted=true |
playsinline | boolean | on | Plays inline on iOS instead of entering fullscreen. Video.js: playsinline on the media element, always set. | ?playsinline=true |
controls | boolean | on | Shows the player controls; controls=false hides them. Video.js: false renders the media without a skin: no controls and no keyboard shortcuts; start playback with autoplay or player.js. | ?controls=false |
start-time | number | 0 | Time in seconds where playback starts. Video.js: currentTime once metadata loads. | ?start-time=30 |
Colors and poster images. The page title is the title of the asset in Mux (meta.title), else Mux Video; on an asset with no title, metadata-video-title (deprecated as the page title) or the deprecated title or video-title still set it. A change to the title of an asset in Mux usually appears on player.mux.com within half an hour.
| Parameter | Type | Default | Description | Example |
|---|---|---|---|---|
accent-color | CSS color | Accent color of the player controls. Video.js: --media-accent-color on the skin. | ?accent-color=%23fa50b5 | |
poster | URL | Mux thumbnail | URL of the image shown before playback starts. Video.js: poster image. | ?poster=https%3A%2F%2Fexample.com%2Fposter.jpg |
poster-time | number | Time in seconds of the frame used for the default poster. Video.js: poster image URL time. Replaces thumbnail-time, which still works. | ?poster-time=10 |
Every embed reports views to Mux Data in the environment of the playback ID, with no setup. These parameters add metadata or change whether views are reported.
| Parameter | Type | Default | Description | Example |
|---|---|---|---|---|
metadata-* | string | A Mux Data metadata field, in kebab-case after metadata-. Only Mux Data's standard metadata fields are accepted; other names are ignored. Up to 50 keys; names up to 64 characters, values up to 1024. Video.js: Mux Data metadata, metadata-video-id becomes video_id; metadata-video-title becomes video_title, even when the asset has a title in Mux. | ?metadata-video-id=video-123 | |
disable-mux-data | boolean | off | Turns off Mux Data monitoring for this embed. Video.js: no <mux-data> element. Replaces disable-tracking, which still works. | ?disable-mux-data=true |
disable-cookies | boolean | off | Stops Mux Data from setting cookies. Video.js: Mux Data disableCookies. | ?disable-cookies=true |
player-init-time | number | page load time | Player initialization time as a Unix timestamp in milliseconds, for startup-time metrics. Video.js: Mux Data playerInitTime. | ?player-init-time=1700000000000 |
metadata-url | HTTPS URL | HTTPS URL of a JSON object of Mux Data metadata fields. Video.js: fetched by the viewer's browser, never by player.mux.com; its fields are added to the Mux Data metadata and override metadata-* (only Mux Data's standard metadata fields; others are ignored). | ?metadata-url=https%3A%2F%2Fexample.com%2Fmetadata.json |
player.mux.com plays every embed with Video.js. Add ?player=mux-player to serve Mux Player instead, with every Mux Player parameter; it stays available as long as Mux Player is published. Both players report to Mux Data with player_name = mux-player-iframe. Before the switch to Video.js, player.mux.com did not set player_name at all (it set only player_software_name = mux-player-iframe), so a dashboard filtered on player_name alone misses every earlier view; during the transition, filter on player_name = mux-player-iframe OR player_software_name = mux-player-iframe.
| Parameter | Type | Default | Description | Example |
|---|---|---|---|---|
player | mux-player, videojs | videojs | Which player serves the embed: videojs, or mux-player to keep Mux Player and every Mux Player parameter. | ?player=mux-player |
Use ?player=mux-player to keep an embed on Mux Player:
<div style="position: relative; padding-top: 56.25%;">
<iframe
src="https://player.mux.com/{PLAYBACK_ID}?player=mux-player"
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
allowfullscreen="true"
></iframe>
</div>The Video.js player supports Chrome and Edge 111 and later, Firefox 121 and later, and Safari 16.4 and later on Mac and iOS (Video.js browser support). Some videos play through Media Source Extensions, which iPhones have only in recent iOS versions. In older browsers the video may not play.
To support older browsers, install Video.js in your own page, where you control the build and can choose a compatibility setup, or contact Mux support.
These parameters and values still work on player.mux.com, but they may stop working in a future version. Switch to the replacement in the last column.
| Parameter | What it does | Use instead |
|---|---|---|
metadata-video-title as the page title | On an asset with no title in Mux, it also sets the page title, link previews and oEmbed title. | The asset title in Mux (meta.title) |
video-title | Video title reported to Mux Data as video_title. Video.js: the title (page <title>, social tags, JSON-LD, oEmbed and Mux Data video_title) when there is no asset title, metadata-video-title or title. | The asset title in Mux (meta.title) |
autoplay=muted | Video.js: autoplay plus muted. | autoplay=true&muted=true |
autoplay=any | Video.js: the same as autoplay=true. | autoplay=true |
disable-tracking | The same as disable-mux-data. | disable-mux-data |
primary-color | Color of icons and text in the controls. Video.js: --media-accent-color on the skin when accent-color is absent. | accent-color |
thumbnail-time | The same as poster-time. | poster-time |
title | Title of the video. Video.js: the title (page <title>, social tags, JSON-LD, oEmbed and Mux Data video_title) when there is no asset title or metadata-video-title. | The asset title in Mux (meta.title) |
Both players implement the player.js receiver, so you can control an embed from the parent page.
<iframe id="player" src="https://player.mux.com/{PLAYBACK_ID}" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen="true"></iframe>
<script defer src="https://cdn.jsdelivr.net/npm/player.js@0.1.0/dist/player-0.1.0.min.js"></script>
<script type="module">
const player = new playerjs.Player('player');
player.on('ready', () => {
player.on('timeupdate', ({ seconds, duration }) => console.log(seconds, duration));
player.setVolume(50);
player.setCurrentTime(30);
player.play();
});
</script>| Method | Description |
|---|---|
play() | Starts playback. |
pause() | Pauses playback. |
getPaused(callback) | Calls back with true when paused. |
setCurrentTime(seconds) | Seeks to a time in seconds. |
getCurrentTime(callback) | Calls back with the current time in seconds. |
getDuration(callback) | Calls back with the duration in seconds. |
setVolume(volume) | Sets the volume from 0 to 100. |
getVolume(callback) | Calls back with the volume from 0 to 100. |
mute() | Mutes the player. |
unmute() | Unmutes the player. |
getMuted(callback) | Calls back with true when muted. |
setLoop(loop) | Turns looping on or off. |
getLoop(callback) | Calls back with true when looping. |
| Event | Description |
|---|---|
ready | The player can receive commands. |
play | Playback started. |
pause | Playback paused. |
ended | Playback reached the end. |
timeupdate | The time changed; the data has seconds and duration. |
Every player page links to its oEmbed endpoint with <link rel="alternate" type="application/json+oembed">, so sites that support oEmbed turn a pasted player.mux.com link into an embed.
GET https://player.mux.com/api/oembed?url=https%3A%2F%2Fplayer.mux.com%2F{PLAYBACK_ID}| Parameter | Description |
|---|---|
url | Required. A player.mux.com URL of the form https://player.mux.com/{PLAYBACK_ID} or https://player.mux.com/watch/{PLAYBACK_ID}, with any player parameters in its query string. |
format | json (default). xml is not supported yet. |
maxwidth | Maximum width of the returned embed, in pixels. Default 640. |
maxheight | Maximum height of the returned embed, in pixels. Default 360. |
The response is a video oEmbed object whose html is the iframe embed, sized to fit maxwidth and maxheight, with the poster as its thumbnail. An audio-only asset, or one that does not exist, has no thumbnail unless poster sets one. Its title, like the page title, is the title of the asset in Mux, else metadata-video-title (deprecated as the page title), else the deprecated title or video-title, else Mux Video.
https://player.mux.com/watch/{PLAYBACK_ID} is a full-page player with a link-sharing footer, for sending a video to someone rather than embedding it. It takes the same parameters as the embed. Opening https://player.mux.com/{PLAYBACK_ID} directly in a browser tab shows the same page; inside an iframe that URL shows only the player. Views from the watch page report page_type watchpage to Mux Data.
Both players set these fields. Filter on player_name = mux-player-iframe to see every player.mux.com view, and use player_software_name to tell the two players apart. Views from before the switch to Video.js have no player_name; to include them, filter on player_name = mux-player-iframe OR player_software_name = mux-player-iframe.
| Field | Video.js | Mux Player | Override with |
|---|---|---|---|
player_software_name | videojs-html- plus the engine, for example videojs-html-hlsjs | mux-player-iframe | cannot be overridden |
player_software_version | Video.js version | Mux Player version | cannot be overridden |
player_name | mux-player-iframe | mux-player-iframe | metadata-player-name |
player_version | same as player_software_version | same as player_software_version | metadata-player-version |
page_type | iframe, or watchpage on the watch page | iframe, or watchpage on the watch page | metadata-page-type |
video_title | metadata-video-title, else the title of the asset in Mux, else the deprecated title, else the deprecated video-title | metadata-video-title, else the deprecated video-title, else the deprecated title, else the title of the asset in Mux | metadata-video-title |