メインコンテンツへスキップ
@capgo/capacitor-stream-call コミュニケーション オープンソース

Streamcall Capacitor プラグイン

Stream SDK でビデオ通話とライブストリーミングを統合し、リアルタイム通信を実現

インストール

bun add @capgo/capacitor-stream-call bunx cap sync
npm、pnpm、または yarn
  • npm install @capgo/capacitor-stream-call
  • pnpm add @capgo/capacitor-stream-call
  • yarn add @capgo/capacitor-stream-call

ガイド

Capacitor で Streamcall を使う方法

@capgo/capacitor-stream-call の使い方

使用: https://getstream.io/ Capacitor で通話機能を実装するには SDK を使用します。

インストール

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

bunx cap sync プラグインのネイティブcodeをネイティブプロジェクトにコピーします。プラグインをアップグレードするたびに再度実行してください。

インポート

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

API の概要

メソッド 説明
login Stream Video サービスにログインします。
logout Stream Video サービスからログアウトします。
call 他のユーザーへの通話を開始します。
endCall 現在の通話を終了します。
joinCall 既存の通話に参加します。
setMicrophoneEnabled マイクを有効化/無効化します。
setCameraEnabled カメラの有効/無効を切り替えます。
enableBluetooth Bluetoothオーディオを有効にします。
acceptCall 着信に応答します。
rejectCall 着信を拒否します。
isCameraEnabled カメラが有効かどうかを確認します。
getCallStatus 現在の通話ステータスを取得します。
getRingingCall 現在着信中の通話を取得します。
toggleViews 利用可能なビデオレイアウトを切り替えます。
setSpeaker スピーカーフォンをオンにします。
switchCamera カメラを切り替えます。
getCallInfo 発信者情報を含む、アクティブな通話の詳細を取得します。
setDynamicStreamVideoApikey 静的なキーを上書きする動的な Stream Video API キーを設定します。
getDynamicStreamVideoApikey 現在設定されている動的な Stream Video API キーを取得します。
getCurrentUser 現在のユーザーの情報を取得します。

例

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();

joinCall()

既存の通話に参加します。

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

await StreamCall.joinCall({ callId: 'call001', callType: 'default' });

setMicrophoneEnabled()

マイクを有効化/無効化します。

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

await StreamCall.setMicrophoneEnabled({ enabled: false });

上記の表は20個のコアメソッドを一覧にしたものです。リスナーとバージョンヘルパー、および各メソッドの完全なコントラクトは、次のドキュメントに記載されています。 GitHub リポジトリ.

イベントをリッスンする

addListener ハンドルを返します。画面がアンマウントされるときに handle.remove() 画面がアンマウントされるとき、または StreamCall.removeAllListeners() すべてのリスナーを解除します。

完全なリファレンス

@capgo/capacitor-stream-call の使用方法から続ける

使用している場合 @capgo/capacitor-stream-call の使い方 ネイティブプラグインの作業を計画するには、次と連携してください: @capgo/capacitor-stream-call @capgo/capacitor-stream-call の実装詳細については、 スタートガイド スタートガイドの実装詳細については、 Capgo プラグインディレクトリ Capgo プラグインディレクトリのプロダクトワークフローについては、 Capgo による Capacitor プラグイン Capgo による Capacitor Plugins の実装詳細、および プラグインの追加または更新 プラグインの追加または更新に関する実装詳細についてはこちら。

よくある質問

Streamcall プラグイン FAQ

Capacitor アプリに Streamcall プラグインをインストールするにはどうすればよいですか?

"bun add @capgo/capacitor-stream-call" (または "npm install @capgo/capacitor-stream-call") を実行した後、"bunx cap sync" を実行して、iOS および Android プロジェクトにネイティブの code を反映させます。アプリの code から "@capgo/capacitor-stream-call" をインポートしてください。

@capgo/capacitor-stream-call は React、Vue、Angular で動作しますか?

はい。Streamcall は Capacitor パッケージなので、Ionic、React、Vue、Angular、Svelte、素の JavaScript など、Capacitor 上で動くあらゆる Web フレームワークで使えます。

@capgo/capacitor-stream-call はどの Capacitor バージョンをサポートしていますか?

Capgo プラグインは Capacitor のメジャーバージョンに合わせています。使用している Capacitor のメジャーバージョンに一致するプラグインのメジャーバージョンを使ってください (例: Capacitor 8 ならプラグイン v8)。GitHub の README にある互換性テーブルに、メンテナンス中のバージョンが記載されています。

@capgo/capacitor-stream-call は無料でオープンソースですか?

はい。code のソースコードは GitHub の https://github.com/Cap-go/capacitor-streamcall/ で公開されており、パッケージは npm から無料でインストールできます。バグ報告やプルリクエストも歓迎です。

App Store の審査なしで、Streamcall を使っている code を更新できますか?

プラグインのインストールやアップグレードはネイティブの code を変更するため、新しいストアビルドが必要です。その後は、プラグインを呼び出す JavaScript、HTML、CSS の変更を Capgo Live Updates で即座に配信できます。

アプリの審査を待たずに Streamcall の変更をリリース

プラグインをストア用ビルドに組み込めば、Capgo live updates で JavaScript、HTML、CSS の変更を数分でユーザーに配信できます

Capgo から始める