forked from svarunan/serverless-webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
127 lines (114 loc) · 2.93 KB
/
index.html
File metadata and controls
127 lines (114 loc) · 2.93 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
<!DOCTYPE html>
<html>
<head>
<title>Plain webRTC</title>
<style type="text/css">
html {
height: 100%;
}
body {
height: 100%;
}
#cfg {
display: block;
width: 100%;
}
#cfg textarea {
width: 100%;
}
#cfg button {
width: 100%;
height: 50px;
font-size: 1.5em;
}
#start {
display: none;
width: 100%;
}
#start button {
width: 45%;
margin: 10px;
height: 50px;
font-size: 1.5em;
}
#have-local-offer {
display: none;
font-size: 1.5em;
}
#have-local-offer button {
font-size: 1em;
}
#connecting {
display: none;
font-size: 1.5em;
}
/* videos */
#videos {
display: none;
height: 100%;
}
#local {
display: block;
position: absolute;
right: 0;
top: 0;
height: 30%;
z-index: 1;
}
#remote {
z-index: 0;
height: 95%;
}
#endCall {
font-size: 1em;
display: block;
position: absolute;
right: 50px;
bottom: 50px;
height: 50px;
z-index: 1;
}
</style>
<script src="js/lz-string.min.js"></script>
</head>
<body>
<div id="cfg">
<label for="cfgText">Конфигурация</label>
<textarea id="cfgText" rows="4">{ "iceServers": [{ "urls": "stun:stun.l.google.com:19302" }] }</textarea>
<button id="saveCfg">Применить</button>
</div>
<div id="start">
<button id="createCall">Создать вызов</button>
<button id="acceptCall">Принять вызов</button>
</div>
<div id="have-local-offer">
Вызов создан. Теперь:
<ol>
<li>Заходи в любой мессенджер (Telegram, WhatsApp), в котором ты можешь мне отправить текстовое сообщение</li>
<li>Вставь текст (это вызов) и отправь его мне</li>
<li>Жди ответа от меня, я пришлю другой текст (это ответ на твой вызов)</li>
<li>Скопируй его в мессенджере и возвращайся в браузер</li>
<li>Нажми <button id="remoteOfferGot">Кнопку 2</button></li>
</ol>
</div>
<div id="connecting">
Вызов принят. Теперь:
<ol>
<li>Заходи в любой мессенджер (Telegram, WhatsApp), в котором ты можешь мне отправить текстовое сообщение</li>
<li>Отправь мне текст из буфера обмена (это ответ на вызов)</li>
<li>Возвращайся в браузер и жди соединения</li>
</ol>
</div>
<div id="videos">
<video id="local" controls autoplay></video>
<video id="remote" controls autoplay></video>
<button id="endCall">Завершить вызов</button>
</div>
<script src="js/plainwebrtc.js"></script>
</body>
</html>
<!--
TODO
1. text too long, need to zip and somehow stringify it (maybe base64) - json is too long for telegram
2. works only on local network for some reason
-->