Created
June 10, 2014 13:36
-
-
Save tkbremnes/f7a4fba22b52cc9aa9d4 to your computer and use it in GitHub Desktop.
Example of embedded room with randomly generated name
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
<html> | |
<body> | |
<h1>My awesome service</h1> | |
<button onclick="createRoom()">Create room</button> | |
<iframe id="appearin-room"></iframe> | |
<script> | |
// create the room on button press | |
window.createRoom = function () { | |
// setting a room name. Pair this with the random room generator code above for real power | |
var roomName = 'this-is-a-room'; | |
roomName = 'https://appear.in/' + roomName; | |
// set the iframe source to load the room | |
var iframe = document.getElementById('appearin-room'); | |
iframe.setAttribute('src', roomName); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment