WebRTC · 시니어 안전망의 핵심
| 모드 | 설명 |
|---|---|
| 🤖 AI 화상 | 실벗 AI 아바타와 영상 대화 — 표정 분석으로 컨디션 체크 |
| 👨👩👧 가족 화상 | 1:1 가족, 다자간 가족 (최대 5명) 그룹 통화 |
| 🆘 응급 화상 | SOS 발동 시 자동 연결 — 가족·119·관제센터 동시 |
// js/video-call.js — 가족 화상통화 async function startCall(targetUserId){ const stream = await navigator.mediaDevices.getUserMedia({video:true, audio:true}); localVideo.srcObject = stream; const pc = new RTCPeerConnection({ iceServers: [{urls:'stun:stun.l.google.com:19302'}] }); stream.getTracks().forEach(t => pc.addTrack(t, stream)); pc.ontrack = e => remoteVideo.srcObject = e.streams[0]; pc.onicecandidate = e => e.candidate && ws.send(JSON.stringify({type:'ice', candidate:e.candidate, to:targetUserId})); const offer = await pc.createOffer(); await pc.setLocalDescription(offer); ws.send(JSON.stringify({type:'offer', sdp:offer, to:targetUserId})); } // 자동 자막 const rec = new webkitSpeechRecognition(); rec.continuous = true; rec.interimResults = true; rec.lang = 'ko-KR'; rec.onresult = e => subtitle.textContent = e.results[e.results.length-1][0].transcript; rec.start();