startStream method
Implementation
Future<CommandAck> startStream(
DeviceCommand command,
) async {
var result = CommandAck(
commandId: command.id,
message: '[${command.type}]: unknown command type',
success: false,
);
_timer?.cancel();
_screenshot = null;
if (kIsWeb) {
result = CommandAck(
commandId: command.id,
message: '[${command.type}]: not supported on Web',
success: false,
);
} else if (command is StartScreenshotStreamCommand) {
_timer = Timer(command.interval, () async {
await _sendScreenshot(command);
});
}
return result;
}