mergAV.livecode no preview going back told control

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

mergAV.livecode no preview going back told control

Post by trevix » Tue Mar 16, 2021 11:41 am

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
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

SteveB
Posts: 40
Joined: Mon Sep 30, 2019 4:49 pm

Re: mergAV.livecode no preview going back told control

Post by SteveB » Fri Mar 19, 2021 3:34 pm

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

trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: mergAV.livecode no preview going back told control

Post by trevix » Fri Mar 19, 2021 5:47 pm

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.
Attachments
QRcode_v1.livecode.zip
Read and write QRcode, iOS and Android
(4.61 KiB) Downloaded 169 times
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “iOS Deployment”