@capgo/capacitor-mux-player

June 16, 2026 · View on GitHub

Capgo - Instant updates for Capacitor

➡️ Get Instant updates for your App with Capgo

Missing a feature? We’ll build the plugin for you 💪

Naitve Mux Player SDK to play video on IOS and Android

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/mux-player/

Compatibility

Plugin versionCapacitor compatibilityMaintained
v8.*.*v8.*.*
v7.*.*v7.*.*On demand
v6.*.*v6.*.*
v5.*.*v5.*.*

Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.

Install

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-mux-player` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

npm install @capgo/capacitor-mux-player
npx cap sync

iOS setup

  • Requires iOS 15 or newer.
  • Add the Swift package https://github.com/muxinc/mux-player-swift to your Xcode workspace so that the MuxPlayerSwift module is available at build time.
  • If you manage native dependencies through CocoaPods, prefer integrating this plugin via Swift Package Manager or add the Mux package manually to your app target.

Android setup

  • Gradle pulls the player from the Mux artifactory (https://muxinc.jfrog.io/artifactory/default-maven-release-local). Ensure your corporate proxy allows downloads from that host.
  • npx cap sync android adds the Mux Maven repository to android/build.gradle automatically. If Capacitor lifecycle hooks are disabled in your project, add that repository manually to the root Gradle configuration (android/build.gradle).
  • The plugin uses Kotlin 2.2.20 and resolves Media3 transitively through the Mux artifact.
  • Android apps targeting SDK 33 or newer will also see android.permission.POST_NOTIFICATIONS merged from this library. The plugin does not request notifications at runtime; the manifest entry prevents Android lint failures caused by Mux's Glide NotificationTarget dependency. If your app does not need that permission, remove it from your app manifest with:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission
        android:name="android.permission.POST_NOTIFICATIONS"
        tools:node="remove" />
</manifest>

Web setup

  • The plugin bundles @mux/mux-player and renders the video in a fullscreen overlay. The player automatically injects a close affordance for desktop and mobile browsers.

API

play(...)

play(options: MuxPlayOptions) => Promise<void>

Launch the native Mux Player in fullscreen and begin playback.

ParamType
optionsMuxPlayOptions

dismiss()

dismiss() => Promise<void>

Dismiss the player if it is visible.


isActive()

isActive() => Promise<{ active: boolean; }>

Returns whether the player is currently being displayed.

Returns: Promise<{ active: boolean; }>


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all event listeners registered on the plugin instance.


addListener(E, ...)

addListener<E extends keyof MuxPlayerEvents>(eventName: E, listenerFunc: (event: MuxPlayerEvents[E]) => void) => Promise<PluginListenerHandle>

Listen to player lifecycle or playback events emitted by the plugin.

ParamType
eventNameE
listenerFunc(event: MuxPlayerEvents[E]) => void

Returns: Promise<PluginListenerHandle>


Interfaces

MuxPlayOptions

PropTypeDescription
playbackIdstringThe playback ID of the asset you want to stream.
playbackTokenstringProvide a JSON web token generated for signed playback policies.
drmTokenstringProvide a JSON web token generated for DRM playback policies.
customDomainstringOverride the default Mux playback domain (e.g. stream.example.com).
autoPlaybooleanAuto-play when the player becomes visible. Defaults to true.
startTimenumberStart playback from the provided time (in seconds).
posterstringProvide a poster image URL to display before playback begins.
titlestringProvide a custom title to surface in native player chrome when available.
subtitlestringProvide a subtitle or description to surface in native player chrome when available.
mutedbooleanSet to true to keep the video muted when playback starts.
environmentKeystringMux Data environment key used for analytics. If omitted, the SDK default is used.
playerNamestringProvide an explicit player name for analytics. Defaults to a generated name.
enableSmartCachebooleanEnable smart caching when the underlying SDK supports it.
debugbooleanEnable verbose logging in native SDKs where available.

PluginListenerHandle

PropType
remove() => Promise<void>

MuxPlayerEvents

PropTypeDescription
ready{ playerName?: string; }Fired when the underlying player is ready to begin playback.
playvoidFired when playback starts or resumes.
pausevoidFired when playback pauses.
endedvoidFired when playback ends.
error{ message: string; }Fired when an unrecoverable error occurs.
playerDismissedvoidFired when the fullscreen player is closed.
MethodSignatureDescription
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version