As module.

pull/25/head
Pontus Persson 2017-12-08 15:16:26 +01:00 committed by Pontus Alexander
parent d0bd78850e
commit 7bd1bf148b
2 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script> <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="webrtc.js"></script> <script type="module" src="webrtc.js"></script>
</head> </head>
<body> <body>
@ -11,10 +11,6 @@
<br /> <br />
<input type="button" id="start" onclick="start(true)" value="Start Video"></input> <button id="start">Start Video</button>
<script type="text/javascript">
pageReady();
</script>
</body> </body>
</html> </html>

View File

@ -19,6 +19,9 @@ var peerConnectionConfig = {
}; };
function pageReady() { function pageReady() {
document.querySelector("button#start")
.addEventListener("click", start);
uuid = createUUID(); uuid = createUUID();
localVideo = document.getElementById('localVideo'); localVideo = document.getElementById('localVideo');
@ -129,3 +132,5 @@ function createUUID() {
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
} }
pageReady();