-
Notifications
You must be signed in to change notification settings - Fork 0
/
photo.html
84 lines (75 loc) · 2.5 KB
/
photo.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
<template name="camera">
<div class="camera-overlay">
{{! used to make the background dark}}
</div>
<div class="camera-popup {{#if permissionDeniedError}}camera-popup-wide{{/if}}">
{{#if error}}
{{#if permissionDeniedError}}
{{> permissionDenied}}
{{else}}
{{#if browserNotSupportedError}}
{{> genericError message="Sorry, this browser is currently not supported for camera functionality."}}
{{else}}
{{> genericError message="There was an error accessing the camera."}}
{{/if}}
{{/if}}
{{else}}
{{#if photo}}
<div class="center">
<img src="{{photo}}" class="photo-preview" />
<div>
<br>
<button class="btn btn-success use-photo">Use Photo</button>
<button class="btn btn-primary new-photo">Take New Photo</button>
</div>
</div>
{{else}}
{{> viewfinder}}
{{/if}}
{{/if}}
</div>
</template>
<template name="viewfinder">
<div class="center">
<video id="video" class="{{#if waitingForPermission}}hidden{{/if}}">
</video>
<div>
{{#if waitingForPermission}}
<p>Waiting for camera permissions...</p>
{{else}}
<button class="btn btn-primary shutter">Take Photo</button>
{{/if}}
<button class="btn btn-default cancel">Cancel</button>
</div>
</div>
<canvas id="canvas" style="visibility: hidden"></canvas>
</template>
<template name="genericError">
<div class="generic-error">
<p>{{message}}</p>
<button class="button cancel">Close Popup</button>
</div>
</template>
<template name="permissionDenied">
<div class="permission-denied-error">
<h2>Camera Permissions Denied</h2>
<p>
You have denied this app permission to use your camera.
If you would like to allow permissions, follow the directions for your
browser below.
</p>
<dl class="permissions-howto">
<dt>Google Chrome</dt>
<dd>Go to Settings > "Show advanced settings..." >
"Content settings..." > Media heading > "Manage exceptions...",
then find this website in the list and allow video capture.</dd>
<dt>Mozilla Firefox</dt>
<dd>Reload the page and try again.</dd>
<dt>Opera</dt>
<dd>Go to Preferences > Websites > Media heading >
"Manage exceptions...", then find this website in the list and
allow video capture.</dd>
</dl>
<button class="button cancel">Close Popup</button>
</div>
</template>