Iniziare
Copia un promemoria di configurazione con le istruzioni 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.
Installa
Sezione intitolata “Installa”Puoi utilizzare la nostra configurazione assistita da AI per installare il plugin. Aggiungi le Capgo competenze al tuo strumento 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 la configurazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche del tuo sistema operativo 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 “inizializzazione”Inizia il JW Player
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.initialize({} as { licenseKey: string; playerUrl?: string });Gioca un video
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.play({} as { mediaUrl: string; mediaType: 'video' | 'playlist'; autostart?: boolean });Pausa i media in corso di riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.pause();Riprendi i media attualmente sospesi
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.resume();Ferma i media attualmente in riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.stop();Sali a una posizione specifica dei media attualmente in riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.seekTo({} as { time: number });Imposta il livello del volume
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setVolume({} as { volume: number });getPosition
Sezione intitolata “getPosition”Ottieni la posizione corrente nel media
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getPosition();getState
Sezione intitolata “getState”Ottieni lo stato del lettore corrente
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getState();setSpeed
Sezione intitolata “setSpeed”Imposta la velocità di riproduzione
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setSpeed({} as { speed: number });setPlaylistIndex
Sezione intitolata “setPlaylistIndex”Imposta l'elemento corrente nella playlist tramite indice
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setPlaylistIndex({} as { index: number });loadPlaylist
Sezione intitolata “caricaPlaylist”Carica una playlist
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylist({} as { playlistUrl: string });loadPlaylistWithItems
Sezione intitolata “caricaPlaylistConElementi”Carica una playlist con elementi
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylistWithItems({} as { playlist: any[] });getAudioTracks
Sezione intitolata “getAudioTracks”Ottenere le tracce audio disponibili
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getAudioTracks();getCurrentAudioTrack
Sezione intitolata “getAudioTrackCorrente”Ottenere la traccia audio corrente
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentAudioTrack();setCurrentAudioTrack
Sezione intitolata “setCurrentAudioTrack”Imposta il tracciato audio corrente
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({} as { index: number });getCaptions
Sezione intitolata “getCaptions”Ottieni le didascalie disponibili/subtitoli
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCaptions();getCurrentCaptions
Sezione intitolata “getCurrentCaptions”Ottieni il tracciato corrente delle didascalie/subtitoli
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentCaptions();setCurrentCaptions
Sezione intitolata “setCurrentCaptions”Imposta il tracciato corrente delle didascalie/subtitoli
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentCaptions({} as { index: number });currentPlaylist
Sezione intitolata “currentPlaylist”Ottieni la playlist corrente
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.currentPlaylist();Fonte di Verità
Sezione intitolata “Fonte di Verità”Questa pagina è generata dal plugin’s src/definitions.tsRiscanna nuovamente la sincronizzazione quando le informazioni pubbliche API cambiano in fase di sviluppo.
Continua da qui: Iniziare
Sezione intitolata “Continua da qui: Iniziare”Se stai utilizzando Iniziare per pianificare dashboard e API operazioni, connettilo con Usando @capgo/capacitor-jw-player per la capacità nativa in Usando @capgo/capacitor-jw-player, API Overview per il dettaglio di implementazione in API Overview, Introduzione per il dettaglio di implementazione in Introduzione, API Keys per il dettaglio di implementazione in API Keys, e Dispositivi per il dettaglio di implementazione in Dispositivi.