0

我在 Android 设备上使用 Phonegap,我需要显示设备的视频。

有谁知道我应该怎么做?

这是我的代码:

function getPhoto(source) { 
// Retrieve image file location from specified source 
   navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, 
   destinationType: destinationType.FILE_URI, sourceType: source });
} 

但它只适用于图片。

4

1 回答 1

2

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)"

于 2012-12-03T16:42:27.387 回答