H5P NodeJS Library
    Preparing search index...

    A Web Component displaying H5P content.

    Hierarchy

    • HTMLElement
      • H5PPlayerComponent
    Index

    Constructors

    Accessors

    • get asUserId(): string

      Returns string

    • set asUserId(asUserId: string): void

      Parameters

      • asUserId: string

      Returns void

    • get contentId(): string

      Returns string

    • set contentId(contentId: string): void

      Parameters

      • contentId: string

      Returns void

    • get contextId(): string

      Returns string

    • set contextId(contextId: string): void

      Parameters

      • contextId: string

      Returns void

    • get h5pObject(): IH5P

      The global H5P object / namespace (normally accessible through "H5P..." or "window.H5P") of the content type. Depending on the embed type this can be an object from the internal iframe, so you can use it to break the barrier of the iframe and execute JavaScript inside the iframe.

      Only available after the initialized event was fired. Important: This object is only partially typed and there are more properties and methods on it!

      Returns IH5P

    • set h5pObject(value: IH5P): void

      Parameters

      Returns void

    • get h5pWindow(): any

      The window object in which the H5P object exists and is rendered in. This is the iframe's contentWindow or the parent's window, depending on the embed type.

      Returns any

    • set h5pWindow(value: any): void

      Parameters

      • value: any

      Returns void

    • get loadContentCallback(): (
          contentId: string,
          contextId?: string,
          asUserId?: string,
          readOnlyState?: boolean,
      ) => Promise<IPlayerModel>

      Called when the component needs to load data about content. The endpoint called in here should call H5PPlayer.render() and send back the player model.

      Should throw an error with a message in the message property if something goes wrong.

      Returns (
          contentId: string,
          contextId?: string,
          asUserId?: string,
          readOnlyState?: boolean,
      ) => Promise<IPlayerModel>

    • set loadContentCallback(
          callback: (
              contentId: string,
              contextId?: string,
              asUserId?: string,
              readOnlyState?: boolean,
          ) => Promise<IPlayerModel>,
      ): void

      Parameters

      • callback: (
            contentId: string,
            contextId?: string,
            asUserId?: string,
            readOnlyState?: boolean,
        ) => Promise<IPlayerModel>

      Returns void

    • get readOnlyState(): string

      Returns string

    • set readOnlyState(readOnlyState: string): void

      Parameters

      • readOnlyState: string

      Returns void

    • get observedAttributes(): string[]

      Indicates changes to which attributes should trigger calls to attributeChangedCallback.

      Returns string[]

    Methods

    • Called when one of the attributes in observedAttributes changes.

      Parameters

      • name: string
      • oldVal: any
      • newVal: any

      Returns Promise<void>

    • Called when the component is added to the DOM.

      Returns void

    • Called when the component is removed from the DOM.

      Returns void

    • Returns the copyright notice in HTML that you can insert somewhere to display it. Undefined if there is no copyright information.

      Returns string

    • Returns boolean

      true if there is copyright information to be displayed.

    • Asks the H5P content to resize itself inside the dimensions of the container.

      Has no effect until the H5P object has fully initialized.

      Returns void

    • Displays the copyright notice in the regular H5P way.

      Returns void