Members
-
The types of loading a resource can use.
Properties:
Name Type Default Description XHRnumber 1 Uses XMLHttpRequest to load the resource.
IMAGEnumber 2 Uses an
Imageobject to load the resource.AUDIOnumber 3 Uses an
Audioobject to load the resource.VIDEOnumber 4 Uses a
Videoobject to load the resource. -
The types of resources a resource could represent.
Properties:
Name Type Default Description NONEnumber 0 DATA_URLnumber COMPLETEnumber LOADINGnumber -
The types of resources a resource could represent.
Properties:
Name Type Default Description UNKNOWNnumber 0 JSONnumber 1 XMLnumber 2 IMAGEnumber 3 AUDIOnumber 4 VIDEOnumber 5 TEXTnumber 6 -
The XHR ready states, used internally.
Properties:
Name Type Default Description DEFAULTstring text string
BUFFERstring arraybuffer ArrayBuffer
BLOBstring blob Blob
DOCUMENTstring document Document
JSONstring json Object
TEXTstring text String
Methods
-
Sets the load type to be used for a specific extension.
Name Type Description extnamestring The extension to set the type for, e.g. "png" or "fnt"
loadTypeResource.LOAD_TYPE The load type to set it to.
-
Sets the load type to be used for a specific extension.
Name Type Description extnamestring The extension to set the type for, e.g. "png" or "fnt"
xhrTypeResource.XHR_RESPONSE_TYPE The xhr type to set it to.
Type Definitions
-
Properties:
Name Type Argument Default Description loadElementHTMLImageElement | HTMLAudioElement | HTMLVideoElement <optional>
null The element to use for loading, instead of creating one.
skipSourceboolean <optional>
false Skips adding source(s) to the load element. This is useful if you want to pass in a
loadElementthat you already added load sources to.mimeTypestring | Array.<string> <optional>
The mime type to use for the source element of a video/audio elment. If the urls are an array, you can pass this as an array as well where each index is the mime type to use for the corresponding url index.
-
When the resource finishes loading.
Name Type Description resourceResource The resource that the event happened on.
-
When the resource reports loading progress.
Name Type Description resourceResource The resource that the event happened on.
percentagenumber The progress of the load in the range [0, 1].
-
When the resource starts to load.
Name Type Description resourceResource The resource that the event happened on.