Skip to main content
Back to plugins
@capgo/capacitor-jw-player
Tutorial
by github.com/Cap-go

JW Player

Embed JW Player for professional video streaming with ads and analytics support

Guide

Tutorial on JW Player

Using @capgo/capacitor-jw-player

Playes videos from jwplayer.com.

Install

bun add @capgo/capacitor-jw-player
bunx cap sync

What This Plugin Exposes

  • initialize - Initialize the JW Player.
  • play - Play a video.
  • pause - Pause the currently playing media.
  • resume - Resume the currently paused media.

Example Usage

initialize

Initialize the JW Player.

import { JwPlayer } from '@capgo/capacitor-jw-player';

await JwPlayer.initialize({} as { licenseKey: string; playerUrl?: string });

play

Play a video.

import { JwPlayer } from '@capgo/capacitor-jw-player';

await JwPlayer.play({} as { mediaUrl: string; mediaType: 'video' | 'playlist'; autostart?: boolean });

pause

Pause the currently playing media.

import { JwPlayer } from '@capgo/capacitor-jw-player';

await JwPlayer.pause();

resume

Resume the currently paused media.

import { JwPlayer } from '@capgo/capacitor-jw-player';

await JwPlayer.resume();

Full Reference