指南
Streamcall 教程
使用 @capgo/capacitor-stream-call
使用 https://getstream.io/ SDK 来实现 Capacitor 中的呼叫。
安装
bun add @capgo/capacitor-stream-call
bunx cap sync
该插件暴露了什么
login- 登录到流媒体视频服务logout- 从流媒体视频服务注销call- 向另一个用户发起电话endCall- 结束当前通话
示例用法
login
登录到流媒体视频服务
import { StreamCall } from '@capgo/capacitor-stream-call';
await StreamCall.login({
token: 'your-token',
userId: 'user-123',
name: 'John Doe',
apiKey: 'your-api-key'
});
logout
从流媒体视频服务注销
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();
完整参考
- GitHub: https://github.com/Cap-go/capacitor-streamcall/
- 文档:/docs/plugins/streamcall/
继续使用 @capgo/capacitor-stream-call
如果您正在使用 使用 @capgo/capacitor-stream-call 规划原生插件工作时,连接它到 @capgo/capacitor-stream-call 查看 @capgo/capacitor-stream-call 获取开始 查看获取开始 Capgo 插件目录 查看 Capgo 插件目录 Capacitor Capgo 为 Capacitor Capgo 的实现细节 添加或更新插件 添加或更新插件的实现细节