apache / apache/cordova-plugin-media

Start record return error code 1 on Android

Open
#178 2 comments 2 reactions 0 assignees View on GitHub
platform: android support
Dominant language
JavaScript
Stars
391
Forks
762
PR merge metrics
No merged PRs in 30d

Description

Hello everyone,
I use the version 5.0.2.
When i start a record like code below, the plugin returns an error : code 1, only on android.
Could you help me please?

My code is :

```
var fileName = 'test.3gp';
var filePathAudio = this.file.dataDirectory.replace(/file:\/\//g, '') + fileName;
var fileAudio1 = this.media.create(filePathAudio);

fileAudio1.onStatusUpdate.subscribe((status) => {
alert(status);
if(status==this.media.MEDIA_RUNNING) {
alert("it s running");
}
});

fileAudio1.onError.subscribe((error) => {
this.safetynApi.displayAlert('fileAudio1 :'+ error);
this.safetynApi.displayAlert(error);
});

fileAudio1.startRecord();
```

Thanks in advance.

Best regards

Contributor guide

Open the contributing guide

Research direction

Start with the supplied create(...).startRecord() flow on Android and the onError callback, then identify what error code 1 represents in the plugin's Android implementation. Reproduce the report using the stated 5.0.2 setup and verify that recording starts without the code 1 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
audio-video-rtc, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.