メニューに進む

Getting Started

インストール

Install
ターミナル画面
bun add @capgo/capacitor-mux-player
bunx cap sync

インポート

Import
import { MuxPlayer } from '@capgo/capacitor-mux-player';

API の概要

API の概要

play

play

フルスクリーンでネイティブの Mux プレーヤーを起動し、再生を開始します。

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

dismiss

dismiss

__CAPGO_KEEP_0__を非表示にする

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

__CAPGO_KEEP_3__が現在表示中であるかどうかを返します。

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

__CAPGO_KEEP_4__

__CAPGO_KEEP_4__

MuxPlayOptions

__CAPGO_KEEP_5__
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

__CAPGO_KEEP_6__
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 がアップストリームで変更された場合に再度同期を実行してください。

「Getting Started」から続けてください。

「Getting Started」から続けてください。

「Getting Started」を使用して、ダッシュボードと __CAPGO_KEEP_0__ の操作を計画する場合、 「@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-mux-player」を使用します。 「@API/__CAPGO_KEEP_1__-mux-player」のネイティブ機能の実装については「API Overview」を参照してください。 Using @capgo/capacitor-mux-player for the native capability in Using @capgo/capacitor-mux-player, APIの実装詳細については「API Overview」を参照してください。 APIの実装詳細については「API Overview」を参照してください。 Introduction Introductionの実装詳細について API Keys API Keysの実装詳細について、 Devices Devicesの実装詳細について