Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
docs/ | ||
test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Ayame RecvOnly Sample</title> | ||
</head> | ||
<body> | ||
<header class="sticky row"> | ||
<h4>Ayame RecvOnly Sample</h4> | ||
</header> | ||
<div> | ||
<p>ルームID | ||
<input id="roomIdInput" disabled type="text" value=""></input> | ||
</p> | ||
<p>クライアントID | ||
<input id="clientIdInput" disabled type="text" value=""></input> | ||
</p> | ||
<button onclick="startConn();">接続</button> | ||
<button onclick="conn.disconnect();">切断</button> | ||
</div> | ||
<div style="float:right;"> | ||
<video id="remote-video" autoplay="" style="width: 400px; height: 300px; border: 1px solid black;"></video> | ||
</div> | ||
<script src="../dist/ayame.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qs/6.7.0/qs.min.js"></script> | ||
<script src="./main.js"></script> | ||
<script type="text/javascript"> | ||
const options = Ayame.defaultOptions; | ||
options.clientId = clientId ? clientId : options.clientId; | ||
options.video.direction = 'recvonly'; | ||
options.audio.direction = 'recvonly'; | ||
options.video.codec = 'H264'; | ||
options.audio.codec = 'OPUS'; | ||
const conn = Ayame.connection(signalingUrl, roomId, options, true); | ||
const startConn = async () => { | ||
const authnMetadata = {hoge: "fuga"}; | ||
await conn.connect(null, authnMetadata); | ||
conn.on('connect', ({authzMetadata}) => console.log(authzMetadata)); | ||
conn.on('disconnect', (e) => console.log(e)); | ||
conn.on('addstream', (e) => { | ||
document.querySelector('#remote-video').srcObject = e.stream; | ||
}); | ||
}; | ||
document.querySelector("#roomIdInput").value = roomId; | ||
document.querySelector("#clientIdInput").value = options.clientId; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Ayame SendOnly Sample</title> | ||
</head> | ||
<body> | ||
<header class="sticky row"> | ||
<h4>Ayame SendOnly Sample</h4> | ||
</header> | ||
<div> | ||
<p>ルームID | ||
<input id="roomIdInput" disabled type="text" value=""></input> | ||
</p> | ||
<p>クライアントID | ||
<input id="clientIdInput" disabled type="text" value=""></input> | ||
</p> | ||
<button onclick="startConn();">接続</button> | ||
<button onclick="conn.disconnect();">切断</button> | ||
</div> | ||
<div style="float:left;"> | ||
<video id="local-video" muted autoplay style="width: 400px; height: 300px; border: 1px solid black;"></video> | ||
</div> | ||
<script src="../dist/ayame.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qs/6.7.0/qs.min.js"></script> | ||
<script src="./main.js"></script> | ||
<script type="text/javascript"> | ||
const options = Ayame.defaultOptions; | ||
options.clientId = clientId ? clientId : options.clientId; | ||
options.video.direction = 'sendonly'; | ||
options.audio.direction = 'sendonly'; | ||
const conn = Ayame.connection(signalingUrl, roomId, options, true); | ||
const startConn = async () => { | ||
const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); | ||
conn.on('disconnect', (e) => console.log(e)); | ||
const stream = await conn.connect(mediaStream); | ||
document.querySelector('#local-video').srcObject = stream; | ||
}; | ||
document.querySelector("#roomIdInput").value = roomId; | ||
document.querySelector("#clientIdInput").value = options.clientId; | ||
</script> | ||
</body> | ||
</html> |