Browser
브라우저로 간단한 통신 앱을 개발합니다.
준비사항
가장 쉬운 통화앱 개발
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
video#remoteVideo { width:auto; height: 80%; background-color: black; }
button#connectChannelButton { position:absolute; overflow:visible; left:50%; top:10px; }
html,body { height:100%; }
</style>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://remotemonster.com/sdk/remon.min.js"></script>
<script>
let isConnected = false;
const config = { credential: {
key: '1234567890', serviceId: 'SERVICEID1'
},
view: {
remote: '#remoteVideo'
},
};
const remon = new Remon({ config:config });
function start() {
if (isConnected === false){
isConnected = true;
document.getElementById("connectChannelButton").innerHTML = "Close";
remon.connectChannel("simpleRemon");
}else{
isConnected = false;
document.getElementById("connectChannelButton").innerHTML = "Connect";
remon.disconnect();
}
}
</script>
<title>Remon JS Simple Test</title>
</head>
<body>
<video id="remoteVideo" autoplay controls class="video"></video>
<button id="connectChannelButton" class="btn btn-sm" onclick="start();">Connect</button>
</body>
</html>소스를 살펴보기
Config
Connect
LocalVideo 생성
Callback 이벤트 처리기 사용하기
Last updated