Closed mrwrighty closed 4 years ago
this is very unpredictable, sometimes I can record and retake up to 10 or more videos then it hangs, sometimes it hangs after one video. Once it is hung and I try to stop video I get the following error:-
Apr 16 11:03:02 iPhone-5c myRecorder(NativeScript)[510]
Also get the following error:
Apr 16 11:22:49 iPhone-5c mediaserverd(AudioToolbox)[42]
I have changed the name of the App to myRecorder as I don't want this detail published at the moment.
Got the same issue, only solution I found was reverting to tns-ios@5.1.1
Got the same issue, only solution I found was reverting to tns-ios@5.1.1
Thanks Tronix117, very frustrating that the developer has failed to respond to requests for support. He has a good product and I've yet to find an alternative, but bugs like this drive me crazy.
Yes @triniwiz has good stuff, but maybe too much, and he is alone on those, so support is kind of eratic... But he is open to Pull Requests ;)
I'll look into this and as @Tronix117 I have a lot of stuff to maintain so any pr will be appreciated ❤️
@mrwrighty I'm having similar issues right now where the "finished" event isn't triggered after I call .stopRecording(). Did you figure out a workaround?
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
node_modules/tns-core-modules/package.json
file in your project)"tns-android"
and"tns-ios"
properties in thepackage.json
file of your project)Please, tell us how to recreate the issue in as much detail as possible.
Take or retake video does not always call:
recorder.on('finished', args => { clearInterval(interval); var vidfile = args.object.get('file'); alert(vidfile); page.bindingContext.set('selectedVideo', args.object.get('file')); appSettings.setString("vidfile", vidfile); durationlabel.text = "Video Length "+recorder.duration+" Secs"; });
Is there any code involved?
`"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var appSettings = require("tns-core-modules/application-settings"); var dialogs = require("tns-core-modules/ui/dialogs"); var main_view_model_1 = require("./video-view-model"); //var nativescript_videorecorder_1 = require("nativescript-videorecorder"); var Advanced_1 = require("nativescript-videorecorder/advanced"); var frame_1 = require("tns-core-modules/ui/frame"); var progress = require("tns-core-modules/ui/progress"); var page; var recorder; var interval; var videoplayer; var stoprecordingbutton; var recordvideobutton; var completesigninbutton; var retakevideobutton; var recorderstack; var completestack; var durationlabel; var vm = new main_view_model_1.HelloWorldModel(); function navigatingTo(args) {
} exports.navigatingTo = navigatingTo;
function loaded(args) { page = args.object; page.bindingContext = vm; vm.set('selectedVideo', ''); appSettings.setString("vidfile",""); appSettings.setNumber("duration", 0); Advanced_1.AdvancedVideoView.requestPermissions(); recorder = args.object.page.getViewById("recorderView"); vm.set('duration', recorder && recorder.duration ? recorder.duration : 0); // vm.set('duration', recorder && recorder.duration ? recorder.duration : appSettings.getNumber("duration")); recorder.on('started', args => { interval = setInterval(() => { vm.set('duration', recorder.duration); // if (recorder.duration > 9){ //Set to 44 for maximum 45 seconds of video // clearInterval(interval); // // alert("You have reached the 45 second video limit");
// stoprecordingbutton.notify({eventName: "tap", object: stoprecordingbutton});
// } }, 1000); }); recorder.on('finished', args => { clearInterval(interval); var vidfile = args.object.get('file'); alert(vidfile); page.bindingContext.set('selectedVideo', args.object.get('file')); appSettings.setString("vidfile", vidfile); durationlabel.text = "Video Length "+recorder.duration+" Secs"; }); videoplayer = args.object.page.getViewById("videoplayer"); videoplayer.className="hideObject"; recorder.className="showObject"; stoprecordingbutton = args.object.page.getViewById("stoprecordingbutton"); recordvideobutton = args.object.page.getViewById("recordvideobutton"); retakevideobutton = args.object.page.getViewById("retakevideobutton"); durationlabel = args.object.page.getViewById("durationlabel"); durationlabel.class = "showObject"; completestack = args.object.page.getViewById("completestack"); completestack.className="hideObject"; recorderstack = args.object.page.getViewById("recorderstack"); recorderstack.className="showObject"; } exports.loaded = loaded;
function recordVideo(){ // var duration = appSettings.getNumber("duration"); // if (duration >= 0 ){ // dialogs.confirm({ // title: "Warning", // message: "Are you sure you want to retake the video!", // okButtonText: "Yes", // cancelButtonText: "No" // }).then(function (result){; // if (result == false) { // return; // } // else { videoplayer.className="hideObject"; recordvideobutton.isEnabled=false; recordvideobutton.className="fadeObject"; recorder.startRecording(); //} // }); // } } exports.recordVideo = recordVideo;
function retakeVideo(args){ var duration = appSettings.getNumber("duration"); if (duration >= 0 ){ dialogs.confirm({ title: "Warning", message: "Are you sure you want to retake the video?\nIf Yes, the video will start recording after dismissing this messaage.", okButtonText: "Yes", cancelButtonText: "No" }).then(function (result){; if (result == false) { return; } else { vm.set('duration', 0); appSettings.setNumber("duration",0); recorder.className="showObject"; videoplayer.className="hideObject"; recorderstack = args.object.page.getViewById("recorderstack"); completestack = args.object.page.getViewById("completestack"); durationlabel = args.object.page.getViewById("durationlabel"); //durationlabel.class = "showObject"; //durationlabel.class="videotime"; durationlabel.text = "Video Length 0 Secs"; recorderstack.className="showObject"; completestack.className="hideObject"; page.bindingContext.set('selectedVideo', ''); videoplayer.className="hideObject"; recordvideobutton.isEnabled=false; recordvideobutton.className="fadeObject"; recorder.startRecording(); } }); }
} exports.retakeVideo = retakeVideo;
function stopRecording(args){ // if (recorder.duration > 4){ recorder.stopRecording(); appSettings.setNumber("duration", recorder.duration); recorder = args.object.page.getViewById("recorderView"); recorderstack = args.object.page.getViewById("recorderstack"); completestack = args.object.page.getViewById("completestack"); //durationlabel = args.object.page.getViewById("durationlabel"); //durationlabel.text = "Video Length "+recorder.duration+" Secs"; //durationlabel.class = "hideObject"; recordvideobutton.isEnabled = true; recordvideobutton.className="unfadeObject"; retakevideobutton = args.object.page.getViewById("retakevideobutton"); retakevideobutton.isEnabled = true; recorder.className="hideObject"; videoplayer.className="showObject"; recorderstack.className="hideObject"; completestack.className="showObject";
// } } exports.stopRecording = stopRecording;
function goToVideoRecorder(event){ frame_1.goBack(); } exports.goToVideoRecorder = goToVideoRecorder;
function saveVideo(){ var vidfile = appSettings.getString("vidfile"); if (vidfile == ""){ dialogs.confirm({ title: "Warning", message: "You must take a video of the vehicle to complete the sign in process!", okButtonText: "OK", }); return; } const movetosigninloc = { moduleName: "signinloc/signinloc-page", animated: true, clearHistory: false, transition: { name: "flip", duration: 380, curve: "easeIn" } }; frame_1.topmost().navigate(movetosigninloc); } exports.saveVideo = saveVideo;`