apache / cordova-plugin-media-capture Goto Github PK
View Code? Open in Web Editor NEWApache Cordova Media Capture Plugin
Home Page: https://cordova.apache.org/
License: Apache License 2.0
Apache Cordova Media Capture Plugin
Home Page: https://cordova.apache.org/
License: Apache License 2.0
Hi everyone,
First of all thanks for the plugin, I would like to know if i could use this plugin for to get multiple pictures from photogallery to be uploaded on Ionic 4 through Firebase.
Thank you so much
Regards
I am getting an error when I try to capture an image on android that is indicating that I do not have permission to write to external storage on an android 9.0 emulator. I do not see anything in the docs about needing to do this, and I do see that the permission has been added to the android manifest. Is this something that I need to request manually? Could the docs be updated to reflect this?
It seems like we may be experience the same bug that Cordova-Plugin-Camera is experiencing.
apache/cordova-plugin-camera#506
Any thoughts on a fix?
My localURL is
cdvfile://localhost/temporary/59284040337__0D7B9C83-F037-4886-A92A-064688556823.MOV
and the fullPath is
/private/var/mobile/Containers/Data/Application/021133A7-158B-4EDE-8EDD-CB330EBC21E2/tmp/59284040337__0D7B9C83-F037-4886-A92A-064688556823.MOV
I'm trying to get the videos up to FireBase, but this seems to be a corrupted file. See full mediaFile output here:
end: 0
fullPath: "/private/var/mobile/Containers/Data/Application/2802BF6F-AF3B-472A-ADB4-D14463487C42/tmp/59284400184__ABFE96DC-550B-46F1-AEBF-5DE5F7F17F7A.M…"
lastModified: null
lastModifiedDate: 1571151205370.55
localURL: "cdvfile://localhost/temporary/59284400184__ABFE96DC-550B-46F1-AEBF-5DE5F7F17F7A.MOV"
name: "59284400184__ABFE96DC-550B-46F1-AEBF-5DE5F7F17F7A.MOV"
size: 3672746
start: 0
type: "video/quicktime"
Good Day!
In iOS, the media file is stored in the 'tmp' directory. The file in the 'tmp' has a different name and size compared to the file that is found in the Photos app. I need to get the original file or file path with the correct file size and send it to a server. In android, it worked like a charm and I was able to get the original file.
Thank you!
The build for all PRs is failing for Safari Selenium tests on Linux macOS.
When you press the capture audio button it first asks for permission to use the microphone, then it opens the microphone in a full screen that covers the statements that I would like to be read, so the user can record but cannot see the statements they are supposed to read into the microphone.
here is some code showing the issue, first the html showing 3 statements that I would like the user to record, and the capture audio button, and then the ts file:
here is the html
<ion-content>
<ion-grid>
<ion-row>
<ion-col>
<h1 class="ion-text-center">Record these statments</h1><br>
<p class="ion-text-center">
Go somewhere quiet.. and record these statements with as much enthusiasim as you can!
</p>
1. I am worthy of success. I am worthy of peace.<br><br>
2. I accept myself as I am. I love myself as I am. I release all limiting thoughts. I honor myself always.<br><br>
3. I am fearless. I am Powerful.<br><br>
<div class="ion-text-center">
<ion-button color="danger" (click)="captureAudio()">
<ion-icon name="mic"></ion-icon>Capture Audio</ion-button>
</div>
<ion-list style="background-color:#f0f0f0">
<ion-radio-group value="1" required id="recordingradio">
<ion-item *ngFor="let file of mediaFiles" tappable (click)="play(file)" text-wrap>
My Recording
<ion-radio id="recording" name="recording" required value="1"></ion-radio><br><br><br>
<ion-button slot="end" color="success" href="/results" id="submit">
<ion-icon name="arrow-forward-circle" slot="start"></ion-icon>Continue</ion-button>
</ion-item>
</ion-radio-group>
</ion-list>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
Here is the .ts file
import { Component, OnInit, ViewChild } from '@angular/core';
import { NavController } from '@ionic/angular';
import { MediaCapture, MediaFile, CaptureError, CaptureVideoOptions } from '@ionic-native/media-capture/ngx';
import { Storage } from '@ionic/storage';
import { Media, MediaObject } from '@ionic-native/media/ngx';
import { File } from '@ionic-native/file/ngx';
const MEDIA_FILES_KEY = 'mediaFiles';
@Component({
selector: 'app-confidence2',
templateUrl: './confidence2.page.html',
styleUrls: ['./confidence2.page.scss'],
})
export class Confidence2Page implements OnInit {
mediaFiles = []
constructor(public navCtrl: NavController, private mediaCapture: MediaCapture, private storage: Storage, private media: Media, private file: File) {}
ionViewDidLoad() {
this.storage.get(MEDIA_FILES_KEY).then(res => {
this.mediaFiles = JSON.parse(res) || [];
});
}
captureAudio(){
this.mediaCapture.captureAudio().then(res => {
this.storeMediaFiles(res);
}, (err: CaptureError) => console.error(err));
}
play(myFile) {
if (myFile.name.indexOf('wav.') > -1) {
const audioFile: MediaObject = this.media.create(myFile.localURL);
audioFile.play();
} else {
let path = this.file.dataDirectory + myFile.name;
let url = path.replace(/file^\/\//, '');
}
}
storeMediaFiles(files) {
console.log('store: ', files);
this.storage.get(MEDIA_FILES_KEY).then(res => {
if (res) {
let arr = JSON.parse(res);
arr = arr.concat(files);
this.storage.set(MEDIA_FILES_KEY, JSON.stringify(arr));
} else {
this.storage.set(MEDIA_FILES_KEY, JSON.stringify(files))
}
this.mediaFiles = this.mediaFiles.concat(files);
})
}
ngOnInit() {
}
}
when emulating on all devices
ionic 6.6.0
plugins:
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.0 "cordova-plugin-ionic-webview"
cordova-plugin-media 5.0.3 "Media"
cordova-plugin-media-capture 3.0.3 "Capture"
cordova-plugin-nativeaudio 3.0.9 "Cordova Native Audio"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
It works fine on iOS, but I get FileError with error code 1 on Android (tested 6.0, 7.0, 8.0).
I tried reading it with FileReader, as well as copying it with fileEntry.copyTo(), same error. Can't read it with XHR either.
The file exists, but can't seem to be read in any way by Cordova.
Sample code below:
navigator.device.capture.captureVideo(
function(mediaFiles){
window.resolveLocalFileSystemURL(
window.cordova.file.externalApplicationStorageDirectory,
function(dirEntry){
window.resolveLocalFileSystemURL(mediaFiles[0].fullPath,
function(fileEntry){
fileEntry.file(function(file){
var reader = new FileReader();
reader.onloadend = function(result) {
console.log('Loaded');
};
reader.onerror = function(error) {
console.error(error);
};
reader.readAsArrayBuffer(file);
});
},
null
);
},
null
);
}
);
Creating a mobile interviews application and recording 30 minute videos ( 30 number of 1 minute clips using the limit and duration options of the media capture plugin)
Need to upload video after every clip of recording to server.
Currently all video clips are returned in the MediaFile array after the recording is completed and not after each clip is recorded.
Please advise how to get the recorded file for each clip of recording, so that same can be uploaded to the server .Also the recording stops and same has to be started after each clip of recording.
Trow error 20
Api not available?
expect to record audio
It trows an error , error 20
cordova-plugin-media-capture 3.0.3 "Capture"
cordova 9
installed app-debug.apk
Linux 8.04
Cordova 9
using VSCODE
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady (){
const startButton = $('.startAudioRecorder');
const stopButton = $('.stopAudioRecorder');
startButton.on('click', recordAudio);
function recordAudio() {
console.log('starting recording!');
var options = { limit: 1, duration: 10 };
navigator.device.capture.captureAudio(captureSuccess, captureError, options);
function captureSuccess(){
navigator.notification.alert('it did work..');
}
function captureError( error ){
navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
}
stopButton.on('click', () => {
console.log('stoping reconrding');
/*
mediaRec.stopRecord();
mediaRec.release();
*/
stopButton.off('click');
});
}
}
Hi,
is the plugin working on Windows Mobile 10. I'm getting the following error : "plugin not installed"
even that the plugin is installed.
cordova-plugin-media-capture 3.0.2 "Capture"
Same app is working fine on iOS, Andorid !?
I used captureVideo function on the browsers of Android and iOS, but not working
I am getting the error code, 20.
This plugin working on Android and iOS, but not browser.
I did the following;
ionic cordova run browser
While recording video, it says Size limit reached on few phones
It's now possible to dismiss the audio recording modal with a swipe on iOS 13. After you do that, the audio recorder keeps working, never calls any callback and won't let you start another recording.
One should be able to interact with the recorder as they did before. Swiping should not be an issue.
I'd expect swiping away the modal to be the same as clicking Done.
When you swipe away the modal, it gets hidden but no recording callbacks get called and the recorder seems to linger in the background. This prevents attempts at trying a new recording.
The new swipeable modals are an iOS 13 feature. There is a way to prevent swiping.
Call this in the js console:
navigator.device.capture.captureAudio();
After the recording modal opens, swipe it away.
Tested with iPhone 6, iOS 13.
$ cordova -v
9.0.0 ([email protected])
$ cordova platform list
Installed platforms:
ios 5.0.1
Plugin version: 3.0.3
XCode version: 11.1
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Apache Cordova uses GitHub Issues as a feature request and bug tracker only.
For usage and support questions, please check out the resources below. Thanks!
You can get answers to your usage and support questions about Apache Cordova on:
cordova
If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels:
In our application we would need to get informed in the moment the user starts pressing the record button.
Our usecase: we are recording the current geoposition while capturing the video, so we need the exact time when the user starts and stops.
Is there any kind of event or a callback which gets called when the user actually presses the record button?
Would be nice if v 3.0.3 was available on npm
Would like to use latest version with fixes
Is there any way to disable the pause button during video capture as I wanted to capture video continuously
Hello guys,
Im using this plugin to capture video, the videos are recorded properly and so is the videoURL returned. I move the file to a private location and encrypt it afterwards.
My question is related to the Android gallery app, even after moving he file, it appears on the gallery miniatures and fortunately an error is thrown "File not found".
How do i prevent that gallery miniature?
It should not throw error and compress successfully.
net.ypresto.androidtranscoder.engine.InvalidOutputFormatException: Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: 100
this._videoEditor.transcodeVideo({
fileUri: file,
outputFileName: 'video-output-' + new Date().getTime().toString(),
saveToLibrary: false,
optimizeForNetworkUse: this._videoEditor.OptimizeForNetworkUse.YES,
outputFileType: this._videoEditor.OutputFileType.MPEG4
}).then((fileUri: string) => {
this._shared.Loader.hide();
setTimeout(() => {
this.uploadFile(fileUri, 'video');
}, 500);
})
Device: Moto one power android 10
Device: Real me pro android 9
Ionic:
Ionic CLI : 5.4.15 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.2
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, (and 20 other plugins)
Utility:
cordova-res (update available: 0.9.0) : 0.8.1
native-run : 0.3.0
System:
Android SDK Tools : 26.1.1 (/home/infini/Android/Sdk)
NodeJS : v12.13.1 (/usr/local/bin/node)
npm : 6.13.7
OS : Linux 4.15
Media Capture retruns Error Code 3 msg: "cancelled" If more than one camera application is present in Mobile
Record video on android phone using the plugin
the fullpath is file:///storage/emulated/0/DCIM/Camera/VID_20190523_184820.mp4
How should I use cordova-plugin-file to read it ?
Here's my code:
I want to get the 'reader.result', thank you very much !
window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, function (dirEntry) {
dirEntry.getFile(_this.filename, { create: true, exclusive: false }, function (fileEntry) {
fileEntry.file(function (file) {
var reader = new FileReader()
reader.onloadend = function () {
console.log('Successful file read: ' + reader.result)
}
})
})
After requesting and recording a video, no "accept"/"reject"/hook/cross -or whatever- button is showing, so the user does not know what to do.
When using the hardware back button the app receives an exception with code 3 "Canceled" as if the recording was canceled, even though a recording was made.
Any interface telling the user what to do with the video and how to return to the app like the X and the check mark or the "use video" and "retake" in iOS showing.
Nothing.
Tested with an Android 6-Phone and there cross and the check mark appear after having a video recorded.
As long as there is no way to go back into the app without triggering the code-3-cancel-error there is no way to get a video.
let options: CaptureVideoOptions = {
duration: this.targetVideoLength,
limit: 1
};
let data = await this.mediaCapture.captureVideo(options);
Ionic:
Ionic CLI : 5.4.5 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 8.1.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-webview 2.5.2, (and 18 other plugins)
"cordova-plugin-media-capture": "3.0.2",
Utility:
cordova-res : 0.6.0 (update available: 0.8.1)
native-run : 0.2.9
System:
Android SDK Tools : 26.1.1 (/Users/jpf/Library/Android/sdk)
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v12.6.0 (/usr/local/Cellar/node/12.6.0/bin/node)
npm : 6.10.2
OS : macOS Catalina
Xcode : Xcode 11.2 Build version 11B52
the plug in has over ridden and disabled @ionic/storage
and am now unable to persist data
not to delete data and be able to use the plugin
while implementing an option to select a photo from their device I installed the newest version of the plug in and the npm package. After install my application was restarted and any and all data that was stored related to the application was wiped out. Now I am unable to persist any data, even after removing the plugin and npm package
$ ionic cordova plugin add cordova-plugin-media-capture
$ npm install @ionic-native/media-capture
Android device, Ionic 4, Angular 7
OS Mojave 10.14
ionic 4
Angular 7
Is this plugin works on chrome browser ?
Hello,
On IOS, when we get the media file, after the record, the file generated seems ok, but in fact, if we use the parameter fullPath as local path in order to upload the file on a server by FTP, the file uploaded on the server is not whole.
I think that there's is a bug , could you check please?
Best regards
Why dont you consider adding the repo on issuehunt.io so that the business community that actually uses the plugin and profits from it, can help with bug fixing? The precious open source developers who work to support and solve the bugs or create new features, need a basic incentive.
That is what react native is actually doing and from what I see it is actually working!
https://github.com/react-native-community/react-native-camera
Developers actually need to be rewarded I think for their time.
I think it is pure logic.
We all want to help the open source community but sometimes the only way for a non-developer is to give the incentive to another developer to solve a bug.
Please consider it!
Hello, is there any possibility to have a setting in CaptureImageOptions to not display the confirmation dialog after each picture you make? It is annoying to always have to click the 'confirm' button each time while doing 100 pictures at once.
iPhone sampling rate starts wrong and later 'corrects itself'
Using the plugin I record and playback audio. On my iPad everything is fine. On the iPhone the sampling rate changes between the first recording and subsequent recordings. How can I initialize the app so that all recordings are at 44100Hz?
On my iPhone (and iPad) I expect a constant sampling rate of 44100Hz.
On my iPad (iOS 12.+) everything works as expected. On my iPhone (iOS 12.+) the first recording takes place at a sampling rate of 48000Hz. Subsequent recordings are at the desired rate of 44100Hz.
I verified this using an external tone of 1000Hz and spectral analysis on the two devices. The analysis shows a frequency of 1000Hz on the iPad but the first time on the iPhone this frequency is 918.75HZ = 1000*(44100/48000). For the record, the same cordova-generated app is run on both devices, no error messages are generated, and I do not change the sampling rate on the iPhone. It happens “by itself” through the plugin.
function audioMedia(val) {
mediaType = 'audio';
var audioNum = val;
myAudio = null;
// captureAudioSuccess callback
var captureAudioSuccess = function(mediaFiles) {
acquired[audioNum] = true;
var path = null;
var len = mediaFiles.length;
for (var i = 0; i < len; i++) {
path = mediaFiles[i].fullPath;
console.log('media full path = '+path, len);
readMedia(mediaFiles[0].name,audioNum);
}
};
// captureAudioError callback
var captureAudioError = function(error) {
alert('No audio was recorded. Try again?');
};
// start audio capture
navigator.device.capture.captureAudio(captureAudioSuccess, captureAudioError, audioOptions);
};
iPhone 6s, iPhone 7
cordova: 9.0.0 ([email protected])
From my config.xml file: "cordova-plugin-media-capture" spec="^3.0.2"
Hi,
I'm using the plugin version 3.0.2 with a Samsung Galaxy S7 and Android 8.0.0.
Sometimes when I'm using the capture.captureImage
function with the limit
of 9, the camera app crashes after a couple of photos taken with the same capture operation. I noticed that if I reduce the limit
option to 1, the camera app doesn't crash anymore.
I've gathered a couple of exceptions and interesting logs that showed up on Logcat during this crashes. Those are:
08-15 11:19:17.528 28237 28237 E AndroidRuntime: FATAL EXCEPTION: main
08-15 11:19:17.528 28237 28237 E AndroidRuntime: Process: com.sec.android.app.camera, PID: 28237
08-15 11:19:17.528 28237 28237 E AndroidRuntime: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000010 (has extras) } in com.sec.android.app.camera.provider.CameraTemperatureManager$1@cdd2e9f
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52226(LoadedApk.java:1329)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.$m$0(Unknown Source:4)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.run(Unknown Source:0)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:789)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:98)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6944)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'boolean com.sec.android.app.camera.interfaces.CameraContext.isDestroying()' on a null object reference
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at com.sec.android.app.camera.provider.CameraTemperatureManager$1.onReceive(CameraTemperatureManager.java:76)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52226(LoadedApk.java:1319)
08-15 11:19:17.528 28237 28237 E AndroidRuntime: ... 9 more
08-15 11:59:52.650 27329 30945 E ImageFeatures: [#CMH#] applyJustShotFlag : java.io.FileNotFoundException: /storage/emulated/0/Pictures/1534327192619.jpg (No such file or directory) (/storage/emulated/0/Pictures/1534327192619.jpg (No such file or directory))
08-15 11:59:52.650 27329 30945 E ImageFeatures: at java.io.FileInputStream.open0 (FileInputStream.java:-2)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at java.io.FileInputStream.open (FileInputStream.java:200)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at java.io.FileInputStream.<init> (FileInputStream.java:150)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at java.io.FileInputStream.<init> (FileInputStream.java:103)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at android.media.ExifInterface.<init> (ExifInterface.java:1329)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at com.samsung.cmh.features.ImageFeatures.isJustShot (ImageFeatures.java:54)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at com.samsung.cmh.core.Controller.processInsertAction (Controller.java:2544)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at com.samsung.cmh.core.Controller.execute (Controller.java:991)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at com.samsung.cmh.service.CMHService.onHandleIntent (CMHService.java:100)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at android.app.IntentService$ServiceHandler.handleMessage (IntentService.java:68)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at android.os.Handler.dispatchMessage (Handler.java:105)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at android.os.Looper.loop (Looper.java:164)
08-15 11:59:52.650 27329 30945 E ImageFeatures: at android.os.HandlerThread.run (HandlerThread.java:65)
08-15 11:59:52.650 27329 30945 E ImageFeatures:
08-15 11:56:26.329 3292 28336 E ExynosCameraMemoryAllocator: @@@@ERR(alloc):*bufHandle == NULL failed
08-15 11:56:26.329 3292 28336 E ExynosCameraMemoryAllocator: ERR(dequeueBuffer):alloc failed
08-15 11:56:26.329 3292 28336 E ExynosCameraBufferManager: [CAM_ID(0)][PREVIEW_BUF]-ERR(m_bufferCollectorThreadFunc[2641]):dequeueBuffer failed, dequeue(6), collected(4)
08-15 11:56:26.329 3191 3215 E BufferQueueProducer: [SurfaceView - com.sec.android.app.camera/com.sec.android.app.camera.Camera@4c2063b@0#0] dequeueBuffer: BufferQueue has been abandoned
08-15 11:56:26.329 3292 28336 E ExynosCameraMemoryAllocator: ERR(alloc):dequeue_buffer failed
08-15 11:56:26.329 3191 3215 E BufferQueueProducer: [SurfaceView - com.sec.android.app.camera/com.sec.android.app.camera.Camera@4c2063b@0#0] dequeueBuffer: BufferQueue has been abandoned
08-15 11:56:26.329 3292 28336 E ExynosCameraMemoryAllocator: ERR(alloc):dequeue_buffer failed
08-15 11:56:26.329 3191 3215 E BufferQueueProducer: [SurfaceView - com.sec.android.app.camera/com.sec.android.app.camera.Camera@4c2063b@0#0] dequeueBuffer: BufferQueue has been abandoned
08-15 11:56:26.330 3292 28336 E ExynosCameraMemoryAllocator: ERR(alloc):dequeue_buffer failed
08-15 11:56:26.330 3191 3215 E BufferQueueProducer: [SurfaceView - com.sec.android.app.camera/com.sec.android.app.camera.Camera@4c2063b@0#0] dequeueBuffer: BufferQueue has been abandoned
08-15 11:56:26.330 3292 28336 E ExynosCameraMemoryAllocator: ERR(alloc):dequeue_buffer failed
08-15 11:56:26.330 3191 3215 E BufferQueueProducer: [SurfaceView - com.sec.android.app.camera/com.sec.android.app.camera.Camera@4c2063b@0#0] dequeueBuffer: BufferQueue has been abandoned
08-15 11:56:26.330 3292 28336 E ExynosCameraMemoryAllocator: ERR(alloc):dequeue_buffer failed
The same app with the capture limit set to 9 doesn't crash in a Samsung Galaxy J5 with Android 7.0.
My cordova-plugin-file
, which is a dependency of this plugin, is at version 6.0.1
.
I have this permissions requested in my app: cordova.plugins.permissions.ACCESS_FINE_LOCATION, cordova.plugins.permissions.CAMERA, cordova.plugins.permissions.READ_EXTERNAL_STORAGE, cordova.plugins.permissions.WRITE_EXTERNAL_STORAGE
.
Any ideas here? I'm missing something?
On iOS 13.3 (iPhone 11 Pro Max) the app immediately crashes upon calling navigator.device.capture.captureVideo
.
The video capturing should start.
App crashes.
Here is my full code for Cordova:
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
var app = {
// Application Constructor
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
// deviceready Event Handler
//
// Bind any cordova events here. Common events are:
// 'pause', 'resume', etc.
onDeviceReady: function() {
this.receivedEvent('deviceready');
start();
},
// Update DOM on a Received Event
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
}
};
app.initialize();
async function start() {
/*
cordova.plugins.notification.local.schedule({
title: 'ayy lmao',
text: 'ayy lmao',
foreground: true
});
*/
// capture callback
var captureSuccess = function(mediaFiles) {
/*
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles[i].fullPath;
// do something interesting with the file
}
*/
};
// capture error callback
var captureError = function(error) {
//navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
};
// start video capture
navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:1});
}
Mojave 10.14.6 (18G103)
iOS 13.3 (iPhone 11 Pro Max)
iOS 13.3 (iPhone 11 Pro Max)
Cordova CLI
Xcode
App crash on oreo device when we give pemission for audio record
getting below issues
Audio No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND }
OS: iOS
Version: 12.1 (16B92)
Plugin Version: 3.0.2
Actual Behavior:
Captured photo is visible in Photos.
Expected Behavior:
Captured photo shouldn't be visible in Photos / CaptureOptions
should allow to define whether saved to Photos or not.
Details:
Any ideas why it is behaving like this?
Thank you!
I'm trying to include the media capture plugin in a cordova app I've been working on. However I've failed to implement it in the browser for even simple applications.
I searched around in stackoverflow and answers indicate that createObjectURL is supposed to be passed either Blob, File or MediaSources and not raw data but I'm unsure what exactly I need to do to get the plugin working for chrome.
I'm using all latest versions of chrome, cordova.
Good morning
All seems working with the samsung voice record, but when i use the audio record from sony i get this error:
11-15 11:20:02.150 13109-13170/com.horus.enterprise E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-2
Process: com.horus.enterprise, PID: 13109
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
at org.apache.cordova.mediacapture.Capture.createMediaFile(Capture.java:454)
at org.apache.cordova.mediacapture.Capture.onAudioActivityResult(Capture.java:369)
at org.apache.cordova.mediacapture.Capture$1.run(Capture.java:326)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Im using
Have set limits on video length recording is probably the case for 99.99% of us. Basically everyone except YouTube, because well, hosting ain't cheap.
It would be nice to have a multi functional record button to different the video functionality and correspond with a set video limit timer, ex. 30 seconds max.
Users are used to the round progress hold button in Snapchat, IG, etc. So it will be familiar that as the progress bar surrounding the circle comes close to eating it's tale, they are approaching the upper limit max of time they can record. There are various implementations of this 'hold to record' func (here's some old examples) and often just a button press is a camera snap, although many Cordova projects are using the camera plugin for that. Kind of a shame to use two plugins when this one could do a better job of both.
But ya, the record progress button has anyone done this yet?
How about auto recording video ?
I tried to use limited function ,that's proper functioning. But when I tried to use duration,it's not working on onePlus 3T but it's working on other Android Phone;
Hey I'm using @ionic-native/video-capture-plus but it show me error while adding android platform :
Failed to install 'nl.x-services.plugins.videocaptureplus': Error: ENOENT: no such file or directory, open '/Users/bhuminbhandari/Desktop/Projects/ionic/casedetails/platforms/android/AndroidManifest.xml'
Hi guys,
recently I am facing the Issue that my app crashes when I am trying to call the function "captureImage". The function did in fact work for quite some time, so I don't actually know why it doesn't anymore.
`
function captureImage(storePath) {
try {
var newPath = storePath;
var captureSuccess = function (mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles[i].fullPath;
let name = new Date().getTime();
moveFile(path, FILE_DIRECTORY + newPath, name + ".jpg");
}
};
// capture error callback
var captureError = function (error) {
navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
};
// start image capture
navigator.device.capture.captureImage(captureSuccess, captureError, { limit: 1 });
} catch(e) {
console.log(e);
}
}
`
The app doesn't even Catch the exception. Instead it just crashes. And leaves me this error-message:
"*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <MainViewController: 0x101513700>.'"
The "NSInvalidArgumentException" kinda confuses me a bit, as it seems like I am passing some wrong functions for success and error. But as mentioned before this code worked for me like for more than a year and I did not change anything since then.
Cordova version: 9.0.0
Cordova-Ins version: 4.5.5
iOS Version: 13.2.3
Device: iPad (6. Gen)
As far as i know, on android, only 2 apps support this pluggin (act = android.provider.MediaStore.RECORD_SOUND).
There are any more app that can run this plugin properly?
Android 8 - capture.captureAudio cause No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND
I want to make audio video recorder but this plugin is opening the device's audio/video recorder
please help with this I do not want to use device's audio/video recorder I want my app should record the media
I'm using this plugin cordova-plugin-media-capture to record audio, when i tap start recording, the plugin launch sound recorder app to record the audio, but i don't want that, i want something like WhatsApp, to record the audio without leaving my app (meaning without using another app sound recorder).
I just created a helloWord with the lib example, but I get the following error
HomePage.html:13 ERROR TypeError: Object(...) is not a function at MediaCapture.captureImage (vendor.js:81002) at HomePage.webpackJsonp.251.HomePage.meuTeste (main.js:175) at Object.eval [as handleEvent] (HomePage.html:13) at handleEvent (vendor.js:14225) at callWithDebugContext (vendor.js:15734) at Object.debugHandleEvent [as handleEvent] (vendor.js:15321) at dispatchEvent (vendor.js:10640) at vendor.js:11265 at HTMLButtonElement.<anonymous> (vendor.js:40129) at t.invokeTask (polyfills.js:3)
Ionic Framework: 3.9.3
Ionic App Scripts: 3.2.1
Angular Core: 5.2.11
Angular Compiler CLI: 5.2.11
Node: 10.15.1
OS Platform: Windows 10
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.