Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.0
-
Android 2.1 (Virtual), Android 3.1 (Motorolla Xoom). Built from Windows 7.
Description
Hi,
I was using getPicture to upload videos, but when I upgraded to cordova-1.5.0 I noticed that the only files that I was able to select where pictures instead of videos.
The Call I was doing is this one: navigator.camera.getPicture(onVideoURISuccess, onVideoURIFail,
{ quality:50, mediaType: Camera.MediaType.VIDEO, destinationType: _destinationType.FILE_URI, sourceType: source});
When I was using 1.4.1 the result was getting a list of videos from the gallery. Since I installed 1.5.0 I could only select images.
A code similar to what I was using is this one:
http://stackoverflow.com/questions/8940058/phonegap-crash-when-using-file-transfer-for-uploading-video-larger-than-15mb
<!DOCTYPE html>
<html>
<head>
<title>Video Uploader</title>
<meta name="viewport" content="width=device-width, initial-
scale=1">
<link rel="stylesheet" href="master.css" type="text/css" />
<script type="text/javascript" charset="utf-8"
src="phonegap-1.3.0.js"></script>
<script type="text/javascript" charset="utf-8">
function onLoad()
function onDeviceReady()
{ pictureSource=navigator.camera.PictureSourceType; destinationType=navigator.camera.DestinationType; } function uploadFile(mediaFile,method) {
var ft = new FileTransfer(),
path = mediaFile,
name = "video.3gp";
var options = new FileUploadOptions();
options.chunkedMode = false;
options.fileKey = "file";
options.fileName = name;
options.mimeType = "video/mpeg";
ft.upload(path,
"http://www.myserver.com/upload.php",
function(r)
,
function(error)
,
options);
}
function onPhotoURISuccess(imageURI)
function getVideo(source, type) {
navigator.camera.getPicture(onPhotoURISuccess, onFail,
);
}
function onFail(message)
</script>
</head>
<body onload="onLoad()">
<button class="btn"
onclick="getVideo(pictureSource.PHOTOLIBRARY,Camera.MediaType.VIDEO);">Get
Video</button>
</body>
</html>