code: function arrayBufferToDataURL(arrayBuffer, mimeType) {
    var uint8 = new Uint8Array(arrayBuffer);
    var data = '';
  
    // TypedArray.prototype.forEach is not supported in some browsers.
    forEach(uint8, function (value) {
      data += fromCharCode(value);
    });
  
    return 'data:' + mimeType + ';base64,' + btoa(data);
  }
docs: Transform array buffer to Data URL.
  @param {ArrayBuffer} arrayBuffer - The array buffer to transform.
  @param {string} mimeType - The mime type of the Data URL.
  @returns {string} The result Data URL.