Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How could we implement to read mp4 video data as chunked byte arrays which is shown below is sends all byte buffer at the same time?

JavaScript
$(document).ready(function () {

    $('#btnUploadLocal').on('click', function () {

        var files = $("#file1").get(0).files;

        var reader = new FileReader();

        reader.onload = function (e) {
            var rawData = reader.result;
            
                var ajaxRequest = $.ajax({
                type: "POST",
                url: "http://x.x.x.x:8080/movefile",
                contentType: false,
                processData: false,
                data: rawData
            });

            ajaxRequest.error(function (e) {
                console.log(e);
            });
        }

        reader.readAsArrayBuffer(files[0]);
    });
});
Posted

 
Share this answer
 
Comments
kubibay 31-Mar-15 8:35am    
I have to do it on client side not on server side, I have to improve the existing code.
deepankarbhatnagar 31-Mar-15 8:37am    
ok
I can do it now using slice command;

JavaScript
var chunk = file.slice(offset, offset + chunkSize);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900