Javascript 使用Phonegap的Android设备视频
我将Phonegap与Android设备一起使用,我需要显示设备的视频 有人知道我该怎么做吗 这是我的代码:Javascript 使用Phonegap的Android设备视频,javascript,android,cordova,phonegap-plugins,Javascript,Android,Cordova,Phonegap Plugins,我将Phonegap与Android设备一起使用,我需要显示设备的视频 有人知道我该怎么做吗 这是我的代码: function getPhoto(source) { // Retrieve image file location from specified source navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, destinationType: destinationType.F
function getPhoto(source) {
// Retrieve image file location from specified source
navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
destinationType: destinationType.FILE_URI, sourceType: source });
}
但它只适用于图片。PhoneGap在Camera.options中提供了一个MediaType
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:设置要从中选择的媒体类型。仅当PictureSourceType为PHOTOLIBRARY或SAVEDPHOTOALBUM时有效。在nagivator.camera.MediaType(数字)中定义)”您尝试了什么?你能发一些代码吗?StackOverflow不是一个根据要求大量生产样品的网站。不过,如果您首先表明自己已经为此付出了一些努力,我们将很乐意为您提供帮助。我尝试了以下功能:函数getPhoto(source){//Retrieve image file location from specified source navigator.camera.getPicture(onPhotoURISuccess,onFail,{quality:50,destinationType:destinationType.file_URI,sourceType:source})}但它只处理图片请用代码编辑您的问题,在注释中很难阅读。另外,请看一下Phonegap。