はじめに
セットアップのプロンプトをコピーして、インストールの手順とこのプラグインのフルマークダウンガイドを取得します。
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.
インストール
「インストール」のセクションbun add @capgo/capacitor-jw-playerbunx cap syncimport { JwPlayer } from '@capgo/capacitor-jw-player';initialize
Section titled “initialize”Initialize the JW Player
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.initialize({} as { licenseKey: string; playerUrl?: string });Play a video
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
「履歴」を表示現在停止中のメディアを再開
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({} as { time: number });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
再生速度を設定クリップボードにコピー
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setSpeed({} as { speed: number });setPlaylistIndex
プレイリスト内の現在のアイテムを指定されたインデックスで設定クリップボードにコピー
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setPlaylistIndex({} as { index: number });loadPlaylist
「loadPlaylist」セクションプレイリストを読み込む
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylist({} as { playlistUrl: string });loadPlaylistWithItems
「loadPlaylistWithItems」セクションアイテムを含むプレイリストを読み込む
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylistWithItems({} as { playlist: any[] });getAudioTracks
利用可能なオーディオトラックを取得クリップボードにコピー
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getAudioTracks();getCurrentAudioTrack
現在のオーディオトラックを取得クリップボードにコピー
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentAudioTrack();setCurrentAudioTrack
setCurrentAudioTrack現在のオーディオトラックを設定
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({} as { index: number });getCaptions
getCaptions利用可能なキャプション/字幕を取得
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCaptions();getCurrentCaptions
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
現在のプレイリストのセクション現在のプレイリストを取得
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.currentPlaylist();真実の源
真実の源のセクションこのページはプラグインの設定から生成されます。 src/definitions.tsパブリック API がアップストリームで変更された場合に再度同期を実行してください。