|
@@ -23,12 +23,32 @@ class _CapturePageState extends State<CapturePage> {
|
|
|
void initState() {
|
|
|
super.initState();
|
|
|
rpc.platform.startPreviewSonopost();
|
|
|
+ ShellSonopostPlayController.onCaptureFrame.addListener(onCaptureFrame);
|
|
|
+ ShellSonopostPlayController.onRecord.addListener(onRecord);
|
|
|
controller.play();
|
|
|
}
|
|
|
|
|
|
+ void onCaptureFrame(Object sender, bool e) {
|
|
|
+ PromptBox.toast('采集成功');
|
|
|
+ }
|
|
|
+
|
|
|
+ void onRecord(Object sender, bool e) {
|
|
|
+ if (isRecording == e) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (isRecording) {
|
|
|
+ PromptBox.toast('采集成功');
|
|
|
+ }
|
|
|
+ setState(() {
|
|
|
+ isRecording = e;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@override
|
|
|
void dispose() {
|
|
|
super.dispose();
|
|
|
+ ShellSonopostPlayController.onCaptureFrame.removeListener(onCaptureFrame);
|
|
|
+ ShellSonopostPlayController.onRecord.removeListener(onRecord);
|
|
|
_timer?.cancel();
|
|
|
controller.stop();
|
|
|
rpc.platform.stopPreviewSonopost();
|