-
Notifications
You must be signed in to change notification settings - Fork 0
Camera Stream
TJ Horner edited this page Sep 6, 2017
·
3 revisions
THIS FEATURE IS EXPERIMENTAL. Things may break if you use this. It's not production ready.
Starting with v1.0.0, you can receive the real time camera stream from the printer.
printer.on("camera-frame", frame => {
printer.endCameraStream()
fs.writeFile("frame.jpg", frame)
})
printer.startCameraStream()
To start receiving camera data, you must request the printer to start streaming it. You can do this with startCameraStream()
.
Once a camera frame is received from the printer, the event camera-frame
will be emitted with binary JPEG data.
Once you don't need camera data anymore, it's a good idea to end the stream to save bandwidth and prevent any further breaking that may have been caused by using this feature. You can do this with endCameraStream()
.