Class PlayerExternalAPI

External player API.

Hierarchy

  • PlayerExternalAPI

Actions

  • Ask video to jump on the given frame time.

    Events to listen: onSeekStarted and onSeeked

    External action event 'voomly:video:seek'

    Parameters

    • payload: number | {
          time: number;
      }

    Returns void

  • Ask video to play.

    Must be executed only with manual action (for ex. button click). To be able to start the video right after it's ready, use "autoplay" function in player editor.

    Events to listen: onPlay

    External action event 'voomly:video:play'

    Parameters

    • payload: number | void | {
          time: number;
      }

    Returns void

pause: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to pause.

      Events to listen: onPause

      External action event 'voomly:video:pause'

      Parameters

      • payload: void

      Returns void

changeVolume: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to change volume.

      Events to listen: onVolumeChange

      External action event 'voomly:video:changeVolume'

      Parameters

      • payload: {
            volume: number;
        }
        • volume: number

      Returns void

mute: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to mute.

      Events to listen: onVolumeChange

      External action event 'voomly:video:mute'

      Parameters

      • payload: void

      Returns void

unmute: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to unmute.

      Events to listen: onVolumeChange

      External action event 'voomly:video:unmute'

      Parameters

      • payload: void

      Returns void

changeQuality: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to change video quality

      Events to listen: onQualityChange

      External action event 'voomly:video:changeQuality'

      Parameters

      • payload: {
            quality: number;
            hlsUrl: string;
        }
        • quality: number
        • hlsUrl: string

      Returns void

changeSpeed: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to change video playback rate

      Events to listen: onSpeedChange

      External action event 'voomly:video:changeSpeed'

      Parameters

      • payload: {
            speed: number;
        }
        • speed: number

      Returns void

getQualityOptions: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to send back quality options.

      Events to listen: onGetQualityOptions

      External action event 'voomly:video:qualityOptions'

      Parameters

      • payload: void

      Returns void

getSpeedOptions: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask video to send back playback rate options.

      Events to listen: onGetSpeedOptions

      External action event 'voomly:video:speedOptions'

      Parameters

      • payload: void

      Returns void

enableCustomTurnstileIntegration: ((payload) => void) = ...

Type declaration

    • (payload): void
    • Ask to enable custom turnstile integration (don't send events to any consumer defined in player editor).

      Events to listen: onTimelineTurnstileSkipped and onTimelineTurnstileCompleted

      External action event 'voomly:timeline:turnstile:enable'

      Parameters

      • payload: void

      Returns void

Common

  • Check if API is initialized (ready to use) and not destroyed

    Returns boolean

  • Check if API is destroyed and not connected to node

    Returns boolean

  • Destroy API instance and unsubscribe all events

    Returns void

  • Subscribe to event when API is ready to use. Should be used when getting API instance directly (not using Proxy object)

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

Subscriptions

onPlay: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:playStarted'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: void

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onPause: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:paused'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: void

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onSeekStarted: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:seekStarted'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  time: number;
              }
              • time: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onSeeked: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:seeked'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  time: number;
              }
              • time: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onTimeUpdate: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:timeUpdate'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  time: number;
              }
              • time: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onQualityChange: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:qualityChanged'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  quality: number;
              }
              • quality: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onVolumeChange: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:volumeChanged'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  volume: number;
                  muted: boolean;
              }
              • volume: number
              • muted: boolean

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onSpeedChange: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:speedChanged'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  speed: number;
              }
              • speed: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onReady: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:ready'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: void

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onEnd: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:ended'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: void

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onGetQualityOptions: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:qualityOptions'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  options: {
                      value: number;
                      label: string;
                      hlsUrl: string;
                  }[];
                  current: number;
              }
              • options: {
                    value: number;
                    label: string;
                    hlsUrl: string;
                }[]
              • current: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onGetSpeedOptions: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:speedOptions'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  options: number[];
                  current: number;
              }
              • options: number[]
              • current: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onUpdateDimensions: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:video:updateDimensions'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  width: number;
                  height: number;
              }
              • width: number
              • height: number

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onTimelineUnlock: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:unlock'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  password: string;
              }
              • password: string

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onTimelineTurnstileSkipped: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:turnstile:skipped'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: void

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onTimelineTurnstileCompleted: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:turnstile:completed'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: {
                  firstName: string;
                  lastName: string;
                  email: string;
              } | {
                  email: string;
              }

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onTimelineButtonClick: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:button:click'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineButtonEnter: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:button:enter'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineButtonPreExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:button:preExit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineButtonExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:button:exit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineImageClick: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:image:click'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineImageEnter: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:image:enter'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineImagePreExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:image:preExit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineImageExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:image:exit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineGridClick: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:grid:click'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineGridEnter: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:grid:enter'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineGridPreExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:grid:preExit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineGridExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:grid:exit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineSurveyClick: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:survey:click'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineSurveyEnter: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:survey:enter'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineSurveyPreExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:survey:preExit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineSurveyExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:survey:exit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineQuizChoice: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External quiz event 'voomly:timeline:quiz:choice'

      Parameters

      • callback: ((payload) => void)
          • (payload): void
          • Parameters

            • payload: ITimelineQuizChoiceSelectDescriptor

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

onTimelineQuizEnter: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:quiz:enter'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineQuizExit: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • External subscription event 'voomly:timeline:quiz:exit'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineAnnotationClick: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • Subscribe to annotation click

      External subscription event 'voomly:timeline:annotation:click'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

onTimelineImageAnnotationClick: ((callback) => (() => void)) = ...

Type declaration

    • (callback): (() => void)
    • Subscribe to image annotation click

      External subscription event 'voomly:timeline:imageAnnotation:click'

      Parameters

      Returns (() => void)

        • (): void
        • Returns void