-
Notifications
You must be signed in to change notification settings - Fork 0
/
effect.html
109 lines (77 loc) · 2.1 KB
/
effect.html
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
<html>
<head>
<title>Video effects</title>
<link type="text/css" href="ui/css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script src="lib/jquery-1.7.min.js"></script>
<script src="ui/js/jquery-ui-1.8.16.custom.min.js"></script>
<script src="lib/socket.io.js"></script>
<script src="require.js"></script>
<style>
#peers {
width: 100%;
height: 50%;
}
#blib {
position: absolute;
display: none;
color: white;
font-size: 50;
z-index: 1000;
}
.video_dialog {
overflow: hidden !important;
background-color: black;
}
#local_video {
overflow: hidden;
}
#canvas {
position: fixed;
top: 0px;
left: 0px;
}
</style>
</head>
<body style="overflow: hidden">
<div id="blib">*</div>
<div id="local_video" title="Local preview">
<canvas id="canvas" width="720" height="480"></canvas>
<video width="720" height="480" id="localView" autoplay="autoplay" style="display:none"></video>
</div>
<script>
var Viewer = require("./effects").Viewer;
function gotStream(s) {
var url = webkitURL.createObjectURL(s);
document.getElementById("localView").src = url;
}
function gotStreamFailed(error) {
console.log("Failed to get access to local media. Error code was " + error.code);
}
function getUserMedia() {
try { navigator.webkitGetUserMedia("video,audio", gotStream, gotStreamFailed); }
catch (e) { console.log(e); }
}
var view;
// Window event handling
window.onresize = function () {
console.log("Window " + window.innerWidth + " Height: " + window.innerHeight);
view.resize(document.body.clientWidth, document.body.clientHeight);
}
window.onload = function() {
view = new Viewer(document.getElementById("local_video"));
getUserMedia();
$(":button").button();
// $("#call_dialog").dialog({});
$("#effect").buttonset();
/* $("#local_video").dialog({
width:640, height:480,
resizeStop: function (event, ui) {
view.resize($("#local_video").width()-20, $("#local_video").height()-20);
}
});*/
window.onresize();
}
window.onbeforeunload = disconnect;
</script>
</body>
</html>