Class DownloadHelper

    • Method Detail

      • getDefaultTrackSelectorParameters

        public static DefaultTrackSelector.Parameters getDefaultTrackSelectorParameters​(Context context)
        Deprecated.
        Returns the default parameters used for track selection for downloading.
      • getRendererCapabilities

        public static RendererCapabilities[] getRendererCapabilities​(RenderersFactory renderersFactory)
        Deprecated.
        Extracts renderer capabilities for the renderers created by the provided renderers factory.
        Parameters:
        renderersFactory - A RenderersFactory.
        Returns:
        The RendererCapabilities for each renderer created by the renderersFactory.
      • prepare

        public void prepare​(DownloadHelper.Callback callback)
        Deprecated.
        Initializes the helper for starting a download.
        Parameters:
        callback - A callback to be notified when preparation completes or fails.
        Throws:
        IllegalStateException - If the download helper has already been prepared.
      • release

        public void release()
        Deprecated.
        Releases the helper and all resources it is holding.
      • getManifest

        @Nullable
        public Object getManifest()
        Deprecated.
        Returns the manifest, or null if no manifest is loaded. Must not be called until after preparation completes.
      • getPeriodCount

        public int getPeriodCount()
        Deprecated.
        Returns the number of periods for which media is available. Must not be called until after preparation completes.
      • getTracks

        public Tracks getTracks​(int periodIndex)
        Deprecated.
        Returns Tracks for the given period. Must not be called until after preparation completes.
        Parameters:
        periodIndex - The period index.
        Returns:
        The Tracks for the period. May be Tracks.EMPTY for single stream content.
      • getTrackGroups

        public TrackGroupArray getTrackGroups​(int periodIndex)
        Deprecated.
        Returns the track groups for the given period. Must not be called until after preparation completes.

        Use getMappedTrackInfo(int) to get the track groups mapped to renderers.

        Parameters:
        periodIndex - The period index.
        Returns:
        The track groups for the period. May be TrackGroupArray.EMPTY for single stream content.
      • getTrackSelections

        public List<ExoTrackSelection> getTrackSelections​(int periodIndex,
                                                          int rendererIndex)
        Deprecated.
        Returns all track selections for a period and renderer. Must not be called until after preparation completes.
        Parameters:
        periodIndex - The period index.
        rendererIndex - The renderer index.
        Returns:
        A list of selected track selections.
      • clearTrackSelections

        public void clearTrackSelections​(int periodIndex)
        Deprecated.
        Clears the selection of tracks for a period. Must not be called until after preparation completes.
        Parameters:
        periodIndex - The period index for which track selections are cleared.
      • replaceTrackSelections

        public void replaceTrackSelections​(int periodIndex,
                                           TrackSelectionParameters trackSelectionParameters)
        Deprecated.
        Replaces a selection of tracks to be downloaded. Must not be called until after preparation completes.
        Parameters:
        periodIndex - The period index for which the track selection is replaced.
        trackSelectionParameters - The TrackSelectionParameters to obtain the new selection of tracks.
      • addTrackSelection

        public void addTrackSelection​(int periodIndex,
                                      TrackSelectionParameters trackSelectionParameters)
        Deprecated.
        Adds a selection of tracks to be downloaded. Must not be called until after preparation completes.
        Parameters:
        periodIndex - The period index this track selection is added for.
        trackSelectionParameters - The TrackSelectionParameters to obtain the new selection of tracks.
      • addAudioLanguagesToSelection

        public void addAudioLanguagesToSelection​(String... languages)
        Deprecated.
        Convenience method to add selections of tracks for all specified audio languages. If an audio track in one of the specified languages is not available, the default fallback audio track is used instead. Must not be called until after preparation completes.
        Parameters:
        languages - A list of audio languages for which tracks should be added to the download selection, as IETF BCP 47 conformant tags.
      • addTextLanguagesToSelection

        public void addTextLanguagesToSelection​(boolean selectUndeterminedTextLanguage,
                                                String... languages)
        Deprecated.
        Convenience method to add selections of tracks for all specified text languages. Must not be called until after preparation completes.
        Parameters:
        selectUndeterminedTextLanguage - Whether a text track with undetermined language should be selected for downloading if no track with one of the specified languages is available.
        languages - A list of text languages for which tracks should be added to the download selection, as IETF BCP 47 conformant tags.
      • addTrackSelectionForSingleRenderer

        public void addTrackSelectionForSingleRenderer​(int periodIndex,
                                                       int rendererIndex,
                                                       DefaultTrackSelector.Parameters trackSelectorParameters,
                                                       List<DefaultTrackSelector.SelectionOverride> overrides)
        Deprecated.
        Convenience method to add a selection of tracks to be downloaded for a single renderer. Must not be called until after preparation completes.
        Parameters:
        periodIndex - The period index the track selection is added for.
        rendererIndex - The renderer index the track selection is added for.
        trackSelectorParameters - The DefaultTrackSelector.Parameters to obtain the new selection of tracks.
        overrides - A list of SelectionOverrides to apply to the trackSelectorParameters. If empty, trackSelectorParameters are used as they are.
      • getDownloadRequest

        public DownloadRequest getDownloadRequest​(String id,
                                                  @Nullable
                                                  byte[] data)
        Deprecated.
        Builds a DownloadRequest for downloading the selected tracks. Must not be called until after preparation completes.
        Parameters:
        id - The unique content id.
        data - Application provided data to store in DownloadRequest.data.
        Returns:
        The built DownloadRequest.