Getting Started
Copia un prompt di configurazione con i passaggi di installazione e la guida markdown completa per questo 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.
Installazione
Sottosezione intitolata “Installazione”Puoi utilizzare la nostra configurazione assistita dall'IA per installare il plugin. Aggiungi le Capgo abilità al tuo strumento di AI utilizzando il seguente comando:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsPoi utilizza il seguente prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-jw-player` plugin in my project.Se preferisci l'installazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche per la piattaforma riportate di seguito.
bun add @capgo/capacitor-jw-playerbunx cap syncImporta
Sezione intitolata “Importa”import { JwPlayer } from '@capgo/capacitor-jw-player';API Panoramica
Sezione intitolata “API Panoramica”initialize
Sezione intitolata “inizializza”Inizia il JW Player
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.initialize({ licenseKey: 'license-key-123' });Gioca un video
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.play({ mediaUrl: 'https://example.com', mediaType: 'video',});Ferma i media in corso di riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.pause();Ripristina i media fermati
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.resume();Ferma i media in corso di riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.stop();Ferma a una posizione specifica dei media in corso di riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.seekTo({ time: 10 });Imposta il livello del volume
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setVolume({ volume: 0.5 });Ottieni la posizione corrente dei media
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getPosition();console.log(result);Ottieni lo stato corrente del player
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getState();console.log(result);setSpeed
Impostazione della velocitàImposta la velocità di riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setSpeed({ speed: 1 });setPlaylistIndex
Sezione intitolata “setPlaylistIndex”Imposta l'elemento corrente nella playlist per indice
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setPlaylistIndex({ index: 1 });loadPlaylist
Sezione intitolata “caricaPlaylist”Carica una playlist
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylist({ playlistUrl: 'https://example.com' });loadPlaylistWithItems
Sezione intitolata “caricaPlaylistConElementi”Carica una playlist con elementi
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylistWithItems({ playlist: [] });getAudioTracks
Sezione intitolata “getAudioTracks”Otteni tracce audio disponibili
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getAudioTracks();console.log(result);getCurrentAudioTrack
Sottosezione intitolata “getCurrentAudioTrack”Ottieni il tracciato audio corrente
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCurrentAudioTrack();console.log(result);setCurrentAudioTrack
Sottosezione intitolata “setCurrentAudioTrack”Imposta il tracciato audio corrente
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({ index: 1 });getCaptions
Sottosezione intitolata “getCaptions”Ottieni le didascalie disponibili/subtitoli
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCaptions();console.log(result);getCurrentCaptions
Sottosezione intitolata “getCurrentCaptions”Ottieni il tracciato didascalie/subtitoli corrente
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCurrentCaptions();console.log(result);setCurrentCaptions
Sottosezione intitolata “setCurrentCaptions”Imposta le attuali didascalie/tracce sottotitolate
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentCaptions({ index: 1 });currentPlaylist
Sottosezione intitolata “currentPlaylist”Ottieni l'elenco attuale
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.currentPlaylist();console.log(result);Fonte di Verità
Sottosezione intitolata “Fonte di Verità”Questa pagina è generata dal plugin src/definitions.ts. Re-run the sync when the public API changes upstream.
Continua da Iniziato all'Avvio
Sezione intitolata “Continua da Inizia”Se stai utilizzando Getting Started per pianificare dashboard e operazioni di API, connettilo con Utilizza @capgo/capacitor-jw-player per la capacità nativa in Utilizza @capgo/capacitor-jw-player, API Panoramica per i dettagli di implementazione in API Panoramica, Introduzione per i dettagli di implementazione in Introduzione, API Chiavi per i dettagli di implementazione in API Chiavi, e Dispositivi per i dettagli di implementazione in Dispositivi.