Package org.zkoss.stateless.sul

## Interface IAudio

- All Superinterfaces:
    `IAnyGroup<IAudio>`, `IChildable<IAudio,​ITrack>`, `IComponent<IAudio>`, `IHtmlBasedComponent<IAudio>`, `IXulElement<IAudio>`

      public interface IAudio
      extends IXulElement<IAudio>, IAnyGroup<IAudio>, IChildable<IAudio,​ITrack>

  Immutable `Audio` component

  An audio clip.

  ### Support @Action

  Name | Action Type
  --- | ---
  onStateChange | ActionData: `StateChangeData` Notifies when invoking play(), stop(), pause() or the audio is played to the end.

  Author:
    katherine
  See Also:
    `Audio`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IAudio.Builder` | Builds instances of type `IAudio`.
    `static class` | `IAudio.Updater` | Builds an updater of type `IAudio` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IAudio` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Audio` | `getContent()` | Returns the content set by `withContent(org.zkoss.sound.Audio)`.
    `java.lang.String` | `getPreload()` | Returns whether and how the audio should be loaded.
    `java.util.List<java.lang.String>` | `getSrc()` | Returns the src.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isAutoplay()` | Returns whether to auto start playing the audio.
    `default boolean` | `isControls()` | Returns whether to display the audio controls.
    `default boolean` | `isLoop()` | Returns whether to play the audio repeatedly.
    `default boolean` | `isMuted()` | Returns whether to mute the audio.
    `static IAudio` | `of​(java.lang.Iterable<ITrack> children)` | Returns the instance with the given `ITrack` children.
    `static IAudio` | `of​(java.lang.String src)` | Returns the instance with the given `src`.
    `static IAudio` | `of​(ITrack... children)` | Returns the instance with the given `ITrack` children.
    `static IAudio` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `IAudio` | `withAutoplay​(boolean autoplay)` | Returns a copy of `this` immutable component with the specified `autoplay`.
    `IAudio` | `withContent​(Audio audio)` | Returns a copy of `this` immutable component with the specified `audio`.
    `IAudio` | `withControls​(boolean controls)` | Returns a copy of `this` immutable component with the specified `controls`.
    `IAudio` | `withLoop​(boolean loop)` | Returns a copy of `this` immutable component with the specified `loop`.
    `IAudio` | `withMuted​(boolean muted)` | Returns a copy of `this` immutable component with the specified `muted`.
    `IAudio` | `withPreload​(java.lang.String preload)` | Returns a copy of `this` immutable component with the specified `preload`.
    `IAudio` | `withSrc​(java.lang.Iterable<java.lang.String> src)` | Returns a copy of `this` immutable component with the specified `placeholder`.
    `default IAudio` | `withSrc​(java.lang.String src)` | Returns a copy of `this` immutable component with the specified `placeholder`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IChildable

      `getChildren, withChildren, withChildren`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IXulElement

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IAudio DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.med.Audio"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IAudio>`

    - #### getSrc

          java.util.List<java.lang.String> getSrc()

      Returns the src.

      Default: [].

    - #### withSrc

          IAudio withSrc​(java.lang.Iterable<java.lang.String> src)

      Returns a copy of `this` immutable component with the specified `placeholder`.

      Sets the src of the audio. Note: If calling this with `withContent(org.zkoss.sound.Audio)`, the `withContent(org.zkoss.sound.Audio)` has higher priority

      Parameters:
        `src` - The src of the component

        Default: `[]`.

      Returns:
        A modified copy of the `this` object

    - #### withSrc

          default IAudio withSrc​(java.lang.String src)

      Returns a copy of `this` immutable component with the specified `placeholder`.

      Sets the src of the audio.

      Note: If calling this with `withContent(org.zkoss.sound.Audio)`, the `withContent(org.zkoss.sound.Audio)` has higher priority

      Parameters:
        `src` - The src of the component

        Default: `[]`.

      Returns:
        A modified copy of the `this` object

    - #### getPreload

          @Nullable
          java.lang.String getPreload()

      Returns whether and how the audio should be loaded. "none", "metadata", "auto" or null

      Default: `null`.

    - #### withPreload

          IAudio withPreload​(@Nullable
                             java.lang.String preload)

      Returns a copy of `this` immutable component with the specified `preload`.

      Sets whether and how the audio should be loaded. Refer to Preload Attribute Description for details.

      Parameters:
        `preload` - Whether and how the audio should be loaded. ("none", "metadata", "auto" or null)

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getContent

          @Nullable
          Audio getContent()

      Returns the content set by `withContent(org.zkoss.sound.Audio)`.

      Note: it won't fetch what is set thru by `withSrc(java.lang.Iterable<java.lang.String>)`. It simply returns what is passed to `withContent(org.zkoss.sound.Audio)`.

      Default: `null`

    - #### withContent

          IAudio withContent​(@Nullable
                             Audio audio)

      Returns a copy of `this` immutable component with the specified `audio`.

      Sets the content of the audio

      Note: If calling this with `withSrc(java.lang.Iterable<java.lang.String>)`, the `withContent(org.zkoss.sound.Audio)` has higher priority

      Parameters:
        `audio` - The content of the audio.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### isAutoplay

          default boolean isAutoplay()

      Returns whether to auto start playing the audio.

      Default: `false`.

    - #### withAutoplay

          IAudio withAutoplay​(boolean autoplay)

      Returns a copy of `this` immutable component with the specified `autoplay`.

      Sets whether to auto start playing the audio.

      Parameters:
        `autoplay` - Whether to auto start playing the audio.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isControls

          default boolean isControls()

      Returns whether to display the audio controls.

      Default: `false`.

    - #### withControls

          IAudio withControls​(boolean controls)

      Returns a copy of `this` immutable component with the specified `controls`.

      Sets whether to display the audio controls.

      Parameters:
        `controls` - Whether to display the audio controls.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isLoop

          default boolean isLoop()

      Returns whether to play the audio repeatedly.

      Default: `false`.

    - #### withLoop

          IAudio withLoop​(boolean loop)

      Returns a copy of `this` immutable component with the specified `loop`.

      Sets whether to play the audio repeatedly.

      Parameters:
        `loop` - Whether to play the audio repeatedly.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isMuted

          default boolean isMuted()

      Returns whether to mute the audio.

      Default: `false`.

    - #### withMuted

          IAudio withMuted​(boolean muted)

      Returns a copy of `this` immutable component with the specified `muted`.

      Sets whether to mute the audio.

      Parameters:
        `muted` - Whether to mute the audio.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### of

          static IAudio of​(java.lang.String src)

      Returns the instance with the given `src`.
      Parameters:
        `src` - The URI of the audio source.

    - #### of

          static IAudio of​(java.lang.Iterable<ITrack> children)

      Returns the instance with the given `ITrack` children.
      Parameters:
        `children` - The children of `ITrack`

    - #### of

          static IAudio of​(ITrack... children)

      Returns the instance with the given `ITrack` children.
      Parameters:
        `children` - The children of `ITrack`

    - #### ofId

          static IAudio ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component