How to check the camera is auto focused in flutter? - flutter

I am using Camera plugin for my flutter app, how can I check the camera preview is focused or not?

Auto Focus will be provided in this milestone,
based on Future of the Camera Plugin (Refactor/Rework) https://github.com/flutter/flutter/issues/31225
IOS part has pull request, please reference [camera] Expose auto exposure and auto focus point of interest functionality (iOS only) https://github.com/flutter/plugins/pull/709

Related

Hololens Video recording not showing UI elements

We're working with the Hololens 2 and sadly when recording a video, taking an image or going into the live-view, Unity UI elements are not shown in the image/video.
Does anybody know how we can make Unity UI elements appear in video & photo capture in Hololens?
Here is an example where below the title there is text present, but not captured in the image.
The title part uses a TextMeshPro component, while the text part uses a TextMeshProUGUI component (due to the scrolling window of the text.)
We're using Unity 2020.3.6f1, MRTK 2.7.2 with OpenXR backend.
Thanks for any help and recommendations.
For how to create mixed-reality photos and videos, you can use the Start gesture to go to Start, then select the Camera icon, for more information please refer to this link: Create mixed reality photos and videos.
If you want to seamlessly integrate mixed reality capture and insertion into your apps, you need to enable the Windows Mixed Reality Camera Settings provider in your MRTK profile and check Render from PV Camera.
The issue was that our Unity version was not updated, as hinted out in this github issue. Simply updating to the newest Unity version solved the problem.
https://github.com/microsoft/MixedRealityToolkit-Unity/issues/10155

In Flutter, how can I check if a mouse device or a touch device?

How can I check if the device is a touch device or a mouse device?
Using kIsWeb is not sufficient because if using web version of the app on a mobile device kIsWeb returns true, but I need it to return false because it is a touch device.
Checking the platform doesn't work either because if using web version of the app on an iOS device for example returns false for iOS platform check.
Use case - I have two different types of video players for my app. One is suitable for touch devices (you tap to show and hide controls) and one is suitable for mouse devices (controls show when you mouse into the player and hide when you mouse out).
Youtube has the same idea. If I use the youtube app or website on my iPhone I get touch controls. If I use the youtube app or website on my iPad Pro I get touch controls. If I use the youtube website on my Mac I get mouse controls at all screen sizes (even mobile screen sizes).
So I guess I really just need to know platform on the web. I can get platform if not on the web.
Great question #jwasher! I had the same issue - a touch and swipe based UI that was great as a native mobile app, great as an single page web app (SPA) on mobile web browsers, but that was weird and clunky for mouse based interactions when the SPA was used in a desktop web browser.
The solution I have settled on is to wrap sensitive widgets in a MouseRegion (https://api.flutter.dev/flutter/widgets/MouseRegion-class.html) to detect mouse activity at runtime, then reacting by augmenting the UI with buttons to provide a mouse focussed way of triggering actions previously only linked to touch triggers.
You could use this to "mouse-enable" individual widgets, or you could wrap the whole app in a MouseRegion, trip a state field when activity was detected then rebuild the widget tree in a substantially different way for point and click users.
This strategy may incur some minor complexity/CPU overhead on devices that will never have a mouse attached (like a smartphone), but the solution will be more flexible than a build or configuration time capability determination. If a user starts the app on a tablet, then puts it in a stand and attaches a bluetooth mouse - it will react appropriately.
A device isn't "a mouse device" or "a pointer device". Events have an input type--see Pointer event.kind--but not the whole device. A laptop can have a touch screen, and a tablet can have a stylus or external mouse; an app running in those environments can receive both types of event.
Without knowing what you are trying to accomplish with this classification, is hard to advise on how to accomplish it. Trying to style your UI based on a guess of the primary interaction mode, for instance, is a completely different problem than reacting to a mouse event differently than a touch event.

Enable Camera Pano mode with Flutter

Is there a way to enable the panoramic mode of the camera both on Android and ios with Flutter camera plugin? Couldn't find any documentation or code around it (neither in the source).
Is it something planned?
Thank you
answer of 2019-08-12
Is it something planned?
Camera Plugin is under Refactor/Rework)
panoramic mode did not include in this Milestone.
You can trace here
https://github.com/flutter/flutter/issues/31225#issuecomment-516091146
Support Android Camera 16+
Support iOS Camera 8.0+
Camera Orientation Control
Video/Preview/Picture output sizes
Android Pause and Resume video recording (MediaRecorder)
Zoom Control
Flash
Automatic Exposure
Permission Handling (Camera/Audio)
Auto Focus
Memory Leak
Provide Complex Camera Example
Expand Controls over video and image formats
Direct access to image buffer when taking a photo

How to use UI component with EDK in Marmalade?

I need to extend Marmalade for UI component. Find below my requirement:
I need to user WebView component or TextView component of iOS in my app for iPad. I want to know how to achieve this using EDK? I need to show particular UI component at specific location in my app and also need to retrieve data (in case of TextView or TextField).
Let me know whether above functionality is possible or not using EDK. Give me steps and code template for same if possible.
Let me know of further detail is required.
There're inbuilt UI component in Marmalade such as s3eWebView for WebView and IwUITextView for TextView. You can check official documentation which comes with every version of marmalade SDK, for more such UI components.
You can use EDK instead to use native UI component for iOS or Android using objective C (iOS) or Java (Android) too. If you want to learn the use of EDK, you can watch the video tutorial here on Official Marmalade Youtube channel.

How to customize zbar sdk's UIImagePickerView?

Iam working on barcode reder app which reads barcode and display it's data using zbar Sdk.
Now client wants to customize the square bracket which appears when camera auto focus the barcode,
my question is that is it possible to customize it,
Thanks
It is possible to customize it, but it's not very documented. Afaik you only have APIs for setting its color and so on. If you want to do further customization, you'll need to re-implement that part yourself.
The code for the built-in tracking can be found here: http://zbar.hg.sourceforge.net/hgweb/zbar/zbar/file/443c9f0e3c8f/iphone
This will disable the autofocus property in zbar sdk
reader.tracksSymbols=FALSE;