Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How to automatically use front camera

$
0
0

@mjs wrote:

Hello guys,

I wanna use only front camera, i used -> cordova plugin add cordova-plugin-camera

When i change value of cameraDirection to 1 or Camera.Direction.BACK both not working.

Any sugestion guys to solve that problem ?

Here is the code :

$scope.takeCamera = function(){

	var optionsCamera = {
	  quality: 50,
	  destinationType: Camera.DestinationType.DATA_URL,
	  targetWidth: 50,
	  cameraDirection : 1,
	  encodingType : Camera.EncodingType.JPEG
	};
	var onAfterCaptureCamera = function(imageData){
		alert('berhasil');
		navigator.camera.cleanup(function(){}, function(){});
	};
	var onFailCamera = function(message){
	  alert(JSON.stringify(message));
	};

    navigator.camera.getPicture(onAfterCaptureCamera, onFailCamera, optionsCamera);

}

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>