Package org.zkoss.stateless.sul

## Interface ITrack

- All Superinterfaces:
    `IComponent<ITrack>`, `IHtmlBasedComponent<ITrack>`, `IXulElement<ITrack>`

      public interface ITrack
      extends IXulElement<ITrack>

  Immutable `Track` component

  It lets you specify some timed text tracks like captions or subtitles for media components such as `IAudio` or Video ([EE]).

  Author:
    jumperchen
  See Also:
    `Track`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `ITrack.Builder` | Builds instances of type `ITrack`.
    `static class` | `ITrack.Kind` | Specifies the kind with `withKind(Kind)`
    `static class` | `ITrack.Updater` | Builds an updater of type `ITrack` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static ITrack` | `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
    --- | --- | ---
    `java.lang.String` | `getKind()` | Returns what kind of track it is.
    `java.lang.String` | `getLabel()` | Returns a readable description of this track.
    `java.lang.String` | `getSrc()` | Returns the source address of this track.
    `java.lang.String` | `getSrclang()` | Returns the language of the source.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isAsDefault()` | Returns if this track should be enabled by default.
    `static ITrack` | `of​(java.lang.String label)` | Returns the instance with the given label.
    `static ITrack` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static ITrack` | `ofKind​(ITrack.Kind kind)` | Returns the instance with the given kind.
    `static ITrack` | `ofSrc​(java.lang.String src)` | Returns the instance with the given src.
    `ITrack` | `withAsDefault​(boolean asDefault)` | Returns a copy of `this` immutable component with the specified `asDefault`.
    `ITrack` | `withKind​(java.lang.String kind)` | Returns a copy of `this` immutable component with the specified `kind`.
    `default ITrack` | `withKind​(ITrack.Kind kind)` | Returns a copy of `this` immutable component with the specified `kind`.
    `ITrack` | `withLabel​(java.lang.String label)` | Returns a copy of `this` immutable component with the specified `label`.
    `ITrack` | `withSrc​(java.lang.String src)` | Returns a copy of `this` immutable component with the specified `srclang`.
    `ITrack` | `withSrclang​(java.lang.String srclang)` | Returns a copy of `this` immutable component with the specified `srclang`.

    - ### 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 ITrack 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.Track"`

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

    - #### isAsDefault

          default boolean isAsDefault()

      Returns if this track should be enabled by default.

      Default: `false`.

    - #### withAsDefault

          ITrack withAsDefault​(boolean asDefault)

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

      Sets if this track should be enabled by default.

      Parameters:
        `asDefault` - Whether this track should be enabled by default.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getKind

          @Nullable
          java.lang.String getKind()

      Returns what kind of track it is.

      Default: `null`.

    - #### withKind

          ITrack withKind​(@Nullable
                          java.lang.String kind)

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

      Sets what kind of track it is. The following keywords are accepted:

      - subtitles
      - captions
      - descriptions
      - chapters
      - metadata
      Parameters:
        `kind` - What kind of track it is.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### withKind

          default ITrack withKind​(@Nullable
                                  ITrack.Kind kind)

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

      Sets what kind of track it is. The following keywords are accepted:

      - subtitles
      - captions
      - descriptions
      - chapters
      - metadata
      Parameters:
        `kind` - What kind of track it is.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getLabel

          @Nullable
          java.lang.String getLabel()

      Returns a readable description of this track.

      Default: `null`.

    - #### withLabel

          ITrack withLabel​(@Nullable
                           java.lang.String label)

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

      Sets a readable description of this track.

      Parameters:
        `label` - A readable description of this track.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getSrc

          @Nullable
          java.lang.String getSrc()

      Returns the source address of this track.

      Default: `null`.

    - #### withSrc

          ITrack withSrc​(@Nullable
                         java.lang.String src)

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

      Sets the source address of this track. Must be a valid URL. This attribute must be specified. The URL must have the same origin as the parent `<audio>` or `<video>`, unless the `crossorigin` attribute is set.

      Parameters:
        `src` - The source address of this track.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getSrclang

          @Nullable
          java.lang.String getSrclang()

      Returns the language of the source.

      Default: `null`.

      Returns:
        the language of the source.

    - #### withSrclang

          ITrack withSrclang​(@Nullable
                             java.lang.String srclang)

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

      Sets the language of the source.

      Parameters:
        `srclang` - The language of the source.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### of

          static ITrack of​(java.lang.String label)

      Returns the instance with the given label.
      Parameters:
        `label` - The label of the component.

    - #### ofSrc

          static ITrack ofSrc​(java.lang.String src)

      Returns the instance with the given src.
      Parameters:
        `src` - The src of the component.

    - #### ofKind

          static ITrack ofKind​(ITrack.Kind kind)

      Returns the instance with the given kind.
      Parameters:
        `kind` - What kind of track it is.

    - #### ofId

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

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