{"id":28700006,"url":"https://github.com/Cap-go/capacitor-jw-player","last_synced_at":"2025-06-14T11:03:49.210Z","repository":{"id":289782402,"uuid":"967991277","full_name":"Cap-go/capacitor-jw-player","owner":"Cap-go","description":"Plays videos natively from jwplayer.com","archived":false,"fork":false,"pushed_at":"2025-06-02T12:56:59.000Z","size":770,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T16:59:29.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cap-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Cap-go","patreon":null,"open_collective":"capgo","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-04-17T10:19:39.000Z","updated_at":"2025-06-02T12:57:02.000Z","dependencies_parsed_at":"2025-04-25T03:16:20.924Z","dependency_job_id":"012c86c2-2612-40c4-bc30-980b3ff769b6","html_url":"https://github.com/Cap-go/capacitor-jw-player","commit_stats":null,"previous_names":["cap-go/capacitor-jw-player"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/Cap-go/capacitor-jw-player","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-jw-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-jw-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-jw-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-jw-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap-go","download_url":"https://codeload.github.com/Cap-go/capacitor-jw-player/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-jw-player/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259743736,"owners_count":22904792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-14T11:01:32.788Z","updated_at":"2025-06-14T11:03:49.200Z","avatar_url":"https://github.com/Cap-go.png","language":"Swift","funding_links":["https://github.com/sponsors/Cap-go","https://opencollective.com/capgo"],"categories":["Capgo Capacitor Plugins","[Capgo plugins](https://capgo.app/)"],"sub_categories":["Camera \u0026 Media"],"readme":"# @capgo/capacitor-jw-player\n \u003ca href=\"https://capgo.app/\"\u003e\u003cimg src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/?ref=plugin\"\u003e ➡️ Get Instant updates for your App with Capgo 🚀\u003c/a\u003e\u003c/h2\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/consulting/?ref=plugin\"\u003e Fix your annoying bug now, Hire a Capacitor expert 💪\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\nWIP: do not use it yet it's in dev\n\nPlay videos from jwplayer.com with a fullscreen player interface. The plugin provides a comprehensive API for controlling JW Player playback, playlists, and tracks.\n\n## Key Features\n\n- Always fullscreen player\n- Supports both single videos and playlists\n- Complete control over playback (play, pause, seek, etc.)\n- Audio track selection\n- Caption/subtitle support\n- Event listeners for player state changes\nPlayes videos from jwplayer.com\n\n## Install\n\n```bash\nnpm install @capgo/capacitor-jw-player\nnpx cap sync\n```\n\n## Android\n\nEdit `build.gradle` in order for the plugin to work:\n```gradle\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n        maven {\n            url 'https://mvn.jwplayer.com/content/repositories/releases/'\n        }\n    }\n}\n```\n\n## Usage Examples\n\n### Basic Setup and Playback\n\n```typescript\nimport { JwPlayer } from '@capgo/capacitor-jw-player';\n\n// Initialize the player with your license key\nawait JwPlayer.initialize({ \n  licenseKey: 'YOUR_JW_PLAYER_LICENSE_KEY' \n});\n\n// Play a video\nawait JwPlayer.play({\n  mediaUrl: 'https://example.com/video.mp4',\n  mediaType: 'video' \n});\n\n// Play a playlist\nawait JwPlayer.play({\n  mediaUrl: 'https://cdn.jwplayer.com/v2/playlists/PLAYLIST_ID',\n  mediaType: 'playlist'\n});\n```\n\n### Playback Controls\n\n```typescript\n// Pause playback\nawait JwPlayer.pause();\n\n// Resume playback\n// Note: No need to call play() again with the URL, it resumes current content\nawait JwPlayer.play();\n\n// Seek to a specific position (in seconds)\nawait JwPlayer.seekTo({ time: 30 });\n\n// Set volume (0.0 to 1.0)\nawait JwPlayer.setVolume({ volume: 0.5 });\n\n// Change playback speed\nawait JwPlayer.setSpeed({ speed: 1.5 });\n\n// Stop and release the player\nawait JwPlayer.stop();\n```\n\n### Working with Playlists\n\n```typescript\n// Load a playlist by URL\nawait JwPlayer.loadPlaylist({ \n  playlistUrl: 'https://cdn.jwplayer.com/v2/playlists/PLAYLIST_ID' \n});\n\n// Load a playlist with custom items\nawait JwPlayer.loadPlaylistWithItems({\n  playlist: [\n    { file: 'https://example.com/video1.mp4', title: 'Video 1' },\n    { file: 'https://example.com/video2.mp4', title: 'Video 2' }\n  ]\n});\n\n// Jump to a specific item in the playlist\nawait JwPlayer.setPlaylistIndex({ index: 2 });\n\n// Get information about the current playlist\nconst playlistInfo = await JwPlayer.currentPlaylist();\nconsole.log(playlistInfo.playlist);\n```\n\n### Audio and Caption Tracks\n\n```typescript\n// Get available audio tracks\nconst { tracks } = await JwPlayer.getAudioTracks();\nconsole.log('Available audio tracks:', tracks);\n\n// Get current audio track\nconst { index } = await JwPlayer.getCurrentAudioTrack();\nconsole.log('Current audio track index:', index);\n\n// Set audio track\nawait JwPlayer.setCurrentAudioTrack({ index: 1 });\n\n// Get available captions\nconst { captions } = await JwPlayer.getCaptions();\nconsole.log('Available captions:', captions);\n\n// Set captions track (0 is usually \"Off\")\nawait JwPlayer.setCurrentCaptions({ index: 1 });\n```\n\n### Event Listeners\n\n```typescript\nimport { JwPlayer } from '@capgo/capacitor-jw-player';\n\n// Listen for player ready event\nJwPlayer.addListener('ready', () =\u003e {\n  console.log('Player is ready');\n});\n\n// Listen for playback state changes\nJwPlayer.addListener('play', () =\u003e {\n  console.log('Playback started');\n});\n\nJwPlayer.addListener('pause', (data) =\u003e {\n  console.log('Playback paused, reason:', data.reason);\n});\n\nJwPlayer.addListener('complete', () =\u003e {\n  console.log('Playback completed');\n});\n\n// Listen for time updates\nJwPlayer.addListener('time', (data) =\u003e {\n  console.log(`Position: ${data.position}, Duration: ${data.duration}`);\n});\n\n// Listen for playlist changes\nJwPlayer.addListener('playlist', (data) =\u003e {\n  console.log(`Playlist loaded with ${data.playlistSize} items`);\n});\n\nJwPlayer.addListener('playlistItem', (data) =\u003e {\n  console.log(`Now playing item at index ${data.index}`);\n});\n\n// Listen for errors\nJwPlayer.addListener('error', (data) =\u003e {\n  console.error('Player error:', data.message);\n});\n\n// Clean up listeners when done\nfunction cleanup() {\n  JwPlayer.removeAllListeners();\n}\n```\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`initialize(...)`](#initialize)\n* [`play(...)`](#play)\n* [`pause()`](#pause)\n* [`resume()`](#resume)\n* [`stop()`](#stop)\n* [`seekTo(...)`](#seekto)\n* [`setVolume(...)`](#setvolume)\n* [`getPosition()`](#getposition)\n* [`getState()`](#getstate)\n* [`setSpeed(...)`](#setspeed)\n* [`setPlaylistIndex(...)`](#setplaylistindex)\n* [`loadPlaylist(...)`](#loadplaylist)\n* [`loadPlaylistWithItems(...)`](#loadplaylistwithitems)\n* [`getAudioTracks()`](#getaudiotracks)\n* [`getCurrentAudioTrack()`](#getcurrentaudiotrack)\n* [`setCurrentAudioTrack(...)`](#setcurrentaudiotrack)\n* [`getCaptions()`](#getcaptions)\n* [`getCurrentCaptions()`](#getcurrentcaptions)\n* [`setCurrentCaptions(...)`](#setcurrentcaptions)\n* [`currentPlaylist()`](#currentplaylist)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\n### initialize(...)\n\n```typescript\ninitialize(options: { licenseKey: string; playerUrl?: string; }) =\u003e Promise\u003cvoid\u003e\n```\n\nInitialize the JW Player\n\n| Param         | Type                                                     | Description                     |\n| ------------- | -------------------------------------------------------- | ------------------------------- |\n| **`options`** | \u003ccode\u003e{ licenseKey: string; playerUrl?: string; }\u003c/code\u003e | - The options for the JW Player |\n\n--------------------\n\n\n### play(...)\n\n```typescript\nplay(options: { mediaUrl: string; mediaType: 'video' | 'playlist'; autostart?: boolean; }) =\u003e Promise\u003cvoid\u003e\n```\n\nPlay a video\n\n| Param         | Type                                                                                      | Description                     |\n| ------------- | ----------------------------------------------------------------------------------------- | ------------------------------- |\n| **`options`** | \u003ccode\u003e{ mediaUrl: string; mediaType: 'video' \\| 'playlist'; autostart?: boolean; }\u003c/code\u003e | - The options for the JW Player |\n\n--------------------\n\n\n### pause()\n\n```typescript\npause() =\u003e Promise\u003cvoid\u003e\n```\n\nPause the currently playing media\n\n--------------------\n\n\n### resume()\n\n```typescript\nresume() =\u003e Promise\u003cvoid\u003e\n```\n\nResume the currently paused media\n\n--------------------\n\n\n### stop()\n\n```typescript\nstop() =\u003e Promise\u003cvoid\u003e\n```\n\nStop the currently playing media\n\n--------------------\n\n\n### seekTo(...)\n\n```typescript\nseekTo(options: { time: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSeek to a specific position in the currently playing media\n\n| Param         | Type                           | Description           |\n| ------------- | ------------------------------ | --------------------- |\n| **`options`** | \u003ccode\u003e{ time: number; }\u003c/code\u003e | - Options for seeking |\n\n--------------------\n\n\n### setVolume(...)\n\n```typescript\nsetVolume(options: { volume: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSet the volume level\n\n| Param         | Type                             | Description                  |\n| ------------- | -------------------------------- | ---------------------------- |\n| **`options`** | \u003ccode\u003e{ volume: number; }\u003c/code\u003e | - Options for setting volume |\n\n--------------------\n\n\n### getPosition()\n\n```typescript\ngetPosition() =\u003e Promise\u003c{ position: number; }\u003e\n```\n\nGet the current position in the media\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ position: number; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getState()\n\n```typescript\ngetState() =\u003e Promise\u003c{ state: number; }\u003e\n```\n\nGet the current player state\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ state: number; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setSpeed(...)\n\n```typescript\nsetSpeed(options: { speed: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSet the playback speed\n\n| Param         | Type                            | Description                 |\n| ------------- | ------------------------------- | --------------------------- |\n| **`options`** | \u003ccode\u003e{ speed: number; }\u003c/code\u003e | - Options for setting speed |\n\n--------------------\n\n\n### setPlaylistIndex(...)\n\n```typescript\nsetPlaylistIndex(options: { index: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSet the current item in the playlist by index\n\n| Param         | Type                            | Description                         |\n| ------------- | ------------------------------- | ----------------------------------- |\n| **`options`** | \u003ccode\u003e{ index: number; }\u003c/code\u003e | - Options for setting playlist item |\n\n--------------------\n\n\n### loadPlaylist(...)\n\n```typescript\nloadPlaylist(options: { playlistUrl: string; }) =\u003e Promise\u003cvoid\u003e\n```\n\nLoad a playlist\n\n| Param         | Type                                  | Description                      |\n| ------------- | ------------------------------------- | -------------------------------- |\n| **`options`** | \u003ccode\u003e{ playlistUrl: string; }\u003c/code\u003e | - Options for loading a playlist |\n\n--------------------\n\n\n### loadPlaylistWithItems(...)\n\n```typescript\nloadPlaylistWithItems(options: { playlist: any[]; }) =\u003e Promise\u003cvoid\u003e\n```\n\nLoad a playlist with items\n\n| Param         | Type                              | Description                      |\n| ------------- | --------------------------------- | -------------------------------- |\n| **`options`** | \u003ccode\u003e{ playlist: any[]; }\u003c/code\u003e | - Options for loading a playlist |\n\n--------------------\n\n\n### getAudioTracks()\n\n```typescript\ngetAudioTracks() =\u003e Promise\u003c{ tracks: any[]; }\u003e\n```\n\nGet available audio tracks\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ tracks: any[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getCurrentAudioTrack()\n\n```typescript\ngetCurrentAudioTrack() =\u003e Promise\u003c{ index: number; }\u003e\n```\n\nGet the current audio track\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ index: number; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setCurrentAudioTrack(...)\n\n```typescript\nsetCurrentAudioTrack(options: { index: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSet the current audio track\n\n| Param         | Type                            | Description                       |\n| ------------- | ------------------------------- | --------------------------------- |\n| **`options`** | \u003ccode\u003e{ index: number; }\u003c/code\u003e | - Options for setting audio track |\n\n--------------------\n\n\n### getCaptions()\n\n```typescript\ngetCaptions() =\u003e Promise\u003c{ captions: any[]; }\u003e\n```\n\nGet the available captions/subtitles\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ captions: any[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getCurrentCaptions()\n\n```typescript\ngetCurrentCaptions() =\u003e Promise\u003c{ index: number; }\u003e\n```\n\nGet the current captions/subtitles track\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ index: number; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setCurrentCaptions(...)\n\n```typescript\nsetCurrentCaptions(options: { index: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSet the current captions/subtitles track\n\n| Param         | Type                            | Description                          |\n| ------------- | ------------------------------- | ------------------------------------ |\n| **`options`** | \u003ccode\u003e{ index: number; }\u003c/code\u003e | - Options for setting captions track |\n\n--------------------\n\n\n### currentPlaylist()\n\n```typescript\ncurrentPlaylist() =\u003e Promise\u003cany\u003e\n```\n\nGet the current playlist\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;any\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\u003c/docgen-api\u003e\n\n## Event Listeners\n\nThe plugin emits the following events that you can listen for:\n\n| Event | Description | Data |\n| ----- | ----------- | ---- |\n| `ready` | Player is ready to use | None |\n| `play` | Playback has started | None |\n| `pause` | Playback is paused | `{ reason: number }` |\n| `complete` | Playback of the current item is complete | None |\n| `time` | Playback time has updated | `{ position: number, duration: number }` |\n| `setupError` | Error during setup | `{ code: number, message: string }` |\n| `error` | General playback error | `{ code: number, message: string }` |\n| `warning` | Player warning | `{ code: number, message: string }` |\n| `playlist` | Playlist has been loaded | `{ playlistSize: number }` |\n| `playlistItem` | Current playlist item has changed | `{ index: number, file: string, title: string }` |\n| `playerDismissed` | Player has been closed/dismissed | None |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCap-go%2Fcapacitor-jw-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCap-go%2Fcapacitor-jw-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCap-go%2Fcapacitor-jw-player/lists"}