Getting Started
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-pluginsUtilisez ensuite 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({ licenseKey: 'license-key-123' });Jouer une vidéo
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.play({ mediaUrl: 'https://example.com', mediaType: 'video',});Arrêtez la lecture actuelle
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();Rechercher une position spécifique dans les médias en cours de lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.seekTo({ time: 10 });setVolume
Section intitulée « setVolume »Définir le niveau de volume
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setVolume({ volume: 0.5 });getPosition
Section intitulée « getPosition »Obtenir la position actuelle des médias
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getPosition();console.log(result);getState
Section intitulée « getState »Obtenir l'état actuel du lecteur
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getState();console.log(result);setSpeed
Section intitulée « setSpeed »Définir la vitesse de lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setSpeed({ speed: 1 });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({ index: 1 });loadPlaylist
Section intitulée « chargerPlaylist »Charger une playlist
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylist({ playlistUrl: 'https://example.com' });loadPlaylistWithItems
Section intitulée « chargerPlaylistAvecItems »Charger une playlist avec des éléments
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.loadPlaylistWithItems({ playlist: [] });getAudioTracks
Section intitulée « getAudioTracks »Obtenir les pistes audio disponibles
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getAudioTracks();console.log(result);getCurrentAudioTrack
Section intitulée « getCurrentAudioTrack »Obtenir la piste audio actuelle
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCurrentAudioTrack();console.log(result);setCurrentAudioTrack
Section intitulée « setCurrentAudioTrack »Définir la piste audio actuelle
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({ index: 1 });getCaptions
Section intitulée « getCaptions »Obtenir les sous-titres disponibles
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCaptions();console.log(result);getCurrentCaptions
Section intitulée « getCurrentCaptions »Obtenir les sous-titres actuels/paroles
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.getCurrentCaptions();console.log(result);setCurrentCaptions
Section intitulée « setCurrentCaptions »Définir les sous-titres actuels/paroles
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentCaptions({ index: 1 });currentPlaylist
Section intitulée « currentPlaylist »Obtenir la playlist actuelle
import { JwPlayer } from '@capgo/capacitor-jw-player';
const result = await JwPlayer.currentPlaylist();console.log(result);Source De Vérité
Section intitulée « Source De Vérité »Cette page est générée à partir du plugin’s src/definitions.tsRe-rendez la synchronisation lorsque les données publiques API changent en amont.
Continuez de la section « Commencer »
Section intitulée « Continuez de la section « Commencer » »Si vous utilisez Getting Started pour planifier les opérations de tableau de bord et API Utilisation de @capgo/capacitor-jw-player pour la capacité native dans l'utilisation de @capgo/capacitor-jw-player, pour la capacité native dans Utilisation de @API/__CAPGO_KEEP_1__-jw-player, pour les détails d'implémentation dans API Vue d'ensemble Introduction pour les détails d'implémentation dans Introduction, API Clés pour les détails d'implémentation dans API Clés, et Appareils pour les détails d'implémentation sur les appareils.