Getting Started
Copiar un prompt de configuración con los pasos de instalación y la guía de markdown completa para este plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-mux-player`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/mux-player/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Instalar
Sección titulada “Instalar”Puedes utilizar nuestra configuración asistida por inteligencia artificial para instalar el complemento. Agrega las Capgo habilidades a tu herramienta de inteligencia artificial utilizando el siguiente comando:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsLuego utiliza el siguiente prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-mux-player` plugin in my project.Si prefieres la configuración manual, instala el complemento ejecutando los siguientes comandos y sigue las instrucciones específicas del plataforma a continuación:
bun add @capgo/capacitor-mux-playerbunx cap syncImportar
Sección titulada “Importar”import { MuxPlayer } from '@capgo/capacitor-mux-player';API Resumen
Sección titulada “API Resumen”Lanzar el jugador nativo Mux en pantalla completa y comenzar la reproducción.
import { MuxPlayer } from '@capgo/capacitor-mux-player';
await MuxPlayer.play({} as MuxPlayOptions);dismiss
Sección titulada “dismiss”Despedir al jugador si está visible.
import { MuxPlayer } from '@capgo/capacitor-mux-player';
await MuxPlayer.dismiss();isActive
Sección titulada “isActive”Indica si el jugador está siendo actualmente mostrado.
import { MuxPlayer } from '@capgo/capacitor-mux-player';
await MuxPlayer.isActive();Referencia de tipo
Sección titulada “Referencia de tipo”MuxPlayOptions
Sección titulada “Opciones de MuxPlay”export interface MuxPlayOptions { /** * The playback ID of the asset you want to stream. */ playbackId: string; /** * Provide a JSON web token generated for signed playback policies. */ playbackToken?: string; /** * Provide a JSON web token generated for DRM playback policies. */ drmToken?: string; /** * Override the default Mux playback domain (e.g. `stream.example.com`). */ customDomain?: string; /** * Auto-play when the player becomes visible. Defaults to true. */ autoPlay?: boolean; /** * Start playback from the provided time (in seconds). */ startTime?: number; /** * Provide a poster image URL to display before playback begins. */ poster?: string; /** * Provide a custom title to surface in native player chrome when available. */ title?: string; /** * Provide a subtitle or description to surface in native player chrome when available. */ subtitle?: string; /** * Set to true to keep the video muted when playback starts. */ muted?: boolean; /** * Mux Data environment key used for analytics. If omitted, the SDK default is used. */ environmentKey?: string; /** * Provide an explicit player name for analytics. Defaults to a generated name. */ playerName?: string; /** * Enable smart caching when the underlying SDK supports it. */ enableSmartCache?: boolean; /** * Enable verbose logging in native SDKs where available. */ debug?: boolean;}MuxPlayerEvents
Sección titulada “Eventos de MuxPlayer”export interface MuxPlayerEvents { /** * Fired when the underlying player is ready to begin playback. */ ready: { playerName?: string }; /** * Fired when playback starts or resumes. */ play: void; /** * Fired when playback pauses. */ pause: void; /** * Fired when playback ends. */ ended: void; /** * Fired when an unrecoverable error occurs. */ error: { message: string }; /** * Fired when the fullscreen player is closed. */ playerDismissed: void;
/** * Get the native Capacitor plugin version * * @returns {Promise<{ id: string }>} an Promise with version for this device * @throws An error if the something went wrong */ getPluginVersion(): Promise<{ version: string }>;}Fuente de verdad
Sección titulada “Fuente de verdad”Esta página se genera a partir del plugin’s src/definitions.tsRe-ejecutar la sincronización cuando el público API cambie en la fuente.
Sigue adelante desde Inicio
Sección titulada “Sigue adelante desde Inicio”Si estás utilizando Inicio para planificar la consola de dashboard y operaciones API, conecta con Usando @capgo/capacitor-mux-player para la capacidad nativa en Usando @capgo/capacitor-mux-player, API Resumen para el detalle de implementación en API Resumen, Introducción para el detalle de implementación en Introducción, API Claves para los detalles de implementación en las API Claves, y Dispositivos para los detalles de implementación en Dispositivos.