Reputation: 7
I am using Phonegap with an Android device and I need to display the device's videos.
Do anyone know how I should do that?
This is my code:
function getPhoto(source) {
// Retrieve image file location from specified source
navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
destinationType: destinationType.FILE_URI, sourceType: source });
}
but it is only works with Pictures.
Upvotes: 0
Views: 172
Reputation: 990
PhoneGap offers a MediaType in Camera.options
Camera.MediaType = {
PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
ALLMEDIA : 2 // allow selection from all media types
}
"MediaType: Set the type of media to select from. Only works when PictureSourceType is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType (Number)"
Upvotes: 2