com.qihoo.livecloud.plugin

## Class ILiveCloudPluginEx

- java.lang.Object
- - com.qihoo.livecloud.plugin.ILiveCloudPlugin
  - - com.qihoo.livecloud.plugin.ILiveCloudPluginEx

- All Implemented Interfaces:
    LiveCloudPluginConstant
  Direct Known Subclasses:
    QHVCPlayerPlugin, QHVCPlayerPluginBak

      public class ILiveCloudPluginEx
      extends ILiveCloudPlugin

  所有依赖公共库的模块必须从该类继承，该类内部会处理公共库的依赖问题

  Created by LeiXiaojun on 2017/12/12.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.qihoo.livecloud.plugin.ILiveCloudPlugin

      `ILiveCloudPlugin.PluginCallback, ILiveCloudPlugin.PluginDownloadCallback, ILiveCloudPlugin.PluginDownloadListener`

  - ### Field Summary

    - ### Fields inherited from interface com.qihoo.livecloud.plugin.LiveCloudPluginConstant

      `DT_INSTALL, DT_UPDATE, ERROR_CANCEL, ERROR_CONFIG_DOWNLOAD_FAILED, ERROR_CONFIG_PARSE_FAILED, ERROR_DEPENDENT_PLUGIN_LOAD_FAILED, ERROR_DEPENDENT_PLUGIN_NOT_INSTALL, ERROR_INSTALL_RUNNING, ERROR_LOCAL_UPDATE_FAILED, ERROR_LOCAL_UPDATE_OLD_LOADED, ERROR_NO_SPACES, ERROR_NOT_INSTALL, ERROR_PLUGIN_DELETE_FAILED, ERROR_PLUGIN_LOAD_FAILED, ERROR_SUCCESS, ERROR_UNKNOWN, ERROR_ZIP_DOWNLOAD_FAILED, ERROR_ZIP_FILE_DISMATCH, ERROR_ZIP_MD5_DISMATCH, ERROR_ZIP_UNZIP_FAILED, TAG, V_2_0_1, V_2_0_2, V_2_0_9, V_2_1_1, V_2_2_0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ILiveCloudPluginEx(java.lang.String plugin, java.lang.String nowVersion, java.lang.String minVersion, long fileSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `checkInstallPlugin(Context context, ILiveCloudPlugin.PluginDownloadListener listener, ILiveCloudPlugin.PluginCallback callback)` 安装插件（先安装或升级依赖的插件，成功后再安装或升级该插件）
    `boolean` | `isDefaultPluginInstalled()` 检测是否自带插件
    `boolean` | `isPluginInstalled()` 检测插件是否已安装
    `boolean` | `isPluginValid()` 插件是否有效，分两种情况（前提是依赖的插件必须同时有效）： 1.系统自带 2.动态下载且加载成功
    `int` | `loadPlugin()` 加载已安装的插件（先加载依赖的插件，成功后再加载该插件）
    `void` | `setDefaultPluginInstalled(boolean defaultPluginInstalled)` 设置是否自带插件
    `void` | `setDependenciesPluginList(java.util.List<ILiveCloudPlugin> list)`

    - ### Methods inherited from class com.qihoo.livecloud.plugin.ILiveCloudPlugin

      `backgroundInstallOrUpdatePlugin, cancelInstallOrUpdatePlugin, checkInstallOrUpdatePlugin, checkInstallOrUpdatePlugin, checkInstallPlugin, checkUninstallPlugin, checkUpdatePlugin, getPluginSize, getPluginVersion, getTag, isPluginLoaded, removePlugin, setPluginDownloadListener`

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

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

- - ### Constructor Detail

    - #### ILiveCloudPluginEx

          public ILiveCloudPluginEx(java.lang.String plugin,
                                    java.lang.String nowVersion,
                                    java.lang.String minVersion,
                                    long fileSize)

  - ### Method Detail

    - #### setDependenciesPluginList

          public void setDependenciesPluginList(java.util.List<ILiveCloudPlugin> list)

    - #### setDefaultPluginInstalled

          public void setDefaultPluginInstalled(boolean defaultPluginInstalled)

      Description copied from class: `ILiveCloudPlugin`
      设置是否自带插件
      Overrides:
        `setDefaultPluginInstalled` in class `ILiveCloudPlugin`
      Parameters:
        `defaultPluginInstalled` - true自带，false不自带

    - #### isDefaultPluginInstalled

          public boolean isDefaultPluginInstalled()

      检测是否自带插件
      Overrides:
        `isDefaultPluginInstalled` in class `ILiveCloudPlugin`
      Returns:
        true自带，false不自带

    - #### isPluginInstalled

          public boolean isPluginInstalled()

      检测插件是否已安装
      Overrides:
        `isPluginInstalled` in class `ILiveCloudPlugin`
      Returns:
        true已安装，false未安装

    - #### isPluginValid

          public boolean isPluginValid()

      插件是否有效，分两种情况（前提是依赖的插件必须同时有效）：
      1.系统自带
      2.动态下载且加载成功
      Overrides:
        `isPluginValid` in class `ILiveCloudPlugin`
      Returns:
        true有效，false无效

    - #### loadPlugin

          public int loadPlugin()

      加载已安装的插件（先加载依赖的插件，成功后再加载该插件）
      Overrides:
        `loadPlugin` in class `ILiveCloudPlugin`
      Returns:
        错误码，参见`LiveCloudPluginConstant.ERROR_UNKNOWN`等

    - #### checkInstallPlugin

          public int checkInstallPlugin(Context context,
                                        ILiveCloudPlugin.PluginDownloadListener listener,
                                        ILiveCloudPlugin.PluginCallback callback)

      安装插件（先安装或升级依赖的插件，成功后再安装或升级该插件）
      Overrides:
        `checkInstallPlugin` in class `ILiveCloudPlugin`
      Parameters:
        `context` - context
        `listener` - 下载监听接口，若业务方需要自行实现插件下载功能，需要实现该接口
        `callback` - 回调接口
      Returns:
        错误码，`LiveCloudPluginConstant.ERROR_INSTALL_RUNNING`表示插件正在后台安装或升级， `LiveCloudPluginConstant.ERROR_SUCCESS`表示插件开始安装或升级