始め方
このプラグインのインストール手順とフルマークダウンガイドを含むセットアップの案をコピーします。
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-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-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 Playerを初期化する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.initialize({ licenseKey: 'license-key-123' });play
「play」のセクション動画を再生する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.play({ mediaUrl: 'https://example.com', mediaType: 'video',});pause
「一時停止」セクション現在再生中のメディアを一時停止する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.pause();resume
「再生を再開」セクション一時停止したメディアを再生を再開する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.resume();stop
「停止」セクション現在再生中のメディアを停止する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.stop();seekTo
「位置まで移動」セクション現在再生中のメディアの特定の位置まで移動する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.seekTo({ time: 10 });setVolume
「音量を設定する」のセクション音量を設定する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setVolume({ volume: 0.5 });getPosition
「現在の位置を取得する」のセクションメディアの現在の位置を取得する
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getPosition();console.log(result);getState
「現在の状態を取得する」のセクション現在のプレイヤー状態を取得する
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getState();console.log(result);setSpeed
「再生速度を設定する」のセクション再生速度を設定する
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setSpeed({ speed: 1 });setPlaylistIndex
「setPlaylistIndex」セクションプレイリスト内の現在のアイテムをインデックスで設定
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setPlaylistIndex({ index: 1 });loadPlaylist
「loadPlaylist」セクションプレイリストを読み込む
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylist({ playlistUrl: 'https://example.com' });loadPlaylistWithItems
「loadPlaylistWithItems」セクションアイテムを含むプレイリストを読み込む
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylistWithItems({ playlist: [] });getAudioTracks
「getAudioTracks」セクション利用可能なオーディオトラックを取得
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getAudioTracks();console.log(result);getCurrentAudioTrack
getCurrentAudioTrackのセクション現在のオーディオトラックを取得
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCurrentAudioTrack();console.log(result);setCurrentAudioTrack
setCurrentAudioTrackのセクション現在のオーディオトラックを設定
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({ index: 1 });getCaptions
getCaptionsのセクション利用可能な字幕/字幕を取得
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCaptions();console.log(result);getCurrentCaptions
getCurrentCaptionsのセクション現在の字幕/字幕トラックを取得
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCurrentCaptions();console.log(result);setCurrentCaptions
setCurrentCaptionsのセクション現在の字幕/キャプショントラックを設定
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentCaptions({ index: 1 });currentPlaylist
currentPlaylistのセクション現在のプレイリストを取得
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.currentPlaylist();console.log(result);真実の源
真実の源のセクションこのページはプラグインの src/definitions.tsパブリックAPIがアップストリームで変更されたときに再度Syncを実行してください。
Getting Startedから続けてください
Section titled “Getting Startedから続けて”Capgoを使用している場合 Getting Started Capgoを使用してダッシュボードとAPIの操作を計画する場合、CapgoをAPIに接続します。 Capgoの@capgo/capacitor-jw-playerを使用 Capgoの@capgo/capacitor-jw-playerを使用することで、Capgoのnative capabilityを実装できます。 APIの概要 APIの概要を参照することで、Capgoの実装詳細を確認できます。 導入 導入を参照することで、Capgoの実装詳細を確認できます。 APIのキー APIのキーを参照することで、Capgoの実装詳細を確認できます。 デバイス デバイスの実装詳細