Class ThumbnailDataTrack

    • Field Detail

      • TYPE_UNKNOWN

        public static final int TYPE_UNKNOWN
        Type that indicates that the actual thumbnail type is unknown and should be inferred from the URL extension.
        See Also:
        Constant Field Values
      • TYPE_JPEG_TEMPLATE

        public static final int TYPE_JPEG_TEMPLATE
        Type that indicates that a template URL is used where $index$ will be replaced with the thumbnail index starting at 1.

        If this type is used, make sure that you also specify gridWidth and gridHeight in case gridded thumbnails are used.

        See Also:
        Constant Field Values
      • TYPE_WEBVTT_INDEX

        public static final int TYPE_WEBVTT_INDEX
        Type that indicates the a URL to a WebVTT file is used where the WebVTT is the index over the thumbnails.
        See Also:
        Constant Field Values
      • TYPE_BIF

        public static final int TYPE_BIF
        Type that indicates that the URL to a BIF file is used where the BIF file contains the Index and the thumbnails.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ThumbnailDataTrack

        public ThumbnailDataTrack()
      • ThumbnailDataTrack

        public ThumbnailDataTrack​(com.google.android.exoplayer2.Format format)
    • Method Detail

      • getPeriodStartMs

        public long getPeriodStartMs()
        Returns:
        period relative start time in milliseconds
      • setPeriodStartMs

        public void setPeriodStartMs​(long periodStartMs)
        Set the period relative start time
        Parameters:
        periodStartMs - the period relative start time in milliseconds
      • getThumbnailWidth

        public int getThumbnailWidth()
        Returns:
        the thumbnails width in pixels
      • setThumbnailWidth

        public void setThumbnailWidth​(int width)
        Set the thumbnails width
        Parameters:
        width - the thumbnails width in pixels
      • getThumbnailHeight

        public int getThumbnailHeight()
        Returns:
        the thumbnails height in pixels
      • setThumbnailHeight

        public void setThumbnailHeight​(int height)
        Set the thumbnails height
        Parameters:
        height - the thumbnails height in pixels
      • getGridWidth

        public int getGridWidth()
        The grid with (if a thumbnail grid is used)
      • setGridWidth

        public void setGridWidth​(int gridWidth)
        Set the grid width
        Parameters:
        gridWidth - grid width (columns)
      • getGridHeight

        public int getGridHeight()
        The grid height (if a thumbnail grid is used)
      • setGridHeight

        public void setGridHeight​(int gridHeight)
        Set the grid height
        Parameters:
        gridHeight - grid height (rows)
      • getStartSegmentNumber

        public long getStartSegmentNumber()
        Returns:
        the start segment number
      • setStartSegmentNumber

        public void setStartSegmentNumber​(long startSegmentNumber)
        Set the start segment number.
        Parameters:
        startSegmentNumber - the start segment number
      • getTemplateDuration

        public long getTemplateDuration()
        Returns:
        the template duration in seconds
      • setTemplateDuration

        public void setTemplateDuration​(long templateDuration)
        Sets the template duration.
        Parameters:
        templateDuration - the template duration in seconds
      • getBitrate

        public int getBitrate()
        Returns:
        the track bitrate
      • setBitrate

        public void setBitrate​(int bitrate)
        Sets the bitrate
        Parameters:
        bitrate - the bitrate of the track
      • setRepresentation

        public void setRepresentation​(com.google.android.exoplayer2.source.dash.manifest.Representation.MultiSegmentRepresentation representation)
        Sets the representation. This is used to get the download urls of the thumbnails for DASH manifests.
        Parameters:
        representation - the representation where to get the url info from
      • getSegmentUrl

        public Uri getSegmentUrl​(int segment)
        Builds the Uri to locate the corresponding file according to the segment and the previously set Representation.MultiSegmentRepresentation.
        Parameters:
        segment - the desired segment index
        Returns:
        the Uri that points to the corresponding segment index
      • getMinSegment

        public long getMinSegment()
      • getMaxSegment

        public long getMaxSegment()
      • getPeriodDurationMs

        public long getPeriodDurationMs()
        Returns:
        the period duration in milliseconds
      • setPeriodDurationMs

        public void setPeriodDurationMs​(long periodDurationMs)
        Sets the period duration
        Parameters:
        periodDurationMs - the period duration in milliseconds
      • isSideloaded

        public boolean isSideloaded()
        Returns:
        whether this track has been side loaded or not.
      • setSideloaded

        public void setSideloaded​(boolean sideloaded)
        Set whether this track has been side loaded or not.
        Parameters:
        sideloaded - whether this track has been side loaded or not
      • getUrl

        public String getUrl()
        Returns:
        the URL or URL template to the thumbnail data
      • setUrl

        public void setUrl​(String url)
        Set the URL or URL template to the thumbnail data
        Parameters:
        url - the URL or URL template to the thumbnail data
      • getTimeMs

        public long getTimeMs()
        Returns:
        time per thumbnail in milliseconds
      • setTimeMs

        public void setTimeMs​(long timeMs)
        Set the time per thumbnail in milliseconds.
        Parameters:
        timeMs - time per thumbnail in milliseconds
      • getMaxIndex

        public int getMaxIndex()
        Returns:
        the maximal available index (needed for the downloader integration)
      • setMaxIndex

        public void setMaxIndex​(int maxIndex)
        Set the maximal available index
        Parameters:
        maxIndex - the maximal available index
      • getType

        public int getType()
        Returns:
        the type of thumbnails
      • setType

        public void setType​(int type)
        Set the type of thumbnails.
        Parameters:
        type - the type of thumbnails
      • isEnableCache

        public boolean isEnableCache()
        If true, caching thumbnails will be enabled if the default loader implementation is used.
        Returns:
        cache state
      • setEnableCache

        public void setEnableCache​(boolean enableCache)
        Activates or deactivates caching
        Parameters:
        enableCache - desired cache state
      • isPreserveCache

        public boolean isPreserveCache()
        If true, caching is enabled, and the default loader implementation is used, the cache will be preserved and cached files will not be removed after a playback session.
        Returns:
        the preserve cache state
      • setPreserveCache

        public void setPreserveCache​(boolean preserveCache)
        Activates or deactivates cache preservation
        Parameters:
        preserveCache - desired cache preservation state
      • getAbsoluteUrl

        public String getAbsoluteUrl​(String manifest)
        Returns the absolute URL of the thumbnail source.
        Parameters:
        manifest - The streaming manifest URL. This is used if the thumbnail is relative or does not contain a host name or a scheme. In that case the Manifest base url is used as the reference.
        Returns:
        The absolute URL or URL template to the thumbnail data.
      • isRelativeUrl

        public boolean isRelativeUrl()
        Returns:
        True if the source URL for the thumbnail data is specified relative to the manifest