始め方
このプラグインのインストールステップとフルマークダウンガイドのセットアッププロンプトをコピーする
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-jw-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/jw-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.
インストール
「インストール」のセクションCapgoの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-jw-player` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-jw-playerbunx cap syncインポート
「インポート」のセクションimport { JwPlayer } from '@capgo/capacitor-jw-player';API の概要
「API の概要」のセクションinitialize
「initialize」のセクションJW プレイヤーを初期化する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.initialize({} as { licenseKey: string; playerUrl?: string });play
「play」のセクション動画を再生する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.play({} as { mediaUrl: string; mediaType: 'video' | 'playlist'; autostart?: boolean });Pause the currently playing media
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.pause();resume
Section titled “resume”Resume the currently paused media
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.resume();Stop the currently playing media
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.stop();seekTo
Section titled “seekTo”Seek to a specific position in the currently playing media
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.seekTo({} as { time: number });setVolume
「setVolume」セクション音量を設定します
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setVolume({} as { volume: number });getPosition
「getPosition」セクション現在のメディアの位置を取得します
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getPosition();getState
「getState」セクション現在のプレーヤーの状態を取得します
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getState();setSpeed
「setSpeed」セクション再生速度を設定します
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setSpeed({} as { speed: number });setPlaylistIndex
Section titled “setPlaylistIndex”Set the current item in the playlist by index
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setPlaylistIndex({} as { index: number });loadPlaylist
Section titled “loadPlaylist”Load a playlist
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylist({} as { playlistUrl: string });loadPlaylistWithItems
Section titled “loadPlaylistWithItems”Load a playlist with items
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylistWithItems({} as { playlist: any[] });getAudioTracks
Section titled “getAudioTracks”Get available audio tracks
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getAudioTracks();getCurrentAudioTrack
Section titled “getCurrentAudioTrack”現在のオーディオトラックを取得する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentAudioTrack();setCurrentAudioTrack
Section titled “setCurrentAudioTrack”現在のオーディオトラックを設定する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({} as { index: number });getCaptions
Section titled “getCaptions”利用可能な字幕/サブタイトルを取得する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCaptions();getCurrentCaptions
Section titled “getCurrentCaptions”現在の字幕/サブタイトルトラックを取得する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentCaptions();setCurrentCaptions
setCurrentCaptionsセクション現在の字幕/キャプショントラックを設定する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentCaptions({} as { index: number });currentPlaylist
currentPlaylistセクション現在のプレイリストを取得する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.currentPlaylist();ソースオブトゥルース
ソースオブトゥルースセクションこのページはプラグインのソースから生成されています。 src/definitions.tsAPIがアップストリームで変更された場合に再度同期を実行してください。
Getting Startedから続けて
Getting Startedから続けてセクションCapgoを使用している場合 Getting Started APIと連携してダッシュボードとAPIの操作を計画する capgo/capacitor-jw-playerを使用する for the native capability in Using @capgo/capacitor-jw-player, APIの概要 APIの実装詳細 Capgoの概要 __CAPGO_KEEP_0__のキー APIの実装詳細 for the implementation detail in API Keys, and デバイス __CAPGO_KEEP_0__の実装詳細については、デバイスのページを参照してください。