簡體   English   中英

Cordova Video Orientation問題android

[英]Cordova Video Orientation issue android

我是Cordova Camera plugin新手,在Android中遇到了Cordova Camera plugin一些問題。

在Android中拍攝視頻時,視頻會以縱向模式捕獲並保存,但上傳后的網址是橫向模式:


視頻捕獲方法:

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


}

}

原始視頻文件已上傳

視頻文件我從服務器獲取

  • 它是我的代碼中的服務器端問題還是問題?

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

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

謝謝你考慮這個問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM