ㄴㅇㄹ

This commit is contained in:
2025-09-20 11:37:58 +09:00
parent 161b18d10a
commit 66c4d6f7e5
3 changed files with 4 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
</head> </head>
<body> <body>
<div id="webrtc-controls"> <div id="webrtc-controls">
<audio id="call" autoplay controls></audio>
<input type="text" id="peer-id-input" placeholder="상대방 ID 입력"> <input type="text" id="peer-id-input" placeholder="상대방 ID 입력">
<button id="call-btn">전화걸기</button> <button id="call-btn">전화걸기</button>
<button id="hangup-btn">끊기</button> <button id="hangup-btn">끊기</button>

View File

@@ -47,7 +47,8 @@ export class UIController {
// 원격 스트림 수신 시 자동 재생 // 원격 스트림 수신 시 자동 재생
rtcManager.onRemoteStream = (stream) => { rtcManager.onRemoteStream = (stream) => {
const audio = new Audio(); // const audio = new Audio();
const audio = document.querySelector('#call');
console.log(rtcManager) console.log(rtcManager)
console.log(stream) console.log(stream)
audio.muted = false; audio.muted = false;

View File

@@ -206,7 +206,7 @@ export class WebRTCManager {
hangup() { hangup() {
this.pc?.close(); this.pc?.close();
this.localStream?.getTracks().forEach(t => t.stop()); this.localStream?.getTracks().forEach(t => t.stop());
this.ws?.close(); // this.ws?.close();
console.log('📞 통화 종료'); console.log('📞 통화 종료');
} }
} }