npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@capgo/capacitor-video-player

v8.1.13

Published

Capacitor plugin to play video in native player

Readme

@capgo/capacitor-video-player

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/video-player/

Compatibility

| Plugin version | Capacitor compatibility | Maintained | | -------------- | ----------------------- | ---------- | | v8.*.* | v8.*.* | ✅ | | v7.*.* | v7.*.* | On demand | | v6.*.* | v6.*.* | ❌ | | v5.*.* | v5.*.* | ❌ |

Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.

Install

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

iOS Chromecast setup

iOS Chromecast uses the Google Cast SDK default media receiver. When chromecast is enabled, the plugin adds a Cast button over the fullscreen iOS player, loads the current media on the selected receiver, and keeps plugin play/pause/seek/volume calls pointed at the active Cast session.

For Cast discovery on iOS, add local network keys to your app Info.plist.

<key>NSBonjourServices</key>
<array>
  <string>_googlecast._tcp</string>
  <string>_CC1AD845._googlecast._tcp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>$(PRODUCT_NAME) uses the local network to discover Cast-enabled devices on your WiFi network.</string>
await VideoPlayer.initPlayer({
  playerId: 'fullscreen',
  mode: 'fullscreen',
  url: 'https://example.com/video.mp4',
  title: 'Video title',
  smallTitle: 'Video subtitle',
  artwork: 'https://example.com/poster.jpg',
  chromecast: true,
});

Supported Features

| Feature | iOS | Android | Web | | ------------------------------ | --- | ------- | --- | | Fullscreen native video player | ✅ | ✅ | ❌ | | Embedded web video player | ❌ | ❌ | ✅ | | Picture in Picture | ✅ | ✅ | ❌ | | Subtitles | ✅ | ✅ | ✅ | | DRM-protected playback | ✅ | ✅ | ❌ | | Chromecast sender playback | ❌ | ✅ | ❌ |

Chromecast (Android)

Chromecast is supported on Android in fullscreen mode. Enable it with the chromecast option. When a Cast session starts, the plugin loads the same media URL on the receiver, keeps the current playback position, and routes play, pause, seek, and timeline controls through the Cast session.

await VideoPlayer.initPlayer({
  mode: 'fullscreen',
  playerId: 'main-player',
  url: 'https://example.com/video.m3u8',
  title: 'Video title',
  smallTitle: 'Optional subtitle',
  artwork: 'https://example.com/artwork.jpg',
  chromecast: true,
  showControls: true,
});

Chromecast Options

| Option | Type | Default | Description | | ------------ | --------- | ------- | ---------------------------------------------------------- | | chromecast | boolean | true | Shows the Android Cast button and enables sender playback. | | title | string | "" | Title shown in the sender controls and receiver metadata. | | smallTitle | string | "" | Subtitle shown in the sender controls and metadata. | | artwork | string | "" | Image URL used for Cast metadata and sender Cast artwork. |

Requirements and Notes

  • The media URL must be reachable by the Chromecast device, not only by the Android app.
  • Cast support depends on the receiver app and device media support. MP4, HLS, DASH, and SmoothStreaming streams are mapped to Cast-compatible MIME types by the plugin.
  • Widevine DRM metadata is forwarded to the Cast media item. DRM-protected streams may still require a receiver that supports your license server and DRM flow.
  • Request headers used by the Android local player are not automatically available to the Chromecast receiver. Use public URLs, signed URLs, cookies supported by your receiver, or a custom receiver for secured media.

API

initPlayer(...)

initPlayer(options: capVideoPlayerOptions) => Promise<capVideoPlayerResult>

Initialize a video player

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | capVideoPlayerOptions |

Returns: Promise<capVideoPlayerResult>


isPlaying(...)

isPlaying(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Return if a given playerId is playing

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


play(...)

play(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Play the current video from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


pause(...)

pause(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Pause the current video from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


getDuration(...)

getDuration(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Get the duration of the current video from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


getCurrentTime(...)

getCurrentTime(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Get the current time of the current video from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


setCurrentTime(...)

setCurrentTime(options: capVideoTimeOptions) => Promise<capVideoPlayerResult>

Set the current time to seek the current video to from a given playerId

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | capVideoTimeOptions |

Returns: Promise<capVideoPlayerResult>


getVolume(...)

getVolume(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Get the volume of the current video from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


setVolume(...)

setVolume(options: capVideoVolumeOptions) => Promise<capVideoPlayerResult>

Set the volume of the current video to from a given playerId

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | capVideoVolumeOptions |

Returns: Promise<capVideoPlayerResult>


getMuted(...)

getMuted(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Get the muted of the current video from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


setMuted(...)

setMuted(options: capVideoMutedOptions) => Promise<capVideoPlayerResult>

Set the muted of the current video to from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------- | | options | capVideoMutedOptions |

Returns: Promise<capVideoPlayerResult>


setRate(...)

setRate(options: capVideoRateOptions) => Promise<capVideoPlayerResult>

Set the rate of the current video from a given playerId

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | capVideoRateOptions |

Returns: Promise<capVideoPlayerResult>


getRate(...)

getRate(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>

Get the rate of the current video from a given playerId

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | capVideoPlayerIdOptions |

Returns: Promise<capVideoPlayerResult>


stopAllPlayers()

stopAllPlayers() => Promise<capVideoPlayerResult>

Stop all players playing

Returns: Promise<capVideoPlayerResult>


showController()

showController() => Promise<capVideoPlayerResult>

Show controller

Returns: Promise<capVideoPlayerResult>


isControllerIsFullyVisible()

isControllerIsFullyVisible() => Promise<capVideoPlayerResult>

isControllerIsFullyVisible

Returns: Promise<capVideoPlayerResult>


exitPlayer()

exitPlayer() => Promise<capVideoPlayerResult>

Exit player

Returns: Promise<capVideoPlayerResult>


Interfaces

capVideoPlayerResult

| Prop | Type | Description | | ------------- | -------------------- | --------------------------------------------- | | result | boolean | result set to true when successful else false | | method | string | method name | | value | any | value returned | | message | string | message string |

capVideoPlayerOptions

| Prop | Type | Description | | --------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | mode | string | Player mode - "fullscreen" - "embedded" (Web only) | | url | string | The url of the video to play | | subtitle | string | The url of subtitle associated with the video | | language | string | The language of subtitle see https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers | | subtitleOptions | SubTitleOptions | SubTitle Options | | playerId | string | Id of DIV Element parent of the player | | rate | number | Initial playing rate | | exitOnEnd | boolean | Exit on VideoEnd (iOS, Android) default: true | | loopOnEnd | boolean | Loop on VideoEnd when exitOnEnd false (iOS, Android) default: false | | pipEnabled | boolean | Picture in Picture Enable (iOS, Android) default: true | | bkmodeEnabled | boolean | Background Mode Enable (iOS, Android) default: true | | showControls | boolean | Show Controls Enable (iOS, Android) default: true | | displayMode | string | Display Mode ["all", "portrait", "landscape"] (iOS, Android) default: "all" | | componentTag | string | Component Tag or DOM Element Tag (React app) | | width | number | Player Width (mode "embedded" only) | | height | number | Player height (mode "embedded" only) | | headers | { [key: string]: string; } | Headers for the request (iOS, Android) by Manuel García Marín (https://github.com/PhantomPainX) | | title | string | Title shown in the player and Chromecast metadata (iOS, Android) by Manuel García Marín (https://github.com/PhantomPainX) | | smallTitle | string | Subtitle shown below the title in the player and Chromecast metadata (iOS, Android) by Manuel García Marín (https://github.com/PhantomPainX) | | accentColor | string | ExoPlayer Progress Bar and Spinner color (Android) by Manuel García Marín (https://github.com/PhantomPainX) Must be a valid hex color code default: #FFFFFF | | chromecast | boolean | Chromecast enable/disable (iOS, Android) iOS requires Google Cast SDK setup and local network Info.plist keys. by Manuel García Marín (https://github.com/PhantomPainX) default: true | | artwork | string | Artwork url to be shown in Chromecast player (iOS, Android) by Manuel García Marín (https://github.com/PhantomPainX) default: "" | | drm | DrmOptions | DRM configuration for protected content (iOS: FairPlay, Android: Widevine) |

SubTitleOptions

| Prop | Type | Description | | --------------------- | ------------------- | ----------------------------------------------------- | | foregroundColor | string | Foreground Color in RGBA (default rgba(255,255,255,1) | | backgroundColor | string | Background Color in RGBA (default rgba(0,0,0,1) | | fontSize | number | Font Size in pixels (default 16) |

| Method | Signature | Description | | -------------------- | -------------------------------------------- | --------------------------------------- | | getPluginVersion | () => Promise<{ version: string; }> | Get the native Capacitor plugin version |

DrmOptions

| Prop | Type | Description | | --------------- | ------------------------------------------------------------------- | ------------------------------------ | | fairplay | FairPlayDrmOptions | FairPlay DRM configuration (iOS) | | playready | PlayreadyDrmOptions | PlayReady DRM configuration | | widevine | WidevineDrmOptions | Widevine DRM configuration (Android) |

FairPlayDrmOptions

| Prop | Type | Description | | ---------------------- | ------------------- | --------------------------------------------------------------------------------- | | certificateUrl | string | The URL to fetch the FairPlay certificate | | contentKeySpcUrl | string | The URL to send the SPC and receive the CKC license (FairPlay license server URL) |

PlayreadyDrmOptions

| Prop | Type | Description | | -------------------- | ------------------- | -------------------------------------- | | certificateUrl | string | The URL to fetch the PlayReady license |

WidevineDrmOptions

| Prop | Type | Description | | -------------------- | ------------------- | ------------------------------------- | | certificateUrl | string | The URL to fetch the Widevine license |

capVideoPlayerIdOptions

| Prop | Type | Description | | -------------- | ------------------- | -------------------------------------- | | playerId | string | Id of DIV Element parent of the player |

capVideoTimeOptions

| Prop | Type | Description | | -------------- | ------------------- | -------------------------------------- | | playerId | string | Id of DIV Element parent of the player | | seektime | number | Video time value you want to seek to |

capVideoVolumeOptions

| Prop | Type | Description | | -------------- | ------------------- | -------------------------------------- | | playerId | string | Id of DIV Element parent of the player | | volume | number | Volume value between [0 - 1] |

capVideoMutedOptions

| Prop | Type | Description | | -------------- | -------------------- | -------------------------------------- | | playerId | string | Id of DIV Element parent of the player | | muted | boolean | Muted value true or false |

capVideoRateOptions

| Prop | Type | Description | | -------------- | ------------------- | -------------------------------------- | | playerId | string | Id of DIV Element parent of the player | | rate | number | Rate value |