Solved

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

Posted on 2016-11-27
2
107 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

     Intro      In this article, I will show you how to parse a JSON in Swift using an open source library called SwiftyJSON (https://github.com/SwiftyJSON/SwiftyJSON). If you haven't heard of a JSON before, it stands for JavaScript Object Notation…
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

726 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