Package org.zkoss.zul

Class Track

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Serialized Form
    • Constructor Detail

      • Track

        public Track()
      • Track

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

      • 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 java.lang.String getKind()
        Returns what kind of track it is.

        Default: null.

        Returns:
        what kind of track it is.
      • setKind

        public void setKind​(java.lang.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 java.lang.String getLabel()
        Returns a readable description of this track.

        Default: null.

        Returns:
        a readable description of this track.
      • setLabel

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

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

        Default: null.

        Returns:
        the source address of this track.
      • setSrc

        public void setSrc​(java.lang.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 java.lang.String getSrclang()
        Returns the language of the source.

        Default: null.

        Returns:
        the language of the source.
      • setSrclang

        public void setSrclang​(java.lang.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.
      • 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