forked from littlstar/axis360
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
193 lines (173 loc) · 5.43 KB
/
index.html
File metadata and controls
193 lines (173 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Axis - 360 Video Rendering Engine</title>
<link rel="stylesheet" href="build/build.css" type="text/css" />
<script type="text/javascript" charset="utf-8" src="build/build.js"></script>
<style type="text/css" media="all">
body {
display: block;
position: relative;
margin: 0;
padding: 0;
font-size: 14px;
line-height: 1.7;
color: #444;
background-color: #fff;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
}
#title {
position: relative;
display: block;
margin: 0 auto;
font-size: 32px;
font-weight: 100;
text-align: center;
}
#title i {
margin-right: 10px;
}
#heading {
display: block;
position: relative;
padding: 15px;
border-top: 1px solid #ccc;
box-shadow: 0px 2px 2px -2px #f4002b;
font-size: 18px;
text-align: center;
background: #cecece;
}
.video {
display: block;
position: relative;
width: 100%;
height: auto;
margin: 0 auto;
margin-top: 20px;
padding: 0;
border-radius: 3px;
background: #181818;
}
#meta {
display: block;
position: relative;
margin: 0;
margin-top: 20px;
padding: 10px;
font-size: 16px;
}
#meta > span:not(:last-child)::after {
content: ' - ';
margin: 0 5px;
}
#meta i {
margin-right: 5px;
}
#meta a {
color: #444;
text-decoration: none;
}
#meta a:hover {
text-decoration: underline;
}
#preview {
display: block;
position: relative;
width: 500px;
height: 250px;
}
</style>
</head>
<body>
<h3 id="title">
<i class="fa fa-video-camera"></i>Axis 360 Video Test
</h3>
<button id="go-fullscreen">Go fullscreen</button>
<button id="toggle-vr-mode">Toggle VR Mode</button>
<button id="enable-pointer-lock">Enable Pointer Lock</button>
<button id="toggle-mouse-movement-control">Toggle Mouse Movements Control</button>
<h4>Preview</h4>
<!--img id="preview"/-->
<div class="normal video"></div>
<div class="vsn video"></div>
<script type="text/javascript" charset="utf-8">
//DEBUG=1
var frame = new Axis(document.querySelector('.normal.video'), {
//allowPreviewFrame: true,
crossorigin: true,
resizable: true,
preload: true,
autoplay: true,
width: window.innerWidth * .8,
height: window.innerHeight * .8,
loop: true,
//allowWheel: true,
muted: true,
//fov: 65,
//src: 'test.webm'
//src: 'http://360.littlstar.com/production/66ac8e41-efaa-44d2-bfcd-c169f7eec1bb/original.jpg',
src: '/public/assets/paramotor.mp4'
//src: '/public/assets/hostel-luego.jpg'
//src: 'public/assets/vsn.mp4',
//src: 'https://ls-360-media.s3.amazonaws.com/production/b7333d11-5d58-462a-9bc7-e26fa1495569/web.mp4'
//src: 'http://360.littlstar.com/production/912be07c-f2cd-4b4d-a63c-b370227dbe26/original.mp4'
//src: 'http://360.littlstar.com/production/66ac8e41-efaa-44d2-bfcd-c169f7eec1bb/lg.jpg'
//src: 'http://360.littlstar.com/production/a0a5746e-87ac-4f20-9724-ecba40429e54/web.mp4'
//src: 'http://360.littlstar.com/staging/515ef0fd-814e-4567-a266-c9efe64e9d20/original.jpg'
});
frame.on('vrhmdavailable', function (e) {
console.log(e)
});
frame.render();
frame.once('ready', function () {
frame.focus();
//frame.rotate('y', {value: 0.005, every: 100});
//updatePreview();
//setInterval(updatePreview, 2000);
});
function updatePreview () {
frame.toImage(document.querySelector('#preview'));
}
document.querySelector('#go-fullscreen')
.addEventListener('click', function () {
frame.fullscreen(frame.el);
});
var isVREnabled = false;
document.querySelector('#toggle-vr-mode')
.addEventListener('click', function () {
if (isVREnabled) { frame.disableVRMode(); }
else { frame.enableVRMode(); }
isVREnabled = !isVREnabled;
});
document.querySelector('#enable-pointer-lock')
.addEventListener('click', function () {
var pointer = frame.controls.pointer;
pointer.enable();
pointer.request();
});
var isMouseMovementEnabled = false;
document.querySelector('#toggle-mouse-movement-control')
.addEventListener('click', function () {
if (isMouseMovementEnabled) {
frame.controls.movement.disable();
frame.controls.mouse.enable();
} else {
frame.controls.movement.enable();
frame.controls.mouse.disable();
}
isMouseMovementEnabled = !isMouseMovementEnabled;
});
/*var vsn = new Axis(document.querySelector('.vsn.video'), {
src: 'public/assets/vsn.mp4',
resizable: true,
autoplay: true,
wheel: true,
crossorigin: true
});
vsn.render();*/
</script>
<script type="text/javascript">
</script>
</body>
</html>