question

sofi-3727 avatar image
0 Votes"
sofi-3727 asked sofi-3727 commented

ios app continuous photo capture

Hi,
I need to implement a functionality where the user can continuously take photos from my app until they click 'cancel'.

  1. CrossMedia.Current.TakePhotoAsync
    I have tried looping as shown below, but each time a photo is taken and 'use photo' is clicked, the app page appears momentarily and then the camera reappears. I would like the camera to stay open until 'cancel' is clicked.
    Is this possible?

       while (isCamera)
                 {
                     file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions { });
    
                     if (file != null)
                         {
                             //save photo                      
                         }
                     }
                     else
                         isCamera = false;
                 }
    

  2. Cross-apps
    On googling, I found suggestions about 'cross-apps' but cant seem to find any sample code. Have any of you used this for the above scenario? If so, could you please share some sample code?

Thank you :)




dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleWang-MSFT avatar image
0 Votes"
KyleWang-MSFT answered sofi-3727 commented

Hi sofi-3727,

Welcome to our Microsoft Q&A platform!

So far, there is no take multiple shots function in Xamarin yet. You can try to open a feature request here:

https://github.com/jamesmontemagno/MediaPlugin/issues

Or try to use the Media Picker provided by Xamarin.Essentials.

 using Xamarin.Essentials;

 var file = await MediaPicker.CapturePhotoAsync();

As to the "cross-apps" you mentioned, you can find the Nuget package in VS and there you can get its project url.

Regards,
Kyle


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Kyle, thanks for your answer. I tried using the Media Picker by Xamarin.Essentials but it behaves exactly the same way as CrossMedia.Current.TakePhotoAsync. Will try using the cross-apps.

0 Votes 0 ·