내용으로 건너뛰기

Getting Started

GitHub

설치

설치

AI 도움을 받아 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요.

터미널 창
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

그런 다음 다음 명령어를 사용하세요.

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

만약 Manual Setup을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요.

터미널 창
bun add @capgo/capacitor-mux-player
bunx cap sync
import { MuxPlayer } from '@capgo/capacitor-mux-player';

fullscreen 모드에서 네이티브 Mux Player를 시작하고 재생을 시작합니다.

import { MuxPlayer } from '@capgo/capacitor-mux-player';
await MuxPlayer.play({} as MuxPlayOptions);

시각적으로 표시되는 경우 플레이어를 닫습니다.

import { MuxPlayer } from '@capgo/capacitor-mux-player';
await MuxPlayer.dismiss();

현재 표시 중인 플레이어 여부를 반환합니다.

import { MuxPlayer } from '@capgo/capacitor-mux-player';
await MuxPlayer.isActive();
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

MuxPlayerEvents 섹션
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 }>;
}

실질적인 출처

실질적인 출처 섹션

이 페이지는 플러그인의 src/definitions.tsAPI이 업스트림에서 변경될 때 다시 싱크를 실행하세요.

Getting Started에서 계속하기

Getting Started에서 계속하기 섹션

__CAPGO_KEEP_0__를 사용하는 경우 Getting Started API와 대시보드 계획을 위해 연결하세요. @capgo/capacitor-mux-player를 사용합니다. native 기능을 위한 @capgo/capacitor-mux-player 사용을 위해 API 개요 native 기능을 위한 API 개요 구현에 대해 __CAPGO_KEEP_0__ 소개 native 기능을 위한 __CAPGO_KEEP_0__ 소개 구현에 대해 API 키 native 기능을 위한 API 키 구현에 대해, 및 __CAPGO_KEEP_0__ 장치 native 기능을 위한 장치 구현에 대해.