Callback hooks for triggering actions such as auth and getting info

Hierarchy

  • IHooks

Methods

  • Url to the video page and specific playback time of currentTime. If provided will be used by annoto for email notifications, in the dashboard, etc.

    Parameters

    • params: {
          currentTime: number;
          mediaSrc: string;
          widgetIndex: number;
      }
      • currentTime: number
      • mediaSrc: string
      • widgetIndex: number

    Returns string

  • Url to the video page. Useful if Annoto is embedded inside iframe for example. default: window.location.href is used.

    Returns string

  • For SSO enabled integrations only. If Provided, Will be called when user triggers Logout action and "Logout" option will appear in the drawer menu.

    Returns void | Promise<void>

    If possible the promise should reslove/reject when the logout flow is finished.

  • Callback that allows to enrich details about the played media. If provided the function is called by the widget to obtain additional details about the media.

    Parameters

    • params: {
          details?: IMediaDetails;
          mediaSrc: string;
          widgetIndex: number;
      }
      • Optional details?: IMediaDetails
      • mediaSrc: string
      • widgetIndex: number

    Returns IMediaDetails | Promise<IMediaDetails>

    additional details about the played media, such as title

  • Callback that allows to modify the configuration This callback is called when media is ready and it's preferences is loaded from the backend

    Parameters

    • params: {
          config: IConfig<IFeatures>;
          mediaSrc: string;
          widgetIndex: number;
      }

    Returns Promise<IConfig<IFeatures>>

    configuration to override the exiting config (will be deep merged by Annoto)

    Remarks

    This is the prefered way of modifying the configuration. The best practice is to keep the widget bootstrap configuration to a minimum.

  • For SSO enabled integrations only. If Provided, Will be called when user triggers Authentication. If not provided a message in the form is shown.

    Returns void | Promise<void>

    If possible the promise should reslove/reject when the auth flow is finished.