How to upload RecordRTC blob file to Rails paperclip in AJAX

前端 未结 2 1653
生来不讨喜
生来不讨喜 2021-01-03 13:14

On the client side, the user uses RecordRTC to record a short video. When the user presses upload, I will get the video\'s blob data using recorder.getBlo

2条回答
  •  失恋的感觉
    2021-01-03 13:29

    In the end, the cause of problem is that the blob file returned from recorder.getBlob() is not an actual blob. Refer to the answer from muaz-khan.

    I added the following lines in RecordRTC to get the real blob and do the same AJAX submitted. Everything work now.

             getBlob: function () {
                 return blobURL2;
             },
    +        getRealBlob: function() {
    +            return blobURL;
    +        }, 
    

提交回复
热议问题