adding camera

This commit is contained in:
Ben Arc 2021-04-13 21:22:51 +01:00
parent 80969fbd9b
commit 6a05fd7106
4 changed files with 46 additions and 13 deletions

View file

@ -24,6 +24,7 @@ async def m001_initial(db):
amount_made INTEGER,
fullscreen_cam INTEGER,
iframe_url TEXT,
notes TEXT,
timestamp TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
);
"""

View file

@ -23,6 +23,7 @@ class Copilots(NamedTuple):
timestamp: int
fullscreen_cam: int
iframe_url: str
notes: str
@classmethod
def from_row(cls, row: Row) -> "Copilots":

View file

@ -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>
<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>
Vue.component(VueQrcode.name, VueQrcode)
@ -7,19 +30,27 @@
el: '#vue',
mixins: [windowMixin],
data() {
return {
newProgress: 0.4,
counter: 1,
newTimeLeft: '',
lnbtc: true,
onbtc: false,
charge_time_elapsed: '{{charge.time_elapsed}}',
charge_amount: '{{charge.amount}}',
charge_balance: '{{charge.balance}}',
charge_paid: '{{charge.paid}}'
return {}
},
methods: {
initCamera() {
var video = document.querySelector('#videoElement')
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices
.getUserMedia({video: true})
.then(function (stream) {
video.srcObject = stream
})
.catch(function (err0r) {
console.log('Something went wrong!')
})
}
}
},
methods: {},
mounted() {
this.initCamera()
},
created: function () {}
})
</script>

View file

@ -477,7 +477,7 @@
},
opencopilotCompose: function (copilot_id) {
let params =
'scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=900,height=500,left=200,top=200'
'scrollbars=no, resizable=no,status=no,location=no,toolbar=no,menubar=no,width=900,height=500,left=200,top=200'
open('../copilot/cp/' + copilot_id, 'test', params)
},