Returns true if this resource provider accepts the given URL. Whether the URL is accepted or not is implementation specific. It could for example be that the specified URL must be relative to the Base URL, or that the protocol used is http. Note that this is not an "exists" check, calling fetch() with the given URL can still fail even if this method returns true.
If this method returns false, the fetch() method will fail with the specified URL.
Unloads all loaded EpubPublications, releasing any used resources.
Note: If ReaderPublications have been loaded using Publications from this instance, You must call readingSystemEngine.unloadPublication() or readingSystemEngine.destroy() before calling this method.
Disables the Colibrio implementation of the EPUB Open Container Format specification's Resource Obfuscation Algorithm (https://www.w3.org/publishing/epub3/epub-ocf.html#sec-resource-obfuscation). To support obfuscated resources, such as fonts, you need to add your own implementation and add it using the DrmManager.addEncryptionMethod method.
Enables the Colibrio implementation of the EPUB Open Container Format specification's Resource Obfuscation Algorithm (https://www.w3.org/publishing/epub3/epub-ocf.html#sec-resource-obfuscation). If you choose to disable this feature, you need to add your own implementation and add it using the DrmManager.addEncryptionMethod method.
Starts fetching a resource from this ResourceProvider. The returned Promise is resolved once a successful response is available.
The response includes both the metadata for the resource and methods for reading the resource body.
If a relative URL is specified, it will be resolved against the base URL of this ResourceProvider. If this ResourceProvider does not have a base URL, relative URLs will cause the returned Promise to be rejected.
Contrary to the browser Fetch API, this method MUST reject the returned Promise if the request is non-successful, such as if the resource could not be found.
The options
parameter can be used to configure how the resource should be fetched.
If the options
parameter is not defined, the fetch is performed using the default values specified in IResourceRequestOptions.
The absolute or relative URL to fetch.
Options for how to perform the fetch request.
Fetches metadata about a resource using the specified URL.
If a relative URL is specified, it will be resolved against the base URL of this ResourceProvider. If this ResourceProvider does not have a base URL, relative URLs will cause the returned Promise to be rejected.
The options
parameter can be used to configure the request.
If the options
parameter is not defined, the request is performed using the default values specified in IResourceRequestOptions.
The absolute or relative URL to the resource.
Options for how to perform the request.
Get the base URL for this ResourceProvider, if available. Relative URLs passed to fetch() or fetchMetadata() will be resolved using this base URL. The path component of the base URL SHOULD end with a forward slash.
If null is returned, relative URLs cannot be used with fetch() or fetchMetadata().
An OCF container can host multiple EPUB publications. This method returns the default publication in the OCF which is the first one defined in the container.xml file.
The DrmManager instance used for decrypting encrypted resources.
Get the mime-type of the EPUB OCF Container
Get all EPUB publication instances defined in the OCF container.xml file. The first item in the array is the default EPUB publication for the OCF according to the specification.
Get a list of ResourceMetadata items for all resources that can be fetched from this ResourceProvider instance. Returns null if this resource provider does not have a resource manifest.
For example, the ZipResourceProvider has a central directory containing metadata about all resources within the zip file, and would therefore return a resource manifest.
As another example, An HttpResourceProvider can probably not know about all available resources and should therefore return null.
If destroy() has been called on this instance.
Returns true if acceptsUrl() returns true for the URL, and the URL can be used by the browser directly without being fetched from the ResourceProvider.
For example: If true is returned, the URL can be assigned to the src
attributes of ,
Returns false otherwise.
Generated using TypeDoc
An EpubOcfResourceProvider is an implementation of the EPUB Open Container Format (OCF). https://www.w3.org/publishing/epub3/epub-ocf.html
The actual EPUB publication is contained in the OCF container. The OCF also specifies all encrypted resources within the container (see encryption.xml file).
Resources that are encrypted are decrypted using the DrmManager before it is returned. By default, the EpubOcfResourceProvider has support for the Resource Obfuscation Algorithm (https://www.w3.org/publishing/epub3/epub-ocf.html#sec-resource-obfuscation). In order to facilitate decryption for other algorithms you must provide the DrmManager with matching EncryptionMethod implementations.
See DrmManager for more information.