Page 1 of 1

mergAV.livecode no preview going back told control

Posted: Tue Mar 16, 2021 11:41 am
by trevix
OSX 10.14.6 LC 9.6.2(RC2)

I copied, from the bundle of LC, the stack "mergAV.livecode" in order to test it and eventually include mergAV in my App (for reading QRcode only).
I noticed that, on OSX, the first time I go to the "Control" card, the preview works ok, the camera led of the Mac turns on, etc.
But if I go to cd "general" and back to cd "control", the camera led turns on,I can record video BUT the preview is not working anymore for the rest of the session.
Note that this doesn't happens on iOS hardware.
Is there some command missing in this demo stack? Refresh something?

Also, since I am going to implement only QRcode reading in my App, what is the state of the art for what concern Apple permissions and acceptance by the Apple store(iOS). Is there something i should know?

Thanks
Trevix

Re: mergAV.livecode no preview going back told control

Posted: Fri Mar 19, 2021 3:34 pm
by SteveB
Yes, same thing for me. It's a fault in the demo.

If you are looking to scan barcodes in iOS this is the code I use in my app, and yes, my app is in the Apple Store.

Code: Select all

on openCard
   mergAVRequestMediaAccess "video"
end openCard

on closecard
   mergAVCamDelete
end closecard

on mergAVMediaAccess pType, pGranted
   mergAVCamSet "microphone", empty
   mergAVCamCreate
   mergAVCamSet "rect",the rect of graphic "myCam"
   mergAVCamSet "quality","high"
   mergAVCamSet "flash","auto"
   mergAVCamSet "torch","auto"
   mergAVCamSet "visible","true"
   mergAVCamStartBarcodeReader
end mergAVMediaAccess

on mergAVCamBarcodeFound pBarcode
   mergAVCamStopBarcodeReader
   // do something with the barcode
   answer pBarcode
   // scan another code
   mergAVCamStartBarcodeReader
end mergAVCamBarcodeFound
You just need a card with a rectangle graphic named "myCam" and with the above code in the card script, and the mergAV external of course.

Good luck with your app
Steve

Re: mergAV.livecode no preview going back told control

Posted: Fri Mar 19, 2021 5:47 pm
by trevix
Thanks
Meanwhile, since i will not use it on OSX, i came up whith a stack that does both writing and reading, in iOS and Android.
Glad to share.