Skip to main content

IVS Player Capacitor plugin

Stream ultra-low latency live video using Amazon Interactive Video Service (IVS)

Install

bun add @capgo/capacitor-ivs-player bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-ivs-player
  • pnpm add @capgo/capacitor-ivs-player
  • yarn add @capgo/capacitor-ivs-player

Guide

How to use IVS Player in Capacitor

Using @capgo/capacitor-ivs-player

Ivs player for capacitor app.

Install

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

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { CapacitorIvsPlayer } from '@capgo/capacitor-ivs-player';

API at a glance

Method Description
create See the source definitions for current behavior.
start See the source definitions for current behavior.
cast See the source definitions for current behavior.
getCastStatus See the source definitions for current behavior.
pause See the source definitions for current behavior.
delete See the source definitions for current behavior.
getUrl See the source definitions for current behavior.
getState See the source definitions for current behavior.
setPlayerPosition See the source definitions for current behavior.
getPlayerPosition See the source definitions for current behavior.
setAutoQuality See the source definitions for current behavior.
getAutoQuality See the source definitions for current behavior.
setPip See the source definitions for current behavior.
getPip See the source definitions for current behavior.
setFrame Set the frame of the player view, all number have to be positive and integers.
getFrame See the source definitions for current behavior.
setBackgroundState See the source definitions for current behavior.
getBackgroundState See the source definitions for current behavior.
setMute See the source definitions for current behavior.
getMute See the source definitions for current behavior.
setQuality See the source definitions for current behavior.
getQuality See the source definitions for current behavior.
getQualities See the source definitions for current behavior.

Examples

create()

See the API reference for the current contract.

import { CapacitorIvsPlayer } from '@capgo/capacitor-ivs-player';

await CapacitorIvsPlayer.create({ url: 'https://example.com' });

start()

See the API reference for the current contract.

import { CapacitorIvsPlayer } from '@capgo/capacitor-ivs-player';

await CapacitorIvsPlayer.start();

cast()

See the API reference for the current contract.

import { CapacitorIvsPlayer } from '@capgo/capacitor-ivs-player';

await CapacitorIvsPlayer.cast();

getCastStatus()

See the API reference for the current contract.

import { CapacitorIvsPlayer } from '@capgo/capacitor-ivs-player';

const result = await CapacitorIvsPlayer.getCastStatus();
console.log(result);

pause()

See the API reference for the current contract.

import { CapacitorIvsPlayer } from '@capgo/capacitor-ivs-player';

await CapacitorIvsPlayer.pause();

delete()

See the API reference for the current contract.

import { CapacitorIvsPlayer } from '@capgo/capacitor-ivs-player';

await CapacitorIvsPlayer.delete();

The table above lists the 23 core methods. Listener and version helpers, and the full contract of each method, are documented in the GitHub repository.

Listen to events

addListener returns a handle. Call handle.remove() when the screen unmounts, or CapacitorIvsPlayer.removeAllListeners() to clear every listener.

Full reference

Keep going from Using @capgo/capacitor-ivs-player

If you are using Using @capgo/capacitor-ivs-player to plan native plugin work, connect it with @capgo/capacitor-ivs-player for the implementation detail in @capgo/capacitor-ivs-player, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.

FAQ

IVS Player plugin FAQ

How do I install the IVS Player plugin in a Capacitor app?

Run "bun add @capgo/capacitor-ivs-player" (or "npm install @capgo/capacitor-ivs-player"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-ivs-player" in your app code.

Does @capgo/capacitor-ivs-player work with React, Vue and Angular?

Yes. IVS Player is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-ivs-player support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-ivs-player free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-ivs-player/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses IVS Player without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship IVS Player changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo