com.aliyun.downloader

## Class AliMediaDownloader

- java.lang.Object
- - com.aliyun.downloader.AliMediaDownloader

-     public abstract class AliMediaDownloader
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `AliMediaDownloader.ConvertURLCallback` Convert a specified URL before downloading the relevant media file.
    `static interface` | `AliMediaDownloader.OnCompletionListener` The download completion callback.
    `static interface` | `AliMediaDownloader.OnErrorListener` Error callback.
    `static interface` | `AliMediaDownloader.OnPreparedListener` The download preparation success callback.
    `static interface` | `AliMediaDownloader.OnProgressListener` The download progress callback.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AliMediaDownloader()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `deleteFile()` Delete a specified file.
    `abstract java.lang.String` | `getFilePath()` Query the path of the downloaded file.
    `abstract void` | `prepare(VidAuth vidAuth)` Download resources through VidAuth.
    `abstract void` | `prepare(VidSts vidSts)` Download resources through VidSts
    `abstract void` | `release()` Release downloading.
    `abstract void` | `selectItem(int index)` Specify a track to download.
    `static void` | `setConvertURLCallback(AliMediaDownloader.ConvertURLCallback callback)` Set a URL conversion callback.
    `abstract void` | `setDownloaderConfig(DownloaderConfig config)`
    `abstract void` | `setOnCompletionListener(AliMediaDownloader.OnCompletionListener l)` Set a download success callback.
    `abstract void` | `setOnErrorListener(AliMediaDownloader.OnErrorListener l)` Set a download failure callback.
    `abstract void` | `setOnPreparedListener(AliMediaDownloader.OnPreparedListener l)` Set a download preparation completion callback.
    `abstract void` | `setOnProgressListener(AliMediaDownloader.OnProgressListener l)` Set a download progress callback.
    `abstract void` | `setSaveDir(java.lang.String absPath)` Specify the directory where the downloaded file is saved.
    `abstract void` | `start()` Start downloading.
    `abstract void` | `stop()` Stop downloading.
    `abstract void` | `updateSource(VidAuth vidAuth)` Update VidAuth information.
    `abstract void` | `updateSource(VidSts vidSts)` Update VidSts information.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AliMediaDownloader

          public AliMediaDownloader()

  - ### Method Detail

    - #### setSaveDir

          public abstract void setSaveDir(java.lang.String absPath)

      Specify the directory where the downloaded file is saved.
      Parameters:
        `absPath` - The absolute directory.

    - #### getFilePath

          public abstract java.lang.String getFilePath()

      Query the path of the downloaded file.
      Returns:
        The path of the downloaded file.

    - #### selectItem

          public abstract void selectItem(int index)

      Specify a track to download.
      Parameters:
        `index` - The index of the track.

    - #### setOnCompletionListener

          public abstract void setOnCompletionListener(AliMediaDownloader.OnCompletionListener l)

      Set a download success callback.
      Parameters:
        `l` - The download success callback.

    - #### setOnErrorListener

          public abstract void setOnErrorListener(AliMediaDownloader.OnErrorListener l)

      Set a download failure callback.
      Parameters:
        `l` - The download failure callback.

    - #### setOnPreparedListener

          public abstract void setOnPreparedListener(AliMediaDownloader.OnPreparedListener l)

      Set a download preparation completion callback.
      Parameters:
        `l` - The download preparation completion callback.

    - #### setOnProgressListener

          public abstract void setOnProgressListener(AliMediaDownloader.OnProgressListener l)

      Set a download progress callback.
      Parameters:
        `l` - The download progress callback.

    - #### prepare

          public abstract void prepare(VidAuth vidAuth)

      Download resources through VidAuth.
      Parameters:
        `vidAuth` - See VidAuth.

    - #### prepare

          public abstract void prepare(VidSts vidSts)

      Download resources through VidSts
      Parameters:
        `vidSts` - See VidSts.

    - #### start

          public abstract void start()

      Start downloading.

    - #### stop

          public abstract void stop()

      Stop downloading.

    - #### release

          public abstract void release()

      Release downloading.

    - #### updateSource

          public abstract void updateSource(VidSts vidSts)

      Update VidSts information.
      Parameters:
        `vidSts` - See VidSts.

    - #### updateSource

          public abstract void updateSource(VidAuth vidAuth)

      Update VidAuth information.
      Parameters:
        `vidAuth` - See VidAuth.

    - #### deleteFile

          public abstract void deleteFile()

      Delete a specified file.

    - #### setDownloaderConfig

          public abstract void setDownloaderConfig(DownloaderConfig config)

    - #### setConvertURLCallback

          public static void setConvertURLCallback(AliMediaDownloader.ConvertURLCallback callback)

      Set a URL conversion callback.
      Parameters:
        `callback` - The URL conversion callback.