2015-10-10 16 views
7

Cordova yılında bu click Here çalıştı am nasıl android ve iOS galerisinden sadece video seçmek için bana herhangi bir yardım için medyadan video seçin ama lütfen o ... benim için çalışmıyorTelefon ekranındaki galeriden video nasıl seçilir?

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 
    }); 

değil

mediaType olabilir: aşağıdaki pasajı deneyebilirsiniz benim app uygulamak için bu aynı kodu alışkınım ama gelemiyorum ....

cevap

4

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 

Referans için this'u okuyun.

+0

Ben zaten @Rashwan L gibi test ettim, ama işe yaramaz –

+0

Herhangi bir hata mesajı aldınız mı? –

+0

Android için çalışıyor, iyi çalışıyor ama iOS denedim bu işe yaramıyor .. @Rashwan L –