apache / apache/cordova-plugin-media
When I recorded, I had the following error:FAILED renaming xx to xx,Couldn't open xx java.io.FileNotFoundException: No content provider
- Dominant language
- JavaScript
- Stars
- 391
- Forks
- 762
- PR merge metrics
- No merged PRs in 30d
Description
Here is my code snippet:
```
if (this.platform.is('ios')) {
this.file.createFile(this.file.cacheDirectory, this.voiceMediaObj.fileName, true).then(entry => {
this.voiceMediaObj.vocieMediaFile = this.media.create(entry.toURL());
});
} else if (this.platform.is('android')) {
this.voiceMediaObj.vocieMediaFile = this.media.create(this.voiceMediaObj.vocieMediaFilePath);
}
this.voiceMediaObj.vocieMediaFile.startRecord();
```
When the stopRecord () method is called, the following error occurs:
```
09-09 22:57:35.848 16978-17106/net.ws315.dalai D/AudioPlayer: renaming /storage/emulated/0/tmprecording-1536505053393.3gp to /data/user/0/net.ws315.dalai/cache/1536505053071.aac
09-09 22:57:35.849 16978-17106/net.ws315.dalai E/AudioPlayer: FAILED renaming /storage/emulated/0/tmprecording-1536505053393.3gp to /data/user/0/net.ws315.dalai/cache/1536505053071.aacFAILED renaming /storage/emulated/0/tmprecording-1536505053393.3gp to /data/user/0/net.ws315.dalai/cache/1536505053071.aac
09-09 22:57:35.849 16978-17106/net.ws315.dalai W/PluginManager: THREAD WARNING: exec() call to Media.stopRecordingAudio blocked the main thread for 114ms. Plugin should use CordovaInterface.getThreadPool().
09-09 22:57:35.910 16978-17108/net.ws315.dalai W/MediaPlayer: Couldn't open /data/user/0/net.ws315.dalai/cache/1536505053071.aac: java.io.FileNotFoundException: No content provider: /data/user/0/net.ws315.dalai/cache/1536505053071.aac
09-09 22:57:35.911 16978-17108/net.ws315.dalai I/MediaPlayerNative: setDataSource(114, 0, 576460752303423487)
09-09 22:57:35.913 16978-17108/net.ws315.dalai E/MediaPlayerNative: Unable to create media player
Contributor guide
Research direction
Start at the stopRecord() call and the Media.stopRecordingAudio entry point, using the Android log paths shown in the report. Trace how the recorded file is renamed and then opened, and confirm that stopping a recording produces a playable file without the FileNotFoundException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- audio-video-rtc, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100