Package org.zkoss.zul

Class Track

All Implemented Interfaces:
Serializable, Cloneable, Component, Scope, ComponentCtrl

public class Track extends XulElement
A representation of <track>.

It is expected to use with <audio> or <video>.

<track> is not supported in Internet Explorer 9.

Since:
9.5.0
Author:
rudyhuang
See Also:
  • Constructor Details

    • Track

      public Track()
    • Track

      public Track(String src)
      Constructs a Track component with the specific source.
      Parameters:
      src - the source address of this track.
  • Method Details

    • isDefault

      public boolean isDefault()
      Returns if this track should be enabled by default.

      Default: false.

      Returns:
      if this track should be enabled by default.
    • setDefault

      public void setDefault(boolean isDefault)
      Sets if this track should be enabled by default.
      Parameters:
      isDefault - if this track should be enabled by default.
    • getKind

      public String getKind()
      Returns what kind of track it is.

      Default: null.

      Returns:
      what kind of track it is.
    • setKind

      public void setKind(String kind)
      Set what kind of track it is. The following keywords are accepted:
      • subtitles
      • captions
      • descriptions
      • chapters
      • metadata
      Parameters:
      kind - what kind of track it is.
    • getLabel

      public String getLabel()
      Returns a readable description of this track.

      Default: null.

      Returns:
      a readable description of this track.
    • setLabel

      public void setLabel(String label)
      Sets a readable description of this track.
      Parameters:
      label - a readable description of this track.
    • getSrc

      public String getSrc()
      Returns the source address of this track.

      Default: null.

      Returns:
      the source address of this track.
    • setSrc

      public void setSrc(String src)
      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.
    • getSrclang

      public String getSrclang()
      Returns the language of the source.

      Default: null.

      Returns:
      the language of the source.
    • setSrclang

      public void setSrclang(String srclang)
      Sets the language of the source. It must be a valid BCP 47 language tag. This attribute must be specified if kind is "subtitles".
      Parameters:
      srclang - the language of the source.
    • getZclass

      public String getZclass()
      Description copied from class: HtmlBasedComponent
      Returns the ZK Cascading Style class for this component. It usually depends on the implementation of the mold (AbstractComponent.getMold()).

      Default: null (the default value depends on element).

      HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style of a component. In other words, the default style of a component is associated with the default value of HtmlBasedComponent.getZclass(). Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String) instead.

      Overrides:
      getZclass in class HtmlBasedComponent
      See Also:
    • isChildable

      protected boolean isChildable()
      Description copied from class: AbstractComponent
      Returns whether this component can have a child.

      Default: return true (means it can have children).

      Overrides:
      isChildable in class AbstractComponent
    • beforeParentChanged

      public void beforeParentChanged(Component parent)
      Description copied from class: AbstractComponent
      Default: If parent is null, execute the @Destroy method if any.
      Specified by:
      beforeParentChanged in interface ComponentCtrl
      Overrides:
      beforeParentChanged in class AbstractComponent
      Parameters:
      parent - the new parent. If null, it means detachment.
      See Also:
    • renderProperties

      protected void renderProperties(ContentRenderer renderer) throws IOException
      Description copied from class: HtmlBasedComponent
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
      renderProperties in class XulElement
      Throws:
      IOException