Skip to content

Instantly share code, notes, and snippets.

@tkbremnes
Created June 10, 2014 13:36
Show Gist options
  • Save tkbremnes/f7a4fba22b52cc9aa9d4 to your computer and use it in GitHub Desktop.
Save tkbremnes/f7a4fba22b52cc9aa9d4 to your computer and use it in GitHub Desktop.
Example of embedded room with randomly generated name
<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