Interface nsIAudioChannelAgentType

This interface provides an agent for gecko components to participate in the audio channel service. Gecko components are responsible for

  1. Notifying the agent when they start/stop using this channel.
  2. Notifying the agent when they are audible.

The agent will invoke a callback to notify Gecko components of

  1. Changes to the playable status of this channel.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Initialize the agent with a channel type. Note: This function should only be called once.

    Parameters

    • window: mozIDOMWindow

      The window

    • callback: nsIAudioChannelAgentCallback
      1. Once the playable status changes, agent uses this callback function to notify Gecko component.
      2. The callback is allowed to be null. Ex: telephony doesn't need to listen change of the playable status.
      3. The AudioChannelAgent keeps a strong reference to the callback object.

    Returns void

  • This method is just like init(), except the audio channel agent keeps a weak reference to the callback object.

    In order for this to work, |callback| must implement nsISupportsWeakReference.

    Parameters

    • window: mozIDOMWindow
    • callback: nsIAudioChannelAgentCallback

    Returns void

  • Notify agent that we already start producing audible data.

    Note : sometime audio might become silent during playing, this method is used to notify the actually audible state to other services which want to know about that, ex. tab sound indicator.

    Parameters

    • audible: uint8_t
    • reason: uint32_t

    Returns void

  • Notify the agent that we want to start playing. Note: Gecko component SHOULD call this function first then start to play audio stream only when return value is true.

    Parameters

    • audible: uint8_t

    Returns void

  • Notify the agent we no longer want to play.

    Note : even if notifyStartedPlaying() returned false, the agent would still be registered with the audio channel service and receive callbacks for status changes. So notifyStoppedPlaying must still eventually be called to unregister the agent with the channel service.

    Returns void

Generated using TypeDoc