-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
136 lines (117 loc) · 4.55 KB
/
index.html
File metadata and controls
136 lines (117 loc) · 4.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<html style="overflow: auto;">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WebRTC Audio to Avatar real time demo</title>
<link rel="stylesheet" href="./style.css">
<!-- pixiv three-vrm.js -->
<!-- https://threejs.org/docs/#manual/en/introduction/Installation -->
<script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.155.0/build/three.module.js",
"three/addons/": "https://unpkg.com/three@0.155.0/examples/jsm/",
"@pixiv/three-vrm": "https://unpkg.com/@pixiv/three-vrm@2.0.1/lib/three-vrm.module.min.js"
}
}
</script>
</head>
<body>
<h2>Options</h2>
<div class="option">
<input id="use-datachannel" type="checkbox"/>
<label for="use-datachannel">Use datachannel</label>
<select id="datachannel-parameters">
<option value='{"ordered": true}'>Ordered, reliable</option>
<option value='{"ordered": false, "maxRetransmits": 0}'>Unordered, no retransmissions</option>
<option value='{"ordered": false, "maxPacketLifetime": 500}'>Unordered, 500ms lifetime</option>
</select>
</div>
<div class="option">
<input id="use-audio" checked="checked" type="checkbox"/>
<label for="use-audio">Use audio</label>
<select id="audio-codec">
<option value="default" selected>Default codecs</option>
<option value="opus/48000/2">Opus</option>
<option value="PCMU/8000">PCMU</option>
<option value="PCMA/8000">PCMA</option>
</select>
</div>
<div class="option">
<input id="use-video" type="checkbox"/>
<label for="use-video">Use video</label>
<select id="video-resolution">
<option value="" selected>Default resolution</option>
<option value="320x240">320x240</option>
<option value="640x480">640x480</option>
<option value="960x540">960x540</option>
<option value="1280x720">1280x720</option>
</select>
<select id="video-transform">
<option value="none" selected>No transform</option>
<option value="edges">Edge detection</option>
<option value="cartoon">Cartoon effect</option>
<option value="rotate">Rotate</option>
</select>
<select id="video-codec">
<option value="default" selected>Default codecs</option>
<option value="VP8/90000">VP8</option>
<option value="H264/90000">H264</option>
</select>
</div>
<div class="option">
<input id="use-stun" type="checkbox"/>
<label for="use-stun">Use STUN server</label>
</div>
<button id="start">Start</button>
<button id="stop" style="display: none">Stop</button>
<h2>State</h2>
<p>
ICE gathering state: <span id="ice-gathering-state"></span>
</p>
<p>
ICE connection state: <span id="ice-connection-state"></span>
</p>
<p>
Signaling state: <span id="signaling-state"></span>
</p>
<div id="media" style="display: none">
<h2>Media</h2>
<audio id="audio" autoplay="true"></audio>
<video id="video" autoplay="true" playsinline="true"></video>
</div>
<h2>Avatar Interface</h2>
<div class="interface" id="interface">
<div class="closebtn" id="hideInterface">❌</div>
<div class="sliders" id="sliders">
<p>
<span class="controlboxlabel">Input Volume VU</span>
<input type="range" min="0" max="100" value="10" class="slider" id="inputlevel">
<br>
<span class="controlboxlabel">Mouth Threshold</span>
<input type="range" min="0" max="50" value="10" class="slider" id="mouththreshold">
<br>
<span class="controlboxlabel">Body Threshold</span>
<input type="range" min="0" max="50" value="10" class="slider" id="bodythreshold">
<br>
<span class="controlboxlabel">Mouth Gain Boost</span>
<input type="range" min="0" max="25" value="10" class="slider" id="mouthboost">
<br>
<span class="controlboxlabel">Body Gain Boost</span>
<input type="range" min="0" max="25" value="10" class="slider" id="bodymotion">
<br>
<span class="controlboxlabel">Serious / Smiling</span>
<input type="range" min="0" max="100" value="35" class="slider" id="expression">
</p>
</div>
</div>
<script type="module" src="VRMAvatar.js"></script>
<script type="module" src="client.js"></script>
<h2>SDP</h2>
<h3>Offer</h3>
<pre id="offer-sdp"></pre>
<h3>Answer</h3>
<pre id="answer-sdp"></pre>
</body>
</html>