Solved

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

Posted on 2016-11-27
2
55 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

The release of the iPhone 6 and the iPhone 6 Plus was extremely successful for Apple. However when iOS 8.1 was introduced, many iPhone users complained of quick battery drainage. Without even knowing, you may be unnecessarily using up your battery p…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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