如何从手机中的图库中选择视频?

请帮助我任何一个如何只选择在科尔多瓦的Android和iOS画廊的视频我试过这个点击这里从媒体选择视频,但它不适合我...

var pictureSource; 
var destinationType; 
var mediaType;

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
 pictureSource = navigator.camera.PictureSourceType;
 destinationType = navigator.camera.DestinationType;
 mediaType = navigator.camera.MediaType;
}

navigator.camera.getPicture(onPhotoURISuccess, onFail, {
  destinationType: destinationType.FILE_URI,
  mediaType: mediaType.VIDEO,
  sourceType: source
});

function onPhotoURISuccess(imageURI) {
  console.log(imageURI);
}

function onFail(message) {
  console.log(message); 
}

我使用这个相同的代码来实现我的应用程序,但它不能来....


你可以尝试下面的代码片段:

navigator.camera.getPicture(onSuccess, onFail, { quality: 100,
    destinationType: Camera.DestinationType.FILE_URI,
    sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
    mediaType: Camera.MediaType.VIDEO
  });

不是说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

参考阅读此。

链接地址: http://www.djcxy.com/p/88213.html

上一篇: how to select the video from gallery in phonegap?

下一篇: FindAll Vs Where