Skip to main content
Version: 8.1

Perspective - Audio Scripting

This page details the various scripting, component, and extension functions available for Perspective's Audio component.

Component Events​

The Perspective Event Types Reference page describes all the possible component event types for Perspective components. Not all component events support each Perspective component. The Component Events and Actions page shows how to configure events and actions on a Perspective component. Component scripting is handled separately and can be accessed from the Component menubar or by right clicking on the component.

onPlay​

This event is fired when playback has begun.

event​

  • Object Path

    • event
  • Type

    • Null
  • Description

    • An empty event object.

onPause​

This event is fired when playback has been paused.

event​

  • Object Path

    • event
  • Type

    • Null
  • Description

    • An empty event object.

onError​

This event is fired when there is an error attempting to play the media file.

caution

This component event is designed to be used in tandem with a script action. Within the script action, special properties and methods are available on the event object, which is passed to the script action as a parameter.

event.errorMessage​

  • Object Path

    • event.errorMessage
  • Type

    • String
  • Description

    • Error message when attempting to play the media file.

onEnded​

This event is fired when playback has ended due to reaching the end of the media.

event​

  • Object Path

    • event
  • Type

    • Null
  • Description

    • An empty event object.

onLoaded​

This event is fired when the first frame of the media has loaded.

event​

  • Object Path

    • event
  • Type

    • Null
  • Description

    • An empty event object.

onRateChanged​

This event is fired when the playback rate of the media has changed.

event​

  • Object Path

    • event
  • Type

    • Null
  • Description

    • An empty event object.

Component Functions​

.play()​

  • Description

    • Plays the media file, triggering the onPlay component event.
  • Parameters

    • None
  • Return

    • Nothing

.pause()​

  • Description

    • Pauses the media file, triggering the onPause component event.
  • Parameters

    • None
  • Return

    • Nothing

.replay()​

  • Description

    • Replays the media file from the beginning.
  • Parameters

    • None
  • Return

    • Nothing

Extension Functions​

This component does not have extension functions associated with it.