ricoh theta sc2 live preview tester
for v/z1, see my other project using dio as the http library.
save frames to disk for inspection
use within flutter
usage
- create a stream (for flutter, it is easier to use streamcontroller
- pass stream to library
- specify number of frames to capture
- listen to stream and either write frames to disk or display to screen
example
code example with flutter
class _myhomepagestate extends state<myhomepage> {
@override
widget build(buildcontext context) {
streamcontroller controller = streamcontroller();
sc2getlivepreview(controller, frames: 300);
return scaffold(
// your ui
//
expanded(
flex: 8,
child: streambuilder(
stream: controller.stream,
builder: (buildcontext context, asyncsnapshot snapshot) {
if (snapshot.hasdata) {
var imagedata = uint8list.fromlist(snapshot.data);
return image.memory(
imagedata,
gaplessplayback: true,
);
} else {
return container();
}
}),
),
Comments are closed.