Options
All
  • Public
  • Public/Protected
  • All
Menu

NOTE: This feature is currently in BETA. Expect breaking changes to the APIs related with WpPublication/Audiobooks until the final 3.0.0 release.

WpPublication is a base format implementing the Publication Manifest specification: https://www.w3.org/TR/pub-manifest/

The only concrete supported implementation at the time of writing is W3C Audiobooks: https://www.w3.org/TR/audiobooks/

If you have an LPF file, use WpPublication.createFromBlob() or WpPublication.createFromRandomAccessDataSource() to create a WpPublication instance.

You can also create a WpPublication from a Primary Entry Page or Manifest file dereferenced from a URL by using WpPublication.createFromManifestUrl or createFromPrimaryEntryPageUrl.

To load the publication, first add a WpAudiobookFormatAdapter to the ReadingSystemEngine instance.

example
const wpPublication = WpPublication.createFromBlob(lpfFile);
const engine = new ReadingSystemEngine({licenseApiKey: 'my-api-key'});
engine.addFormatAdapter(new WpAudiobookFormatAdapter());
const readerPublication = await engine.loadPublication(wpPublication);

Hierarchy

Implemented by

Index

Methods

  • destroy(): void
  • Destroy this instance, allowing used resources to be garbage collected.

    Returns void

  • Get the IResourceProvider instance that can be used to fetch resources from this publication.

    Returns IResourceProvider

  • getCoverImageResourceUrl(): URL
  • Get the URL to the cover image resource declared in this publication, if any.

    To fetch the resource data for this URL, use the IResourceProvider returned by getBackingResourceProvider().

    Returns URL

  • getHashSignature(): string
  • Get a generated hash signature of the publication, intended to uniquely identify this publication. The hash signature is not the same as the publication id as the hash signature always changes when the publication data changes in any way. The uniqueness of the signature depends on how the publication was loaded. Please refer the implementation responsible for loading this instance. For example, for EPUB see OcfResourceProvider.

    Returns string

  • Get the Web Publication Manifest for this publication.

    Returns IWpManifest

  • getNavigationResourceUrl(): URL
  • Get the URL to the resource containing the navigation structure for this publication, if any.

    Returns URL

  • getProfiles(): string[]
  • Get the profile of this publication.

    Profiles are publication formats (e.g., audiobooks) describing what type of contents to expect in the publication and in the manifest data.

    Returns string[]

  • Get the type of publication this instance represents.

    This allows you to cast an IPublication instance to a more specific subtype. See PublicationType for how values map to specific IPublication types.

    Returns PublicationType

  • isDestroyed(): boolean

Generated using TypeDoc