-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (57 loc) · 2.04 KB
/
index.html
File metadata and controls
72 lines (57 loc) · 2.04 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
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="de">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>go~mus | public iframe example</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { background: #1AB394;}
</style>
</head>
<body>
<div id="go_marker"></div>
</body>
<script type="text/javascript">
function getParameterByName(name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var el = document.getElementById('go_marker');
var go_url = getParameterByName('go_url');
if ((typeof(el) != 'undefined' && el != null) && (typeof(go_url) != 'undefined' && go_url != null)) {
// get the go url
var go_url_arr = go_url.split("/");
var go_url_base = go_url_arr[0] + "//" + go_url_arr[2]
// create the iframe in pure javascript
var ifrm = document.createElement('iframe');
ifrm.setAttribute('id', 'go_ifrm');
ifrm.setAttribute('csp', "\"object-src 'none'\"");
ifrm.setAttribute('allow', "camera "+go_url_base+"; microphone "+go_url_base);
// insert into exisiting element
el.appendChild(ifrm);
// assign url
ifrm.setAttribute('src', go_url);
// set frameborder
ifrm.setAttribute('frameborder', 'none');
// set allowtransparency
ifrm.setAttribute('allowtransparency', 'true');
// assign width
ifrm.setAttribute('width', '100%');
ifrm.setAttribute('height', '800');
}
</script>
</html>