Added videostream to cluster again

CL-541
This commit is contained in:
Jaime van Kessel 2017-12-06 14:59:20 +01:00
parent aba8bd89c3
commit 77e3965fc7
5 changed files with 139 additions and 6 deletions

View file

@ -32,7 +32,7 @@ Item
width: 20 * screenScaleFactor
height: 20 * screenScaleFactor
onClicked: OutputDevice.selectAutomaticPrinter()
onClicked: OutputDevice.setActivePrinter(null)
style: ButtonStyle
{
@ -65,17 +65,23 @@ Item
{
if(visible)
{
OutputDevice.startCamera()
if(OutputDevice.activePrinter != null && OutputDevice.activePrinter.camera != null)
{
OutputDevice.activePrinter.camera.start()
}
} else
{
OutputDevice.stopCamera()
if(OutputDevice.activePrinter != null && OutputDevice.activePrinter.camera != null)
{
OutputDevice.activePrinter.camera.stop()
}
}
}
source:
{
if(OutputDevice.cameraImage)
if(OutputDevice.activePrinter != null && OutputDevice.activePrinter.camera != null && OutputDevice.activePrinter.camera.latestImage)
{
return OutputDevice.cameraImage;
return OutputDevice.activePrinter.camera.latestImage;
}
return "";
}