Démarrage
Copiez un prompt de configuration avec les étapes d'installation et la guide markdown complet pour ce 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.
Installer
Section intitulée « Installer »Vous pouvez utiliser notre configuration assistée par l'IA pour installer le plugin. Ajoutez les Capgo compétences à votre outil IA à l'aide de la commande suivante :
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsEnsuite, utilisez la prompt suivante :
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-jw-player` plugin in my project.Si vous préférez la configuration manuelle, installez le plugin en exécutant les commandes suivantes et suivez les instructions spécifiques à la plateforme ci-dessous :
bun add @capgo/capacitor-jw-playerbunx cap syncImporter
Section intitulée “Importer”import { JwPlayer } from '@capgo/capacitor-jw-player';API Vue d'ensemble
Section intitulée “API Vue d'ensemble”initialize
Section intitulée “Initialiser”Initialiser le JW Player
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.initialize({} as { licenseKey: string; playerUrl?: string });Jouer une vidéo
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.play({} as { mediaUrl: string; mediaType: 'video' | 'playlist'; autostart?: boolean });Mettre en pause le média en cours de lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.pause();Reprendre le média mis en pause
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.resume();Arrêter le média en cours de lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.stop();Recherchez une position spécifique dans les médias en cours de lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.seekTo({} as { time: number });setVolume
Section intitulée « setVolume »Définir le niveau de volume
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setVolume({} as { volume: number });getPosition
Section intitulée « getPosition »Obtenir la position actuelle des médias
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getPosition();getState
Section intitulée « getState »Obtenir l'état actuel du lecteur
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getState();setSpeed
Section intitulée “setSpeed”Définir la vitesse de lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setSpeed({} as { speed: number });setPlaylistIndex
Section intitulée “setPlaylistIndex”Définir l'élément actuel de la playlist par index
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setPlaylistIndex({} as { index: number });loadPlaylist
Section intitulée “loadPlaylist”Charger une playlist
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylist({} as { playlistUrl: string });loadPlaylistWithItems
Section intitulée “loadPlaylistWithItems”Charger une playlist avec des éléments
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylistWithItems({} as { playlist: any[] });getAudioTracks
Section intitulée « getAudioTracks »Obtenez les pistes audio disponibles
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getAudioTracks();getCurrentAudioTrack
Section intitulée « getCurrentAudioTrack »Obtenez la piste audio actuelle
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentAudioTrack();setCurrentAudioTrack
Section intitulée « setCurrentAudioTrack »Définissez la piste audio actuelle
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({} as { index: number });getCaptions
Section intitulée « getCaptions »Obtenez les sous-titres disponibles
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCaptions();getCurrentCaptions
Section intitulée “getCurrentCaptions”Obtenez les sous-titres actuels/track
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentCaptions();setCurrentCaptions
Section intitulée “setCurrentCaptions”Définir les sous-titres actuels/track
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentCaptions({} as { index: number });currentPlaylist
Section intitulée “currentPlaylist”Obtenez la playlist actuelle
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.currentPlaylist();Source De Vérité
Section intitulée “Source Of Truth”Cette page est générée à partir du plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.
Continuez depuis Getting Started
Section intitulée « Continuez depuis Getting Started »Si vous utilisez Getting Started pour planifier le tableau de bord et les opérations de API, connectez-le à Utilisation de @capgo/capacitor-jw-player pour la capacité native dans Utilisation de @capgo/capacitor-jw-player, API : Présentation pour les détails d'implémentation dans API : Présentation, Introduction pour les détails d'implémentation dans Introduction, API Clés pour le détail d'implémentation dans API Clés, et Appareils pour le détail d'implémentation dans Appareils.