Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin: Camera #427

Closed
sethladd opened this issue Nov 17, 2015 · 20 comments
Closed

Plugin: Camera #427

sethladd opened this issue Nov 17, 2015 · 20 comments
Assignees
Labels
c: new feature Nothing broken; request for a new capability would be a good package Separate Flutter package should be made for this

Comments

@sethladd
Copy link
Contributor

This is a request for an API to access the device's camera.

@Hixie Hixie modified the milestone: Blue Sky Nov 21, 2015
@Hixie Hixie added the c: new feature Nothing broken; request for a new capability label Dec 12, 2015
@deftdawg
Copy link

I'm not sure if it's available in Flutter, but it seems there is an Android-only "mojo:camera" service class here: https://github.com/domokit/mojo/blob/master/examples/dart/camera_video/lib/main.dart

@olostan
Copy link

olostan commented May 22, 2016

So there is no iOS version for now?

@sethladd
Copy link
Contributor Author

sethladd commented Dec 1, 2016

Here's a work-in-progress camera plugin: https://github.com/FaisalAbid/flutter-camera-plugin

@sethladd
Copy link
Contributor Author

sethladd commented Dec 2, 2016

I'm going to close this request, because our strategy is to build out a plugin/interop layer, and allow for a camera plugin to be built.

Flutter itself is unlikely to ship a direct camera API, but we fully intend to allow for a plugin to expose and control a camera.

@sethladd sethladd closed this as completed Dec 2, 2016
@pulyaevskiy
Copy link
Contributor

@sethladd Wondering if there is an open issue for "plugin/interop" layer to subscribe to? Or is it just a combination of FlutterView and message-passing mechanism?

@eseidelGoogle
Copy link
Contributor

@pulyaevskiy there are a bunch of pieces.

  1. For one, we need to integrate hello_services with the default workflow (so that it's possible to use custom Android code in a default flutter project): flutter create new project template should be built with gradle (like hello_services) #4796
  2. Another is we have to publish some example plugins.
  3. We need to make it possible to distribute them.
  4. And consume the distributed plugins. Need a way to distribute plugins/services for Flutter #5744

@franzsilva
Copy link

Will flutter only be a viewing layer? Will it be possible to access the systems APIs from dart code in the future? Similar to hoy nativescript works?

@sandeepreddy-vinta
Copy link

Sorry I couldn't get completely.

Right now is it possible from flutter ui to access camera ? If yes can you provide link example or docs?

@eseidelGoogle
Copy link
Contributor

@franzsilva Flutter's focus is on being a cross-platform way to write UIs. We try to provide a very nice developer experience when doing so. Because we use a portable language (dart), it is of course possible to write your entire application in Dart and only then call-out to system services on the device when necessary (camera, location, etc.) Our current system for supporting these call-outs is documented at https://flutter.io/platform-services/ with an example at https://github.com/flutter/flutter/tree/master/examples/hello_services. We believe that model needs some improvement, most notably in terms of tooling and supporting an ecosystem of pre-built service plugins. Those are both areas we're working on now, as discussed above.

@sandeepreddy-vinta it's possible to access any system functionality, including the Camera, using the methods described above. Doing so is not nearly as easy as we'd like, hence the discussion above about improving such. Another Flutter user @FaisalAbid made an example plugin showing how to access the camera: https://github.com/FaisalAbid/flutter-camera-plugin.

Although we've made this all possible today, it's not nearly as easy as we'd like. We'll be improving this soon.

@sethladd sethladd reopened this Jan 27, 2017
@mit-mit mit-mit modified the milestones: 4: Make shippers happy, 5: Make Hixie proud Feb 2, 2017
@mit-mit mit-mit changed the title API to access the device's camera Plugin: Camera Feb 2, 2017
@mit-mit mit-mit modified the milestones: 4: Make shippers happy, 3: Make conferences happy Feb 2, 2017
@collinjackson collinjackson self-assigned this Mar 4, 2017
@laike9m
Copy link

laike9m commented Mar 27, 2017

@eseidelGoogle, the link you gave showing an example with camera no longer exists.

@jsiedentop
Copy link

@laike9m, Erick Ghaumez forked the plugin from Faisal Abid: https://github.com/rxlabz/flutter-camera-plugin The Plugin was developed only for Android with the hello_service example.
But the hello_service example is outdated. You can use the new examples
https://github.com/flutter/flutter/tree/master/examples/platform_channel or https://github.com/flutter/flutter/tree/master/examples/flutter_view and search for code snipplets for how taking pictures or migrate the platform specific code from the camera-plugin-example.

Keep #8971 in mind. Last week, they did some breaking changes in the ios part of flutter apps. If you try to launch an old example, you have to do some migration stuff.

@collinjackson
Copy link
Contributor

collinjackson commented Apr 20, 2017

Update on this: There's a super rough camera plugin in https://github.com/flutter/image_picker. Besides documentation and tests, the main thing that's missing for M2 is that iOS version needs to be able to take photos (right now it only picks from the gallery). Should be fairly straightforward to add.

@ayazzali
Copy link

ayazzali commented Jun 24, 2017

Sorry, but I don't know where write.
I have 2 errors in https://github.com/rxlabz/flutter-camera-plugin
(i tried build this at the ubuntu64 and WIN8)
i don't understand What's wrong in this. (

:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/home/ayaz/flutter-camera-plugin/android/app/src/main/java/com/example/flutter/MainActivity.java:40: error: cannot find symbol
    private FlutterView.MessageResponse _response;
                       ^
  symbol:   class MessageResponse
  location: class FlutterView
/home/ayaz/flutter-camera-plugin/android/app/src/main/java/com/example/flutter/MainActivity.java:54: error: cannot find symbol
                new FlutterView.OnMessageListenerAsync() {
                               ^
  symbol:   class OnMessageListenerAsync
  location: class FlutterView
2 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

@eseidelGoogle
Copy link
Contributor

@ayazzali can you file a new bug? https://github.com/flutter/flutter/issues/new or ask on stack overflow? stackoverflow.com/questions/tagged/flutter . Both of those would be fine places to ask where we can be sure to get you a resolution. This bug is closed and about a different issue, so likely not the right way to reach resolution for your issue.

@eseidelGoogle
Copy link
Contributor

Flutter now provides https://github.com/flutter/plugins/tree/master/packages/camera (also published on pub as https://pub.dartlang.org/packages/camera). It's done via a plugin, so others could write fancier camera plugins if so desired.

@ayazzali
Copy link

ayazzali commented Mar 1, 2018

Cool, thank you very mach

@javidnoutash
Copy link

How can I achieve 4:3 previewSize and pictureSize?

@Arthur-Kamau
Copy link

concerning https://github.com/flutter/plugins/tree/master/packages/camera is it possible to add feature for streaming the camrea to a server ip.

@zoechi zoechi added would be a good package Separate Flutter package should be made for this and removed would be a good package Separate Flutter package should be made for this p: self service labels Jan 9, 2019
@rogerfleenor
Copy link

Is there any API that not only allows access to camera but allows access to ISO, Shutter Speed, etc.. settings?

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability would be a good package Separate Flutter package should be made for this
Projects
None yet
Development

No branches or pull requests