ios - iOS8 : Custom Keyboard - Open Camera with AVCaptureVideoPreviewLayer in the background of keyboard -
it posible open avcapturevideopreviewlayer in background of ios8 custom keyboard ? tried code
avcapturesession *session = [[avcapturesession alloc] init]; avcapturedevice *videodevice = [avcapturedevice defaultdevicewithmediatype:avmediatypevideo]; if (videodevice) { nserror *error; avcapturedeviceinput *videoinput = [avcapturedeviceinput deviceinputwithdevice:videodevice error:&error]; if (!error) { if ([session canaddinput:videoinput]) { [session addinput:videoinput]; avcapturevideopreviewlayer *previewlayer = [avcapturevideopreviewlayer layerwithsession:session]; previewlayer.frame = self.bounds; nslog(@"open %@",nsstringfromcgrect(self.bounds)); [self.camview.layer addsublayer:previewlayer]; [session startrunning]; } } }
it inquire permission utilize photographic camera not open photographic camera in background of keyboard. please help me. thanks.
ios keyboard ios8 ios8-extension
No comments:
Post a Comment