What's the difference between BlobBuilder and the new Blob constructor?

前端 未结 3 1329
孤独总比滥情好
孤独总比滥情好 2020-12-31 06:14

The W3 announced that they intend to deprecate the BlobBuilder API in preference for the new Blob API.

If I am already using BlobBuilder in a JavaScript app, how can

相关标签:
3条回答
  • 2020-12-31 07:06

    Passing an ArrayBuffer to the Blob constructor appears to be deprecated, so:

    var dataView = new DataView(arrayBuffer);
    var blob = new Blob([dataView], { type: mimeString });
    
    0 讨论(0)
  • 2020-12-31 07:09
    var blob = new Blob([arrayBuffer], {type: mimeString});
    
    0 讨论(0)
  • 2020-12-31 07:18

    From what the specs says it should be as simple as this. Just check the examples of the page you posted.

    var blob = new Blob(arrayBuffer);
    

    [Constructor, Constructor((ArrayBuffer or Blob or DOMString)

    0 讨论(0)
提交回复
热议问题