2016-11-24 16 views
1

我是新手到科爾多瓦&與Android的Cordova Camera plugin遇到了一些問題。科爾多瓦視頻定位問題的android

當Android的拍攝視頻,視頻捕獲&保存在人像模式,但我上傳後得到的URL爲風景模式:


視頻捕捉方法:

Myscript.SocialVideocapture = function(){ 
var ramv; 
var options = { 
limit: 1, 
duration: 100000000 

}; 

navigator.device.capture.captureVideo(onSuccess, onError, options); 

function onSuccess(mediaFiles) { 

    VideoEditor.createThumbnail(
    trimSuccess, // success cb 
    trimFail, // error cb 
    { 
    fileUri: mediaFiles[0].fullPath, // the path to the video on the device 
    outputFileName: 'output-name', // the file name for the JPEG image 
    atTime: 2, // optional, location in the video to create the thumbnail (in seconds) 
    width: 320, // optional, width of the thumbnail 
    height: 480, // optional, height of the thumbnail 
    quality: 100 // optional, quality of the thumbnail (between 1 and 100) 
    } 
    ); 

    ramv=mediaFiles[0].fullPath; 
    var cvid=Math.floor((Math.random() * 1000000) + 1); 
    socialvideosendurl=mediaFiles[0].fullPath; 

} 

function onError(error) { 


} 
} 

文件上傳方法:

Myscript.Socialsendtoserver = function(event) { 



if ($$("#statusbox").val() == '') { 
    Appyscript.alert('Please Enter Status', 'Alert!'); 


} else { 

    Appyscript.showIndicator(); 

    var sfilekey; 
    var smimeType; 
    var sspath; 

    if (socialvideosendurl === undefined || socialvideosendurl === '') { 

     sfilekey = "file"; 
     smimeType = "text/plain"; 
     sspath = localStorage.getItem("dummysocial"); 

    } else { 

     sfilekey = "video"; 
     smimeType = "video/quicktime"; 
     sspath = socialvideosendurl; 

    } 


    var options = new FileUploadOptions(); 
    options.fileKey = sfilekey; 
    options.fileName = sspath.substr(sspath.lastIndexOf('/') + 1); 
    options.mimeType = smimeType; 
    var params = new Object(); 

    options.params = params; 
    params.appId = appId; 
    params.userId = localStorage.getItem("userid"); 
    params.status = $$("#statusbox").val(); 
    params.tag = "myimage"; 
    params.image = JSON.stringify(sendsoimages); 
    params.actionType = "addPost"; 

    options.params = params; 

    options.chunkedMode = false; 

    var ft = new FileTransfer(); 


    ft.upload(sspath, site_url + '/webservices/SocialNetworkPost.php', win, fail, options); 


} 

} 

Original Video File Uploaded

Video File I am getting from server

  • 它是在我的代碼在服務器端問題或問題?

回答

0

我徹底檢查了我的代碼,發現用於文件上傳的API正在改變視頻從縱向到橫向的方向。

所以文件上傳代碼是正確的。

謝謝您考慮的問題