API Documentation for: 0.4.0
Show:

FlashPlugin Class

Defined in: FlashPlugin:3
Module: SoundJS

Static class holding library specific information such as the version and buildDate of the library. The SoundJS class has been renamed Sound. Please see Sound for information on using sound.

Constructor

FlashPlugin

()

Defined in FlashPlugin:3

Methods

create

(
  • src
)
SoundInstance

Defined in create:345

Create a sound instance. If the sound has not been preloaded, it is internally preloaded here.

Parameters:

  • src String

    The sound source to use.

Returns:

SoundInstance: A sound instance for playback and control.

flashLog

(
  • data
)

Defined in flashLog:479

Used to output trace from Flash to the console.

Parameters:

  • data String

    The information to be output.

generateCapabiities

() protected static

Determine the capabilities of the plugin. Used internally. Please see the Sound API getCapabilities method for an overview of plugin capabilities.

getVolume

()

Defined in getVolume:416

Available since 0.4.0

Get the master volume of the plugin, which affects all SoundInstances.

Returns:

The volume level, between 0 and 1.

handleErrorEvent

(
  • error
)

Handles error events from Flash. Note this function currently does not process any events.

Parameters:

  • error String

    Indicates the error.

handleEvent

(
  • method
)

Defined in handleEvent:543

Handles events from Flash intended for the FlashPlugin class. Currently only a "ready" event is processed.

Parameters:

  • method String

    Indicates the method to run.

handleFlashReady

() protected

The Flash application that handles preloading and playback is ready. We wait for a callback from Flash to ensure that everything is in place before playback begins.

handlePreloadEvent

(
  • flashId
  • method
)

Handles events from Flash and routes communication to a SoundLoader via the Flash ID. The method and arguments and arguments from Flash are run directly on the sound loader.

Parameters:

  • flashId String

    Used to identify the loader instance.

  • method String

    Indicates the method to run.

handleSoundEvent

(
  • flashId
  • method
)

Handles events from Flash, and routes communication to a SoundInstance via the Flash ID. The method and arguments from Flash are run directly on the sound instance.

Parameters:

  • flashId String

    Used to identify the SoundInstance.

  • method String

    Indicates the method to run.

handleSWFReady

(
  • event
)
protected

Defined in handleSWFReady:270

The SWF used for sound preloading and playback has been initialized.

Parameters:

  • event Object

    Contains a reference to the swf.

handleTimeout

() protected

Defined in handleTimeout:313

The callback when Flash does not initialize. This usually means the SWF is missing or incorrectly pathed.

init

() protected

Defined in init:241

An initialization function run by the constructor

isPreloadStarted

(
  • src
)
Boolean

Checks if preloading has started for a specific source. If the source is found, we can assume it is loading, or has already finished loading.

Parameters:

  • src String

    The sound URI to check.

Returns:

isSupported

() Boolean static

Defined in isSupported:82

Determine if the plugin can be used in the current browser/OS.

Returns:

Boolean: If the plugin can be initialized.

preload

(
  • src
  • instance
)

Defined in preload:376

Preload a sound instance. This plugin uses Flash to preload and play all sounds.

Parameters:

  • src String

    The path to the Sound

  • instance Object

    Not used in this plugin.

register

(
  • src
  • instances
)
Object

Defined in register:323

Pre-register a sound instance when preloading/setup. Note that the FlashPlugin will return a SoundLoader instance for preloading since Flash can not access the browser cache consistently.

Parameters:

  • src String

    The source of the audio

  • instances Number

    The number of concurrently playing instances to allow for the channel at any time.

Returns:

Object: A result object, containing a tag for preloading purposes.

registerPreloadInstance

(
  • flashId
  • instance
)

Used to couple a Flash loader instance with a SoundLoader instance

Parameters:

  • flashId String

    Used to identify the SoundLoader.

  • instance SoundLoader

    The actual instance.

registerSoundInstance

(
  • flashId
  • instance
)

Used to couple a Flash sound instance with a SoundInstance.

Parameters:

  • flashId String

    Used to identify the SoundInstance.

  • instance SoundLoader

    The actual instance.

setMute

(
  • value
)
Boolean

Defined in setMute:426

Available since 0.4.0

Mute all sounds via the plugin.

Parameters:

  • value Boolean

    If all sound should be muted or not. Note that plugin-level muting just looks up the mute value of Sound Sound/masterMute, so this property is not used here.

Returns:

Boolean: If the mute call succeeds.

setVolume

(
  • value
)
Boolean

Defined in setVolume:391

Available since 0.4.0

Set the master volume of the plugin, which affects all SoundInstances.

Parameters:

  • value Number

    The volume to set, between 0 and 1.

Returns:

Boolean: If the plugin processes the setVolume call (true). The Sound class will affect all the instances manually otherwise.

unregisterPreloadInstance

(
  • flashId
)

Used to decouple a SoundLoader instance from Flash.

Parameters:

  • flashId String

    Used to identify the SoundLoader.

unregisterSoundInstance

(
  • flashId
  • instance
)

Used to decouple a SoundInstance from Flash. instance.

Parameters:

  • flashId String

    Used to identify the SoundInstance.

  • instance SoundLoader

    The actual instance.

updateVolume

() Boolean protected

Defined in updateVolume:404

Available since 0.4.0

Internal function used to set the gain value for master audio. Should not be called externally.

Returns:

Properties

audioSources

Object protected

Defined in audioSources:132

An object hash indexed by ID that indicates if each source is loaded or loading.

BASE_PATH

String static

Defined in BASE_PATH:72

The path relative to the HTML page that the FlashAudioPlugin.swf resides. Note if this is not correct, this plugin will not work.

Default: src/SoundJS

buildDate

String static

Defined in buildDate:20

The build date for this release in UTC format.

capabilities

Object static

Defined in capabilities:62

The capabilities of the plugin. This is generated via the WebAudioPlugin/generateCapabilities method. Please see the Sound getCapabilities method for a list of available capabilities.

capabilities

Object protected

Defined in capabilities:158

An object that defines the capabilities of the plugin. Please see getCapabilities for more information on plugin capabilities.

container

HTMLDivElement protected

Defined in container:168

A reference to the DIV container that gets created to hold the Flash instance.

CONTAINER_ID

String protected

Defined in CONTAINER_ID:149

The id name of the DIV that gets created for Flash content.

Default: flashAudioContainer

flash

Object | Embed protected

Defined in flash:176

A reference to the Flash instance that gets created.

flashInstances

Object protected

Defined in flashInstances:193

A hash of SoundInstances indexed by the related ID in Flash. This lookup is required to connect sounds in JavaScript to their respective instances in Flash.

flashPreloadInstances

Object protected

A hash of Sound Preload instances indexed by the related ID in Flash. This lookup is required to connect a preloading sound in Flash with its respective instance in JavaScript.

flashReady

Boolean

Defined in flashReady:184

Determines if the Flash object has been created and initialized. This is required to make ExternalInterface calls from JavaScript to Flash.

Default: false

preloadInstances

Object protected

Defined in preloadInstances:211

Available since 0.4.0

A hash of Sound Preload instances indexed by the src. This lookup is required to load sounds if internal preloading is tried when flash is not ready.

queuedInstances

Object protected

Defined in queuedInstances:221

An array of Sound Preload instances that are waiting to preload. Once Flash is initialized, the queued instances are preloaded.

showOutput

Boolean

Defined in showOutput:230

A developer flag to output all flash events to the console (if it exists). Used for debugging.

 Sound.activePlugin.showOutput = true;

Default: false

version

String static

Defined in version:12

The version string for this release.

volume

Number protected

Defined in volume:140

The internal volume value of the plugin.

Default: 1