__CAPGO_KEEP_2__

Getting Started

GitHub

AI-Assisted Setupを使用してプラグインをインストールできます。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';

native Mux プレーヤーをフルスクリーンで起動し、再生を開始します。

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;
}
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.tsパブリックAPIがアップストリームで変更されたときに再度Syncを実行してください。

Getting Startedから続けてください

Getting Startedセクション

あなたが Getting Started ダッシュボードとAPIの計画と実行を計画している場合、 @capgo/capacitor-mux-playerを接続してください Capacitor のネイティブ機能である @capgo/capacitor-mux-player の使用について API オーバービュー API の実装詳細について 導入 __CAPGO_KEEP_0__ キーの実装詳細について、 API Keys API の実装詳細について ページを編集 __CAPGO_KEEP_0__