import { IPlatformWebRTC } from "./adapter.inteerfce"; export class PlatformAdapter implements IPlatformWebRTC { createPeerConnection(config: RTCConfiguration) { return new RTCPeerConnection(config); } createSessionDescription(init: RTCSessionDescriptionInit) { return new RTCSessionDescription(init); } createIceCandidate(init: RTCIceCandidateInit) { return new RTCIceCandidate(init); } async getUserMedia(): Promise { if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { throw new Error("getUserMedia is not supported in this browser"); } return await navigator.mediaDevices.getUserMedia({ audio: { echoCancellation: true, noiseSuppression: true, autoGainControl: true, }, video: { width: { min: 480, ideal: 720, max: 1280 }, height: { min: 360, ideal: 540, max: 960 }, frameRate: { ideal: 30, max: 30 }, }, }); } switchCamera(mediaStream: MediaStream): Promise { console.warn("카메라 전환은 웹 플랫폼에서 지원되지 않습니다."); return Promise.resolve(false); } }