Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
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.
Install
Section titled “Install”bun add @capgo/capacitor-jw-playerbunx cap syncImport
Section titled “Import”import { JwPlayer } from '@capgo/capacitor-jw-player';API Overview
Section titled “API Overview”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
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
Section titled “setVolume”Set the volume level
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setVolume({} as { volume: number });getPosition
Section titled “getPosition”Get the current position in the media
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getPosition();getState
Section titled “getState”Get the current player state
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getState();setSpeed
Section titled “setSpeed”Set the playback speed
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”Get the current audio track
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentAudioTrack();setCurrentAudioTrack
Section titled “setCurrentAudioTrack”Set the current audio track
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({} as { index: number });getCaptions
Section titled “getCaptions”Get the available captions/subtitles
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCaptions();getCurrentCaptions
Section titled “getCurrentCaptions”Get the current captions/subtitles track
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentCaptions();setCurrentCaptions
Section titled “setCurrentCaptions”Set the current captions/subtitles track
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentCaptions({} as { index: number });currentPlaylist
Section titled “currentPlaylist”Get the current playlist
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.currentPlaylist();Source Of Truth
Section titled “Source Of Truth”This page is generated from the plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.