replaced iframe with share screen

This commit is contained in:
Ben Arc
2021-04-20 13:41:59 +01:00
parent 02a406d0fa
commit 92722b315b
2 changed files with 17 additions and 31 deletions

View File

@@ -1,12 +1,11 @@
{% extends "public.html" %} {% block page %}<q-page>
<iframe
<div
width="100%"
height="100%"
id="iframe_main"
src="/"
class="fixed-bottom-left"
>
</iframe>
></div>
<video
autoplay="true"
id="videoElement"
@@ -247,12 +246,22 @@
}
if (res[1] == 'true') {
document.getElementById('videoElement').style.width = '20%'
async function startCapture(displayMediaOptions) {
let captureStream = null
try {
captureStream = await navigator.mediaDevices.getDisplayMedia(
displayMediaOptions
)
} catch (err) {
console.error('Error: ' + err)
}
document.getElementById('iframe_main').src = captureStream
}
}
if (res[1] == 'false') {
document.getElementById('videoElement').style.width = '100%'
}
if (res[1].substring(0, 3) == 'htt') {
document.getElementById('iframe_main').src = res[1]
document.getElementById('iframe_main').src = null
}
console.log(res[2])
if (res[2] != 'none') {

View File

@@ -24,35 +24,12 @@
<div class="row">
<div class="col">
<q-btn
disable
class="q-mt-sm q-ml-sm"
color="primary"
@click="fullscreenToggle"
label="Webcam size"
label="Screen share"
>
<q-tooltip> Coming soon </q-tooltip></q-btn
>
</div>
<div class="col">
<q-input
disable
class="q-pt-sm"
dense
outlined
bottom-slots
v-model="iframe"
label="iframe url"
><q-tooltip> Coming soon </q-tooltip>
<template v-slot:after>
<q-btn
round
dense
flat
@click="iframeChange(iframe)"
icon="send"
/>
</template>
</q-input>
</q-btn>
</div>
</div>
<div class="row q-pa-sm">