跳过主要内容
返回插件
@capgo/capacitor-streamcall
教程
@capgo/capacitor-streamcall

Streamcall

使用Stream SDK实现实时视频通话和直播

指南

Streamcall 的教程

使用 @capgo/capacitor-stream-call

依赖于 https://getstream.io/ 使用 SDK 来实现 Capacitor 的呼叫功能

安装

bun add @capgo/capacitor-stream-call
bunx cap sync

此插件暴露的内容

  • login - 登录到 Stream 视频服务
  • logout - 从 Stream Video 服务中注销。
  • call - 向另一个用户发起电话呼叫。
  • endCall - 结束当前电话。

示例用途

login

登录到 Stream Video 服务。

import { StreamCall } from '@capgo/capacitor-stream-call';

await StreamCall.login({
  token: 'your-token',
  userId: 'user-123',
  name: 'John Doe',
  apiKey: 'your-api-key'
});

logout

从 Stream Video 服务中注销。

import { StreamCall } from '@capgo/capacitor-stream-call';

await StreamCall.logout();

call

- 向另一个用户发起电话呼叫。

import { StreamCall } from '@capgo/capacitor-stream-call';

await StreamCall.call({
  userId: 'user-456',
  type: 'video',
  ring: true
});

endCall

- 结束当前电话。

import { StreamCall } from '@capgo/capacitor-stream-call';

await StreamCall.endCall();

全局参考

继续使用 @capgo/capacitor-stream-call

如果您正在使用 使用 @capgo/capacitor-stream-call 来规划原生插件工作,连接它与 @capgo/capacitor-stream-call 了解 @capgo/capacitor-stream-call 中的实现细节, 开始使用 了解开始使用中的实现细节, Capgo 插件目录 了解 Capgo 插件目录中的产品工作流程, Capacitor 由 Capgo 提供的插件 了解 Capacitor 由 Capgo 提供的插件中的实现细节, 添加或更新插件 为添加或更新插件提供实现细节。