Class BlobURLContent
Defined in: URLContent.js.
Constructor Attributes | Constructor Name and Description |
---|---|
BlobURLContent(blob)
Content read from the URL of a
Blob instance. |
Method Attributes | Method Name and Description |
---|---|
<static> |
BlobURLContent.fromBlob(blob)
Returns an instance of
BlobURLContent for the given blob . |
<static> |
BlobURLContent.fromImage(image, imageType, observer)
Generates a BlobURLContent instance from an image.
|
getBlob(observer)
Returns the blob stored by this content, possibly asynchronously if
observer parameter is given. |
|
getStreamURL(observer)
Retrieves asynchronously an URL of this content usable for JavaScript functions with URL paramater.
|
Class Detail
BlobURLContent(blob)
Content read from the URL of a
Author: Louis Grignon, Emmanuel Puybaret.
Blob
instance.
Note that this class may also handle a File
instance which is a sub type of Blob
.
Author: Louis Grignon, Emmanuel Puybaret.
- Parameters:
- {Blob} blob
Method Detail
<static>
{BlobURLContent}
BlobURLContent.fromBlob(blob)
Returns an instance of
BlobURLContent
for the given blob
.
- Parameters:
- {Blob} blob
- Returns:
- {BlobURLContent}
<static>
BlobURLContent.fromImage(image, imageType, observer)
Generates a BlobURLContent instance from an image.
- Parameters:
- {HTMLImageElement} image
- the image to be used as content source
- {string} imageType
- resulting image blob mime type
- {function(BlobURLContent)} observer
- callback called when content is ready, with content instance as only parameter
{Blob}
getBlob(observer)
Returns the blob stored by this content, possibly asynchronously if
observer
parameter is given.
- Parameters:
- {{blobReady: function|blobError: function}} observer Optional
- optional observer which blobReady function will be called asynchronously once blob is available.
- Returns:
- {Blob} blob content
getStreamURL(observer)
Retrieves asynchronously an URL of this content usable for JavaScript functions with URL paramater.
- Parameters:
- {{urlReady: function|urlError: function}} observer
- optional observer
which
urlReady
function will be called asynchronously once URL is available.