Getting Started
Copiez un prompt de configuration avec les étapes d'installation et la guide markdown complète 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.
Prêt à 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 Aperçu
Section intitulée “API Aperçu”initialize
Section intitulée “initialiser”Initialisez le lecteur JW
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.initialize({} as { licenseKey: string; playerUrl?: string });Lire une vidéo
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.play({} as { mediaUrl: string; mediaType: 'video' | 'playlist'; autostart?: boolean });Arrêter la média en cours de lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.pause();Résumer la média actuellement en pause
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.resume();Arrêter la média actuellement en lecture
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.stop();Rechercher une position spécifique dans la média actuellement en 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”Obtenez la position actuelle dans les médias
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getPosition();getState
Section intitulée “getState”Obtenez 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 “chargerPlaylistAvecItems”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”Obtenir les pistes audio disponibles
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getAudioTracks();getCurrentAudioTrack
Section intitulée “getCurrentAudioTrack”Obtenir la piste audio actuelle
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentAudioTrack();setCurrentAudioTrack
Section intitulée “setCurrentAudioTrack”Définir le pisteur audio actuel
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.setCurrentAudioTrack({} as { index: number });getCaptions
Section intitulée « getCaptions »Obtenir les sous-titres disponibles
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCaptions();getCurrentCaptions
Section intitulée « getCurrentCaptions »Obtenir le pisteur sous-titres actuel
import { JwPlayer } from '@capgo/capacitor-jw-player';
await JwPlayer.getCurrentCaptions();setCurrentCaptions
Section intitulée « setCurrentCaptions »Définir le pisteur sous-titres actuel
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 De Vérité »Cette page est générée à partir du plugin’s src/definitions.tsRe-run la synchronisation lorsque les modifications publiques API se produisent en amont.
Continuez de l'étape « Getting Started »
Section intitulée « Continuez de l'étape « Getting Started » »Si vous utilisez Getting Started pour planifier les opérations de tableau de bord et API , connectez-le avec En utilisant @capgo/capacitor-jw-player pour la capacité native en utilisant @capgo/capacitor-jw-player, API Vue d'ensemble pour le détail d'implémentation dans API Vue d'ensemble, Introduction pour le détail 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.