SCALE — Build Lab
機能パターン · REACT COMPONENT

WebRTC ビデオ通話

CATEGORY機能パターン TYPEReact Component EFFORT240〜480分 DIFFICULTY
PRIMARY CODE
ts
import DailyIframe from '@daily-co/daily-js';

const callFrame = DailyIframe.createFrame({
  showLeaveButton: true,
  iframeStyle: { position: 'fixed', width: '100%', height: '100%', top: 0, left: 0 },
});

await callFrame.join({ url: 'https://your-domain.daily.co/room-id' });

callFrame.on('participant-joined', (e) => console.log('Joined:', e.participant.user_name));
callFrame.on('left-meeting', () => callFrame.destroy());
DEPENDENCIES
@daily-co/daily-js
前提条件
Tailwind CSS v4TypeScript 5
USE CASES
  • 任意のダッシュボードに組み込み

WebRTC ビデオ通話

:LiTarget: 用途

P2Pビデオ通話。Daily.co / Twilio / 自前WebRTC。

:LiSparkle: 特徴

  • ビデオ/音声
  • 画面共有
  • 複数人対応
  • チャット

:LiCode: コード(コピペ用)

import DailyIframe from '@daily-co/daily-js';

const callFrame = DailyIframe.createFrame({
  showLeaveButton: true,
  iframeStyle: { position: 'fixed', width: '100%', height: '100%', top: 0, left: 0 },
});

await callFrame.join({ url: 'https://your-domain.daily.co/room-id' });

callFrame.on('participant-joined', (e) => console.log('Joined:', e.participant.user_name));
callFrame.on('left-meeting', () => callFrame.destroy());

:LiHandPointer: 使い方

対象プロジェクトに該当ファイルをコピーして、props を流し込むだけ。

:LiAlertCircle: 注意事項

  • 依存パッケージを忘れず追加