Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. function send() {
  2. var superBuffer = new Blob(recordedBlobs, {type: 'video/webm'});
  3. $.ajax({
  4. url: '',
  5. method: 'post',
  6. data: {
  7. 'video': superBuffer,
  8. 'csrftoken': csrftoken,
  9. },
  10. dataType: 'json',
  11. success: function(data) {
  12. console.log(data)
  13. },
  14. error: function(error) {
  15. console.log(error)
  16. }
  17. });
  18. }
  19.  
  20. TypeError: 'slice' called on an object that does not implement interface Blob.
  21.  
  22. function download() {
  23. var blob = new Blob(recordedBlobs, {type: 'video/webm'});
  24. var url = window.URL.createObjectURL(blob);
  25. var a = document.createElement('a');
  26. a.style.display = 'none';
  27. a.href = url;
  28. a.download = blob;
  29. document.body.appendChild(a);
  30. a.click();
  31. setTimeout(function() {
  32. document.body.removeChild(a);
  33. window.URL.revokeObjectURL(url);
  34. }, 100);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement