Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Can I replace (or skip) "RETRY / OK" stage of media.capturePhoto?
Started by sieler2 Aug 28 2018 11:23 AM

4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sieler2

[GLOBAL: userInfoPane.html]
sieler2
  • Enthusiast

  • 75 posts
  • Corona SDK

Hi,

When I use media.capturePhoto, the camera opens, the user takes a picture, and then a picture

is displayed with "RETRY    OK" buttons at the top.  The user taps one of the two buttons.

[The entire interaction after the start of the camera "opening" to just after the user

taps "OK" is not under my control ... it's Corona and/or the native OS]

 

But... that's rather limiting.  What if I don't want "RETRY   OK"? 

 

I'd like to be able to:

 

   1. choose to automatically accept any photo they've taken (i.e., bypass that RETRY / OK screen)

or

   2. specify my own return/ok buttons.  (In my case, I'd want to have 4 buttons:

            Public, Private, Retry, Cancel

      ...the first two accept the photo but mark it (to my app) as "public" or "private".

 

(If I did #1, I'd then display the photo and ask: Public / Private / Retake / Cancel)

 

Yes, I have the same question about iOS, where it displays "Retake     Use Photo" at the bottom.

 

thanks,

 

Stan



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,535 posts
  • Corona Staff

Apple has pretty strict controls over what you can do with capturing photos, video or getting content from the camera roll. The OS provides the dialog that we have to use. There are very few controls over this dialog and after looking over several documentation and "how to" sites, I don't see any controls for setting the values of the buttons.

 

Corona is a cross-platform engine and frequently when we have to do things at the OS level like this, it's going to be the most common features between the two.

 

To sum up. This is not currently possible with Corona. This most likely is not possible at all given OS restrictions. If it is possible then it would have to happen pretty deep in very OS specific code, you might be able to do this using Corona Native builds.

 

Rob



[TOPIC: post.html]
#3

sieler2

[GLOBAL: userInfoPane.html]
sieler2
  • Enthusiast

  • 75 posts
  • Corona SDK

thanks, Rob!

 

I hoped something might be possible, particularly on Android. 

 

I saw one Android app that immediately shows a continuous

video stream of what the camera "sees" ... it has a "capture" button which works immediately, showing a thumbnail of

the capture while continuing to do the stream.  Of course, it's probably 'native'. 

 

Assuming iOS can do something similar (and I'm fairly sure it can), the labs might consider

if there's enough interest to add a second form of captureMedia, one which does that stream,

allows an easy photo to be taken and returned immediately without dialog.

 

Perhaps media.quickCapturePhoto?  (allows user to tap button to take picture)

and media.quickCapturePhotoNow   (immediately takes photo and returns, with no disturbance to display)

There are obvious applications to gaming, of course, for both quick Capture APIs.

 

thanks again,

 

Stan



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,535 posts
  • Corona Staff

Corona doesn't implement live video feeds through the media.* API's. Those are for capturing single instance photos and videos or getting something from a photo album. 

 

Getting a video feed into your app is done through filling a display object. You can do something like:

    local background = display.newRect( _W*0.5, _H*0.5, _W, _H )
    background.fill = { type = "camera" }

But we only support this on iOS. It's too difficult to implement across Android and we have no plans to add support for this to Android. We want to support this, but it's simply too difficult.

 

Rob


  • sieler2 likes this

[TOPIC: post.html]
#5

sieler2

[GLOBAL: userInfoPane.html]
sieler2
  • Enthusiast

  • 75 posts
  • Corona SDK

@Rob: the video feed concept is great, thanks!  (even if only iOS)

 

BTW, any chance the media.capturePhoto will mention this? 

It would be nice if things like "display.newRect / fill" doc and "media.capturePhoto" doc pointed to a common "here's how to get still photo, here's how to get video" combined discussion page.

 

thanks,

 

Stan




[topic_controls]
[/topic_controls]