- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings,
I am a newbie at hybrid coding and xdk. I am working on an app to upload images and videos to remote server along with other user details.
I have been able to get the images from the gallery and displaying them on the app before sending to the server.
var pictureSource; // picture source var destinationType; // sets the format of returned value document.addEventListener("deviceready",onDeviceReady,false); function onDeviceReady() { pictureSource=navigator.camera.PictureSourceType; destinationType=navigator.camera.DestinationType; } function pullPhoto(source) { // Retrieve image file location from specified source navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, destinationType: destinationType.FILE_URL, sourceType: source }); function onFail(message) { alert('Failed because: ' + message); } function onPhotoURISuccess(imageURI) { var smallImage = document.getElementById('smallImage'); smallImage.style.display = 'block'; smallImage.src = imageURI; }
However I have not been able to get it working for video files. I have tried
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
mediaType: navigator.camera.MediaType.VIDEO,
however I am able to get only images for selections instead of video files.
Kindly help
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Search the Internet for Cordova and PhoneGap solutions to your issue. The XDK creates standard Cordova applications. Any solutions that work for Cordova (and PhoneGap) will work for the XDK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Paul I've searched the internet put most of the solutions suggest that I include
mediaType: navigator.camera.MediaType.VIDEO,
However its not working for me. I've been only able to get Image files from it.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page