Interface: Blob
torchlive/media.Blob
Properties
size
• Readonly
size: number
The Blob interface's size property returns the size of the Blob in bytes.
type
• Readonly
type: string
A string indicating the MIME type of the data contained in the Blob. If the type is unknown, this string is empty.
Methods
arrayBuffer
▸ arrayBuffer(): Promise
<Uint8Array>
The arrayBuffer()
function returns a Promise
that resolves with the
contents of the blob as binary data contained in an ArrayBuffer.
Returns
Promise
<Uint8Array>
slice
▸ slice(start?
, end?
): Blob
The `slice() function creates and returns a new Blob object which contains data from a subset of the blob on which it's called.
https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice
slice()
slice(start)
slice(start, end)
Parameters
Name | Type | Description |
---|---|---|
start? | number | An index into the Blob indicating the first byte to include in the new Blob. If you specify a negative value, it's treated as an offset from the end of the Blob toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is 0. If you specify a value for start that is larger than the size of the source Blob, the returned Blob has size 0 and contains no data. |
end? | number | An index into the Blob indicating the first byte that will not be included in the new Blob (i.e. the byte exactly at this index is not included). If you specify a negative value, it's treated as an offset from the end of the Blob toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is size . |
Returns
A new Blob object containing the specified subset of the data contained within the blob on which this method was called. The original blob is not altered.