adding camera
This commit is contained in:
parent
80969fbd9b
commit
6a05fd7106
4 changed files with 46 additions and 13 deletions
|
|
@ -24,6 +24,7 @@ async def m001_initial(db):
|
||||||
amount_made INTEGER,
|
amount_made INTEGER,
|
||||||
fullscreen_cam INTEGER,
|
fullscreen_cam INTEGER,
|
||||||
iframe_url TEXT,
|
iframe_url TEXT,
|
||||||
|
notes TEXT,
|
||||||
timestamp TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
|
timestamp TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ class Copilots(NamedTuple):
|
||||||
timestamp: int
|
timestamp: int
|
||||||
fullscreen_cam: int
|
fullscreen_cam: int
|
||||||
iframe_url: str
|
iframe_url: str
|
||||||
|
notes: str
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_row(cls, row: Row) -> "Copilots":
|
def from_row(cls, row: Row) -> "Copilots":
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,28 @@
|
||||||
{% extends "public.html" %} {% block page %} {% endblock %} {% block scripts %}
|
{% extends "public.html" %} {% block page %}<q-page
|
||||||
|
>fdgasdf
|
||||||
|
|
||||||
|
<video
|
||||||
|
autoplay="true"
|
||||||
|
id="videoElement"
|
||||||
|
style="width: 100%"
|
||||||
|
class="fixed-top-left"
|
||||||
|
></video>
|
||||||
|
</q-page>
|
||||||
|
{% endblock %} {% block scripts %}
|
||||||
<script src="{{ url_for('static', filename='vendor/vue-qrcode@1.0.2/vue-qrcode.min.js') }}"></script>
|
<script src="{{ url_for('static', filename='vendor/vue-qrcode@1.0.2/vue-qrcode.min.js') }}"></script>
|
||||||
|
<style>
|
||||||
|
body.body--dark .q-drawer,
|
||||||
|
body.body--dark .q-footer,
|
||||||
|
body.body--dark .q-header,
|
||||||
|
.q-drawer,
|
||||||
|
.q-footer,
|
||||||
|
.q-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.q-page {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
Vue.component(VueQrcode.name, VueQrcode)
|
Vue.component(VueQrcode.name, VueQrcode)
|
||||||
|
|
||||||
|
|
@ -7,19 +30,27 @@
|
||||||
el: '#vue',
|
el: '#vue',
|
||||||
mixins: [windowMixin],
|
mixins: [windowMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {}
|
||||||
newProgress: 0.4,
|
},
|
||||||
counter: 1,
|
methods: {
|
||||||
newTimeLeft: '',
|
initCamera() {
|
||||||
lnbtc: true,
|
var video = document.querySelector('#videoElement')
|
||||||
onbtc: false,
|
|
||||||
charge_time_elapsed: '{{charge.time_elapsed}}',
|
if (navigator.mediaDevices.getUserMedia) {
|
||||||
charge_amount: '{{charge.amount}}',
|
navigator.mediaDevices
|
||||||
charge_balance: '{{charge.balance}}',
|
.getUserMedia({video: true})
|
||||||
charge_paid: '{{charge.paid}}'
|
.then(function (stream) {
|
||||||
|
video.srcObject = stream
|
||||||
|
})
|
||||||
|
.catch(function (err0r) {
|
||||||
|
console.log('Something went wrong!')
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {},
|
mounted() {
|
||||||
|
this.initCamera()
|
||||||
|
},
|
||||||
created: function () {}
|
created: function () {}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue