triniwiz / nativescript-videorecorder

:video_camera: NativeScript plugin for Video Recording . :video_camera:
Apache License 2.0
43 stars 29 forks source link

Camera permission neede #15

Closed bogmihut8 closed 7 years ago

bogmihut8 commented 7 years ago

Hello guys,

I just found out about this plugin and added it in my project, but I cannot use the recorder and I always get the "camera permission needed". How can I force the camera permission?

My code:

var vr = require("nativescript-videorecorder"); var videorecorder = new vr.VideoRecorder();

var options = { saveToGallery:false, //default false | optional duration:10, //(seconds) default no limit | optional size:10, //(MB) default none | optional #android hd:true, //default false low res | optional explanation: "Why do i need this permission" }

exports.add = function(){ videorecorder.record(options) .then((data)=>{ console.log(JSON.stringify(data.file)) }) .catch((err)=>{ console.log(JSON.stringify(err)) }) }

triniwiz commented 7 years ago

On android 6+ you cannot force the permission anymore you need to request it.