cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lenny Turetsky (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-2601) Android: Media.stopRecord fails to save file when a full file path is specified
Date Thu, 07 Mar 2013 19:04:12 GMT

    [ https://issues.apache.org/jira/browse/CB-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13596192#comment-13596192
] 

Lenny Turetsky commented on CB-2601:
------------------------------------

Pull request submitted on Github from https://github.com/sweetleon/cordova-android

                
> Android: Media.stopRecord fails to save file when a full file path is specified
> -------------------------------------------------------------------------------
>
>                 Key: CB-2601
>                 URL: https://issues.apache.org/jira/browse/CB-2601
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>            Reporter: Lenny Turetsky
>            Assignee: Joe Bowser
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> The following JS code always results in a file with size 0, because the Java code at
org.apache.cordova.AudioPlayer.moveFile(String) attempts to move the file to /mnt/sdcard/mnt/sdcard/anything.amr
(note that /mnt/sdcard is duplicated).
> var recordToFile = 'anything.amr';
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function gotFS(fileSystem) {
> 		console.error("file system root: " + fileSystem.root.fullPath);
> 		var recordFilePath = fileSystem.root.fullPath + '/' + recordToFile;
> 		console.log('creating ' + recordFilePath);
> 		fileSystem.root.getFile(recordToFile, {create: true, exclusive: false}, function gotFile(fileEntry)
{
> 				console.log("creating media from " + JSON.stringify(fileEntry));
> 				console.log("file exists? " + fileEntry.file());
> 				listener = new Media(fileEntry.fullPath, function mediaStopped() {
> 					console.error("media done");
> 					showFileInfo(fileEntry);
> 				}, logToConsoleFunc("new Media"));
> 			function recorder(fileEntry) {
> 				showFileInfo(fileEntry);
> 				console.log("startRecord " + JSON.stringify(listener));
> 				listener.startRecord();
> 				setTimeout(function stopRecorder() {
> 					console.log("stopRecord " + JSON.stringify(listener));
> 					listener.stopRecord();
> 				}, RECORD_TIME_MS);
> 			}
> 			recorder(fileEntry);
> 			setTimeout(function() { showFileInfo(fileEntry); }, 2 * RECORD_TIME_MS);
> 		}, logToConsoleFunc("getFile"));
> 	}, logToConsoleFunc("requestFileSystem"));
> });

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message