-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
51 lines (48 loc) · 1.43 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Example WebRTC Point-to-point Video</title>
<style>
#video {
position: relative;
}
#local-video {
left: 0;
position: absolute;
top: 0;
z-index: 1;
}
</style>
</head>
<body>
<h1>Example WebRTC Point-to-point Video</h1>
<table class="visible">
<tr><td><button id="call" onClick="callPeer.initiateCall(config.localStream)">Call</button></td></tr>
</table>
<div id="video">
<video id="remote-video" autoplay="true" controls="true" width="480" height="360"></video>
<video id="local-video" autoplay="true" controls="true" muted="true" width="160" height="120"></video>
</div>
<script src="PeerConnection.js" type="text/javascript"></script>
<script src="call.js" type="text/javascript"></script>
<script type="text/javascript">
// temporary kludge to paper over browser differences
navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
var config = {
video: document.getElementById('remote-video'),
};
navigator.getUserMedia({
audio: true,
video: true
},
function (localStream) {
video = document.getElementById('local-video');
video['src'] = URL.createObjectURL(localStream);
config.localStream = localStream;
},
function (e) { console.error(e); }
);
var callPeer = call(config);
</script>
</body>
</html>