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.
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: 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.
@Rob - taking a different tack with this - could the camera be opened and read as a raw device? In the old days, we used to open these using the File APIs. Ie :
local a
local file = io.open(camera, “rb”)
while (a=io.read(file, bufferSize) then
processBuffer(a)
end
io.close(file)
Or some such code
I like the iOS fill solution, but need Android as well. Being able to read the device through file io, would let me roll my own.
I was thinking of reading the raw data, creating a png or jpg, saving it as a temp file and loading with new image rect. I don’t need a super quick refresh.
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.
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: 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.
@Rob - taking a different tack with this - could the camera be opened and read as a raw device? In the old days, we used to open these using the File APIs. Ie :
local a
local file = io.open(camera, “rb”)
while (a=io.read(file, bufferSize) then
processBuffer(a)
end
io.close(file)
Or some such code
I like the iOS fill solution, but need Android as well. Being able to read the device through file io, would let me roll my own.
I was thinking of reading the raw data, creating a png or jpg, saving it as a temp file and loading with new image rect. I don’t need a super quick refresh.