You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "imskull (JIRA)" <ji...@apache.org> on 2014/07/08 16:53:04 UTC
[jira] [Commented] (CB-3835) AudioPlayer - Playing audio - Renaming
error
[ https://issues.apache.org/jira/browse/CB-3835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14055005#comment-14055005 ]
imskull commented on CB-3835:
-----------------------------
[~dmihalcik]'s solution does not work for me, after researching the source code I found the problem.
the problem is caused by audio player is trying to rename file from sdcard to internal disk, the system will return error like this:
> failed on '/mnt/sdcard/tmprecording.3gp' - Cross-device link
if your AndroidPersistentFileLocation(in config.xml) set to internal and run app in a device with sdcard, you will encounter this error.
relative code in AudioPlayer.java:
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
this.tempFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/tmprecording.3gp";
} else {
this.tempFile = "/data/data/" + handler.cordova.getActivity().getPackageName() + "/cache/tmprecording.3gp";
}
I have no good solution, if you want a dirty one, change above code by removing if ... else... according to your project.
> AudioPlayer - Playing audio - Renaming error
> --------------------------------------------
>
> Key: CB-3835
> URL: https://issues.apache.org/jira/browse/CB-3835
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin Media
> Affects Versions: 2.7.0, 2.8.0, 2.9.0
> Environment: PhoneGap + jQuery Mobile 1.3.x + Android 2.3.x and higher
> Reporter: Joram Teusink
> Priority: Minor
> Labels: audioplayer, media, tmprecording.3gp
>
> When playing a media file (audio) from a url with AudioPlayer I get the following error in the console (logcat):
> - AudioPlayer : Send a onStatus update for the new seek
> - AudioPlayer : renaming /storage/emulated/0/tmprecording.3gp to /storage/emulated/0/http://...<rest of url>
> - AudioPlayer : FAILED renaming /storage/emulated/0/tmprecording.3gp to /storage/emulated/0/http://...<rest of url>
> The code is the same as in de demos in the PhoneGap docs.
> No errors in the app and playback works fine. And I noticed that in the root of the sdcard a tmprecording.3gp file was created. But did not see that one coming back after deletion.
--
This message was sent by Atlassian JIRA
(v6.2#6252)