Solved

How can I set a timer to automatically take a picture using the Xamarin MediaPlugin

Posted on 2016-11-27
2
47 Views
Last Modified: 2016-11-29
This is basally what I want to do: The user taps a button, the camera comes on, a 5 second timer starts, they step back, center their face in the camera and the picture is taken automatically.

This is may camera code, this works but the user needs to push the camera button to take the picture. Thanks!

       
 var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
        {
            DefaultCamera = Plugin.Media.Abstractions.CameraDevice.Front,
            PhotoSize = Plugin.Media.Abstractions.PhotoSize.Small
        });

        if (file == null) return;

        byte[] imageAsBytes = null;
        using (var memoryStream = new MemoryStream())
        {
            file.GetStream().CopyTo(memoryStream);
            file.Dispose();
            imageAsBytes = memoryStream.ToArray();
        }

Open in new window

0
Comment
Question by:Bob Hoffman
  • 2
2 Comments
 
LVL 8

Accepted Solution

by:
Bob Hoffman earned 0 total points
ID: 41906322
Seems this is not possible with the Media plugin. Was able to do it with AVFoundation.
0
 
LVL 8

Author Closing Comment

by:Bob Hoffman
ID: 41906323
figured it out myself
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What's a UDID? If you're involved in developing, testing, or even reviewing an iOS application that's in beta, then at some point you may need to know the UDID for any iOS devices that you'll be testing on. What's the UDID? It stands for Unique Dev…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now