forked from simplewebrtc/SimpleWebRTC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
160 lines (142 loc) · 5.43 KB
/
Copy pathindex.html
File metadata and controls
160 lines (142 loc) · 5.43 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Office hours - The simple way">
<title>Office hours - The Simple Way</title>
<link rel="stylesheet" href="vendor/yui-pure-0.3.0-min.css">
<!--[if lte IE 8]>
<link rel="stylesheet" href="css/main-grid-old-ie.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="css/main-grid.css">
<!--<![endif]-->
<!--[if lte IE 8]>
<link rel="stylesheet" href="css/layouts/marketing-old-ie.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="css/layouts/marketing.css">
<!--<![endif]-->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
</head>
<body>
<h1 id="title">Start a room</h1>
<div class="splash-container">
<div class="splash">
<style>
#remotes video {
height: 200px;
}
</style>
<div id="remotes"></div>
<video id="localVideo" style="height: 150px;"></video>
</p>
</div>
</div>
<div class="content-wrapper">
<div class="content">
<h2 class="content-head is-center">Made to make office hours easier.</h2>
<div class="pure-g">
<div class="l-box pure-u-1 pure-u-med-1-2 pure-u-lrg-1-4">
<h3 class="content-subhead">
<i class="fa fa-rocket"></i>
Get Started Quickly
</h3>
<p>
Get someone else joining https://officehours.app.iterate.no and have a chat!
</p>
</div>
<div class="l-box pure-u-1 pure-u-med-1-2 pure-u-lrg-1-4">
<h3 class="content-subhead">
<i class="fa fa-mobile"></i>
Responsive Layouts
</h3>
<p>
Experiment to see how easy it is to get started with WebRTC
</p>
</div>
<div class="l-box pure-u-1 pure-u-med-1-2 pure-u-lrg-1-4">
<h3 class="content-subhead">
<i class="fa fa-th-large"></i>
Feedback
</h3>
<p>
Feedback is very welcomed! Pull requests are even more welcome. <a href="http://github.com/weel/officehours"> Github repo here</a>
</p>
</div>
<div class="l-box pure-u-1 pure-u-med-1-2 pure-u-lrg-1-4">
<h3 class="content-subhead">
<i class="fa fa-check-square-o"></i>
Tech details
</h3>
<p>
Created based on YUI for CSS and layout. Used SimpleWebRTC for getting started.
</p>
</div>
</div>
</div>
</div>
<script src="vendor/yui-3.14.1.js"></script>
<script>
YUI().use('node-base', 'node-event-delegate', function (Y) {
// This just makes sure that the href="#" attached to the <a> elements
// don't scroll you back up the page.
Y.one('body').delegate('click', function (e) {
e.preventDefault();
}, 'a[href="#"]');
});
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="simplewebrtc.bundle.js"></script>
<script>
// grab the room from the URL
var room = '7aff22831b2d25b3e2a545f305d0ea68';
// create our webrtc connection
var webrtc = new SimpleWebRTC({
// the id/element dom element that will hold "our" video
localVideoEl: 'localVideo',
// the id/element dom element that will hold remote videos
remoteVideosEl: 'remotes',
// immediately ask for camera access
autoRequestMedia: true,
debug: true,
detectSpeakingEvents: true,
autoAdjustMic: false
});
// when it's ready, join if we got a room from the URL
webrtc.on('readyToCall', function () {
// you can name it anything
console.log("joining room");
webrtc.joinRoom('officehours');
});
// Since we use this twice we put it here
function setRoom(name) {
$('form').remove();
$('h1').text(name);
$('#subTitle').text('Link to join: https://officehours.app.iterate.no');
$('body').addClass('active');
}
setRoom("7aff22831b2d25b3e2a545f305d0ea68");
var button = $('#screenShareButton'),
setButton = function (bool) {
button.text(bool ? 'share screen' : 'stop sharing');
};
setButton(true);
button.click(function () {
if (webrtc.getLocalScreen()) {
webrtc.stopScreenShare();
setButton(true);
} else {
webrtc.shareScreen(function (err) {
if (err) {
setButton(true);
} else {
setButton(false);
}
});
}
});
</script>
</body>
</html>