@capgo/capacitor-ivs-player

中文文档
8.0.44发布于 2026/10/15MPL-2.0TypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 4万

Ivs player for capacitor app

原始使用文档
文档目录46 节
  1. ➡️ Get started for free
  2. Key features
  3. Documentation
  4. Compatibility
  5. Install
  6. API
  7. create(...)
  8. start()
  9. cast()
  10. getCastStatus()
  11. pause()
  12. delete()
  13. getUrl()
  14. getState()
  15. setPlayerPosition(...)
  16. getPlayerPosition()
  17. setAutoQuality(...)
  18. getAutoQuality()
  19. setPip(...)
  20. getPip()
  21. setFrame(...)
  22. getFrame()
  23. setBackgroundState(...)
  24. getBackgroundState()
  25. setMute(...)
  26. getMute()
  27. setQuality(...)
  28. getQuality()
  29. getQualities()
  30. getPluginVersion()
  31. addListener('startPip', ...)
  32. addListener('stopPip', ...)
  33. addListener('expandPip', ...)
  34. addListener('closePip', ...)
  35. addListener('onState', ...)
  36. addListener('onCues', ...)
  37. addListener('onDuration', ...)
  38. addListener('onError', ...)
  39. addListener('onRebuffering', ...)
  40. addListener('onSeekCompleted', ...)
  41. addListener('onVideoSize', ...)
  42. addListener('onQuality', ...)
  43. addListener('onCastStatus', ...)
  44. removeAllListeners()
  45. Interfaces
  46. Type Aliases

@capgo/capacitor-ivs-player

Play Amazon IVS live streams in your Capacitor app with the native IVS player on iOS and Android, including picture in picture and playback events.

Capgo - Build Capacitor apps with AI, ship updates instantly

Capgo: push fixes to your Capacitor users in minutes, build signed iOS and Android apps without a Mac, and roll back in one click.

➡️ Get started for free

14-day unlimited free trial. No credit card required

🤖 Building with an AI coding agent? Install Capgo skills so Claude Code, Codex, Cursor, Copilot, or Gemini CLI know how to install and use @capgo/capacitor-ivs-player in your Capacitor app: npx skills add Cap-go/capgo-skills. Then ask your agent: "Add @capgo/capacitor-ivs-player to my Capacitor app and wire it up." Agent setup guides · Hosted MCP

@capgo/capacitor-ivs-player for Capacitor apps

Key features

  • Player: create() with a stream URL, then start(), pause() and delete().
  • Layout: setFrame() and setPlayerPosition() place the native player in front of or behind your web UI.
  • Picture in picture: setPip() with startPip, stopPip and closePip events.
  • Quality: setAutoQuality() and quality change events.
  • Playback events: state, duration, cues, rebuffering, seek and error listeners.
  • Platforms: iOS and Android. Uses the Amazon IVS player SDKs. Not available on web.

Documentation

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

Compatibility

Plugin versionCapacitor compatibilityMaintained
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

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-ivs-player` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

npm install @capgo/capacitor-ivs-player
npx cap sync

API

create(...)

create(options: { url: string; pip?: boolean; title?: string; subtitle?: string; cover?: string; autoPlay?: boolean; toBack?: boolean; x?: number; y?: number; width?: number; height?: number; }) => Promise<void>
ParamType
options{ url: string; pip?: boolean; title?: string; subtitle?: string; cover?: string; autoPlay?: boolean; toBack?: boolean; x?: number; y?: number; width?: number; height?: number; }

start()

start() => Promise<void>

cast()

cast() => Promise<void>

getCastStatus()

getCastStatus() => Promise<{ isActive: boolean; }>

Returns: Promise<{ isActive: boolean; }>


pause()

pause() => Promise<void>

delete()

delete() => Promise<void>

getUrl()

getUrl() => Promise<{ url: string; }>

Returns: Promise<{ url: string; }>


getState()

getState() => Promise<{ state: CapacitorIvsPlayerState; }>

Returns: Promise<{ state: CapacitorIvsPlayerState; }>


setPlayerPosition(...)

setPlayerPosition(options?: { toBack: boolean; } | undefined) => Promise<void>
ParamType
options{ toBack: boolean; }

getPlayerPosition()

getPlayerPosition() => Promise<{ toBack: boolean; }>

Returns: Promise<{ toBack: boolean; }>


setAutoQuality(...)

setAutoQuality(options?: { autoQuality?: boolean | undefined; } | undefined) => Promise<void>
ParamType
options{ autoQuality?: boolean; }

getAutoQuality()

getAutoQuality() => Promise<{ autoQuality: boolean; }>

Returns: Promise<{ autoQuality: boolean; }>


setPip(...)

setPip(options?: { pip?: boolean | undefined; } | undefined) => Promise<void>
ParamType
options{ pip?: boolean; }

getPip()

getPip() => Promise<{ pip: boolean; }>

Returns: Promise<{ pip: boolean; }>


setFrame(...)

setFrame(options?: { x?: number | undefined; y?: number | undefined; width?: number | undefined; height?: number | undefined; } | undefined) => Promise<void>

Set the frame of the player view, all number have to be positive and integers

ParamTypeDescription
options{ x?: number; y?: number; width?: number; height?: number; }: number, y: number, width: number, height: number}

Since: 1.0.0


getFrame()

getFrame() => Promise<CapacitorFrame>

Returns: Promise<CapacitorFrame>


setBackgroundState(...)

setBackgroundState(options: { backgroundState: CapacitorIvsPlayerBackgroundState; }) => Promise<void>
ParamType
options{ backgroundState: CapacitorIvsPlayerBackgroundState; }

getBackgroundState()

getBackgroundState() => Promise<{ backgroundState: CapacitorIvsPlayerBackgroundState; }>

Returns: Promise<{ backgroundState: CapacitorIvsPlayerBackgroundState; }>


setMute(...)

setMute(options?: { muted?: boolean | undefined; } | undefined) => Promise<void>
ParamType
options{ muted?: boolean; }

getMute()

getMute() => Promise<{ mute: boolean; }>

Returns: Promise<{ mute: boolean; }>


setQuality(...)

setQuality(options?: { quality: string; } | undefined) => Promise<void>
ParamType
options{ quality: string; }

getQuality()

getQuality() => Promise<{ quality: string; }>

Returns: Promise<{ quality: string; }>


getQualities()

getQualities() => Promise<{ qualities: string[]; }>

Returns: Promise<{ qualities: string[]; }>


getPluginVersion()

getPluginVersion() => Promise<{ version: string; }>

Get the native Capacitor plugin version

Returns: Promise<{ version: string; }>


addListener('startPip', ...)

addListener(eventName: 'startPip', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for start pip

ParamType
eventName'startPip'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('stopPip', ...)

addListener(eventName: 'stopPip', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for stop pip

ParamType
eventName'stopPip'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('expandPip', ...)

addListener(eventName: 'expandPip', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for expend pip

ParamType
eventName'expandPip'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('closePip', ...)

addListener(eventName: 'closePip', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for close pip

ParamType
eventName'closePip'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onState', ...)

addListener(eventName: 'onState', listenerFunc: (data: { state: CapacitorIvsPlayerState; }) => void) => Promise<PluginListenerHandle>

Listen for state changes

ParamType
eventName'onState'
listenerFunc(data: { state: CapacitorIvsPlayerState; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onCues', ...)

addListener(eventName: 'onCues', listenerFunc: (data: { cues: string; }) => void) => Promise<PluginListenerHandle>

Listen for cue changes

ParamType
eventName'onCues'
listenerFunc(data: { cues: string; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onDuration', ...)

addListener(eventName: 'onDuration', listenerFunc: (data: { duration: number; }) => void) => Promise<PluginListenerHandle>

Listen for duration changes

ParamType
eventName'onDuration'
listenerFunc(data: { duration: number; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onError', ...)

addListener(eventName: 'onError', listenerFunc: (data: { error: string; }) => void) => Promise<PluginListenerHandle>

Listen for errors

ParamType
eventName'onError'
listenerFunc(data: { error: string; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onRebuffering', ...)

addListener(eventName: 'onRebuffering', listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for rebuffering

ParamType
eventName'onRebuffering'
listenerFunc() => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onSeekCompleted', ...)

addListener(eventName: 'onSeekCompleted', listenerFunc: (data: { position: number; }) => void) => Promise<PluginListenerHandle>

Listen for position changes

ParamType
eventName'onSeekCompleted'
listenerFunc(data: { position: number; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onVideoSize', ...)

addListener(eventName: 'onVideoSize', listenerFunc: (data: { width: number; height: number; }) => void) => Promise<PluginListenerHandle>

Listen for video size changes

ParamType
eventName'onVideoSize'
listenerFunc(data: { width: number; height: number; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onQuality', ...)

addListener(eventName: 'onQuality', listenerFunc: (data: { quality: string; }) => void) => Promise<PluginListenerHandle>

Listen for quality changes

ParamType
eventName'onQuality'
listenerFunc(data: { quality: string; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onCastStatus', ...)

addListener(eventName: 'onCastStatus', listenerFunc: (data: { isActive: boolean; }) => void) => Promise<PluginListenerHandle>

Listen for cast status changes

ParamType
eventName'onCastStatus'
listenerFunc(data: { isActive: boolean; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 1.0.0


Interfaces

CapacitorFrame

PropType
xnumber
ynumber
widthnumber
heightnumber

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

CapacitorIvsPlayerState

'IDLE' | 'BUFFERING' | 'READY' | 'PLAYING' | 'ENDED' | 'UNKNOWN'

CapacitorIvsPlayerBackgroundState

'PAUSED' | 'PLAYING'

Credits

This plugin was created originally for Kick.com by Capgo

版本与发布记录

@capgo/capacitor-ivs-player 共发布 65 个版本,首次发布于 2025/10/26;过去 12 个月发布了 51 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
8.0.44latest2026/10/1525 天前
8.0.432026/10/1327 天前
8.0.422026/10/1227 天前
8.0.412026/10/091 个月前
8.0.402026/10/091 个月前
8.0.392026/10/091 个月前

关于 @capgo/capacitor-ivs-player 的常见问题

@capgo/capacitor-ivs-player 是什么?

Ivs player for capacitor app

如何安装 @capgo/capacitor-ivs-player?

在项目目录运行 npm install @capgo/capacitor-ivs-player,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@capacitor/core(>=8.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@capgo/capacitor-ivs-player 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@capgo/capacitor-ivs-player 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@capgo/capacitor-ivs-player 可以商用吗?

@capgo/capacitor-ivs-player 使用 MPL-2.0 许可。弱 Copyleft:可以商用,也可以和闭源代码一起使用;但如果分发时修改了 MPL 授权的文件,这些文件的修改需以 MPL 开源。以上为概括,不构成法律意见,请以许可原文为准。

@capgo/capacitor-ivs-player 的下载量有多少?

根据 npm 官方下载统计,@capgo/capacitor-ivs-player 在 2026/10/09 – 2026/11/07 这 30 天内被下载 39,913 次,日均约 1,330 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@capgo/capacitor-ivs-player 还在维护吗?

最新版本 8.0.44 发布于 2026/10/15(25 天前);至今共发布 65 个版本,其中过去 12 个月发布了 51 个;首次发布于 2025/10/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。