public class PolyvDownloader extends com.easefun.polyvsdk.download.PolyvDownloaderListenerEvent implements IPolyvDownloader
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
PolyvDownloader.FileType |
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
FILE_AUDIO |
static int |
FILE_VIDEO |
| 构造器和说明 |
|---|
PolyvDownloader(java.lang.String videoId,
int bitrate)
已过时。
|
PolyvDownloader(java.lang.String videoId,
int bitrate,
int fileType)
已过时。
|
PolyvDownloader(java.lang.String videoId,
int bitrate,
int fileType,
Video.HlsSpeedType hlsSpeedType)
已过时。
|
PolyvDownloader(java.lang.String videoId,
int bitrate,
Video.HlsSpeedType hlsSpeedType)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
callProgressListenerSuccess() |
boolean |
delete()
删除音频/视频文件,文件类型根据构建PolyvDownloader的fileType决定
删除之前会做stop停止动作 |
boolean |
deleteVideo()
删除视频文件
删除之前会做stop停止动作 |
static void |
deleteVideo(java.lang.String vid)
已过时。
|
boolean |
deleteVideo(java.lang.String vid,
int bitRate)
删除视频文件
删除之前会做stop停止动作 |
boolean |
deleteVideo(java.lang.String vid,
int bitRate,
Video.HlsSpeedType hlsSpeedType)
删除视频文件
删除之前会做stop停止动作 |
android.content.Context |
getContext()
取得在使用的context
|
int |
getSpeedCallbackInterval()
取得速度回调间隔时间
|
boolean |
isAllowAdaptiveBitrate()
是否允许自适应码率下载
|
boolean |
isCallbackProgressWhereExists()
获取当下载是下载m3u8视频,ts文件存在时是否回调进度。
|
void |
isCallbackProgressWhereExists(boolean isCallback)
当下载是下载m3u8视频,ts文件存在时,是否回调进度。
|
boolean |
isDownloading()
是否在下载中
|
void |
setAllowAdaptiveBitrate(boolean allow)
设置是否允许自适应码率下载,如果允许,自动码率则下载当前视频的最高码率,其他目标码率则当目标码率不存在时,就降级,下载低级别的码率。
|
void |
setPolyvDownloadSpeedListener(IPolyvDownloaderSpeedListener l)
设置下载速度回调监听
|
void |
setSpeedCallbackInterval(int interval)
设置速度回调间隔
|
void |
start()
已过时。
|
void |
start(android.content.Context context)
开始下载
|
void |
stop()
停止下载
已下载完成的资源会保留成文件 |
void |
stop(boolean isDestroy)
停止下载
已下载完成的资源会保留成文件 |
callBeforeStartListener, callProgressListenerDownload, callProgressListenerFail, callProgressListenerFail, callProgressListenerFail, callProgressListenerFail, callProgressListenerSuccess, callStartListener, callStopListener, callUnzipListenerDone, callUnzipListenerProgress, callVideoInfoListener, clearListener, getDownloading, setDownloading, setPolyvDownloadBeforeStartListener, setPolyvDownloadProressListener, setPolyvDownloadProressListener, setPolyvDownloadProressListener2, setPolyvDownloadSDKBeforeStartListener, setPolyvDownloadSDKEndListener, setPolyvDownloadSDKStartListener, setPolyvDownloadSDKStopListener, setPolyvDownloadStartListener, setPolyvDownloadStopListener, setPolyvDownloadUnzipListener, setPolyvDownloadVideoInfoListenerpublic static final int FILE_VIDEO
public static final int FILE_AUDIO
@Deprecated
public PolyvDownloader(java.lang.String videoId,
int bitrate)
PolyvDownloaderManager取得实例videoId - 视频vidbitrate - 码率(清晰度)PolyvDownloaderManager@Deprecated
public PolyvDownloader(java.lang.String videoId,
int bitrate,
Video.HlsSpeedType hlsSpeedType)
PolyvDownloaderManager取得实例videoId - 视频vidbitrate - 码率(清晰度)hlsSpeedType - 播放速度,只对HLS视频有效PolyvDownloaderManager@Deprecated
public PolyvDownloader(java.lang.String videoId,
int bitrate,
int fileType)
PolyvDownloaderManager取得实例videoId - 视频vidbitrate - 码率(清晰度)fileType - 下载的文件类型PolyvDownloaderManager@Deprecated
public PolyvDownloader(java.lang.String videoId,
int bitrate,
int fileType,
Video.HlsSpeedType hlsSpeedType)
PolyvDownloaderManager取得实例videoId - 视频vidbitrate - 码率fileType - 下载的文件类型hlsSpeedType - 播放速度,只对HLS视频有效PolyvDownloaderManagerprotected void callProgressListenerSuccess()
public boolean isDownloading()
IPolyvDownloaderisDownloading 在接口中 IPolyvDownloader@Deprecated public void start()
IPolyvDownloaderstart 在接口中 IPolyvDownloaderIPolyvDownloader.start(Context)public void start(android.content.Context context)
IPolyvDownloaderstart 在接口中 IPolyvDownloadercontext - 设置此参数会判断SD卡权限是否拥有public void stop()
IPolyvDownloaderstop 在接口中 IPolyvDownloaderpublic void stop(boolean isDestroy)
IPolyvDownloaderstop 在接口中 IPolyvDownloaderisDestroy - - 是否销毁public void setPolyvDownloadSpeedListener(IPolyvDownloaderSpeedListener l)
IPolyvDownloaderListenerEventsetPolyvDownloadSpeedListener 在接口中 IPolyvDownloaderListenerEventl - 监听回调public void isCallbackProgressWhereExists(boolean isCallback)
IPolyvDownloaderisCallbackProgressWhereExists 在接口中 IPolyvDownloaderisCallback - 默认为truepublic boolean isCallbackProgressWhereExists()
IPolyvDownloaderpublic void setSpeedCallbackInterval(int interval)
IPolyvDownloadersetSpeedCallbackInterval 在接口中 IPolyvDownloaderinterval - 毫秒,默认值1000public int getSpeedCallbackInterval()
IPolyvDownloadergetSpeedCallbackInterval 在接口中 IPolyvDownloaderpublic void setAllowAdaptiveBitrate(boolean allow)
IPolyvDownloaderPolyvDownloaderErrorReason.ErrorType.VIDEO_BITRATE_NOT_EXIST类型的错误。setAllowAdaptiveBitrate 在接口中 IPolyvDownloaderallow - 默认为truepublic boolean isAllowAdaptiveBitrate()
IPolyvDownloaderisAllowAdaptiveBitrate 在接口中 IPolyvDownloadertrue:允许false:不允许public android.content.Context getContext()
IPolyvDownloadergetContext 在接口中 IPolyvDownloaderpublic boolean delete()
IPolyvDownloaderdelete 在接口中 IPolyvDownloaderpublic boolean deleteVideo()
IPolyvDownloaderdeleteVideo 在接口中 IPolyvDownloaderIPolyvDownloader.delete()public boolean deleteVideo(java.lang.String vid,
int bitRate)
IPolyvDownloaderdeleteVideo 在接口中 IPolyvDownloadervid - 视频idbitRate - 码率(清晰度)IPolyvDownloader.deleteVideo()public boolean deleteVideo(java.lang.String vid,
int bitRate,
Video.HlsSpeedType hlsSpeedType)
IPolyvDownloaderdeleteVideo 在接口中 IPolyvDownloadervid - 视频idbitRate - 码率(清晰度)hlsSpeedType - 播放速度类型 Video.HlsSpeedType,非加密视频设置此参数没有效果,默认值Video.HlsSpeedType.SPEED_1X。请使用PolyvForwardingIjkVideoView.setSpeed(float)设置播放速度IPolyvDownloader.deleteVideo()@Deprecated public static void deleteVideo(java.lang.String vid)
PolyvDownloader 实例,没有实例方法的停止功能,
请在线程中执行该方法,避免卡顿和ANE。vid - 视频idPolyvDownloaderUtils.deleteVideo(String)