-
public class ExoSourceManagerCreated by guoshuyu on 2018/5/18.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intTYPE_RTMPprivate static booleanisForceRtspTcp
-
Method Summary
Modifier and Type Method Description static booleanisForceRtspTcp()static ExoSourceManagernewInstance(Context context, @Nullable() Map<String, String> mapHeadData)MediaSourcegetMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir, @Nullable() String overrideExtension)static voidsetExoMediaSourceInterceptListener(ExoMediaSourceInterceptListener exoMediaSourceInterceptListener)设置ExoPlayer 的 MediaSource 创建拦截 static voidresetExoMediaSourceInterceptListener()static ExoMediaSourceInterceptListenergetExoMediaSourceInterceptListener()static intinferContentType(String fileName, @Nullable() String overrideExtension)static intinferContentType(Uri uri, @Nullable() String overrideExtension)static synchronized CachegetCacheSingleInstance(Context context, File cacheDir)本地缓存目录 voidrelease()static voidclearCache(Context context, File cacheDir, String url)Cache需要release之后才能clear static voidremoveCache(Cache cache, String url)static StringbuildCacheKey(String url)static booleancachePreView(Context context, File cacheDir, String url)booleanhadCached()static booleanisSkipSSLChain()忽律Https证书校验 static voidsetSkipSSLChain(boolean skipSSLChain)设置https忽略证书 static intgetHttpReadTimeout()static voidsetHttpReadTimeout(int httpReadTimeout)如果设置小于 0 就使用默认 8000 MILLIS static intgetHttpConnectTimeout()static voidsetHttpConnectTimeout(int httpConnectTimeout)如果设置小于 0 就使用默认 8000 MILLIS static DatabaseProvidergetDatabaseProvider()static voidsetDatabaseProvider(DatabaseProvider databaseProvider)static voidsetForceRtspTcp(boolean isForceRtspTcp)static DataSource.FactorygetDataSourceFactory(Context context, boolean preview, String uerAgent, Map<String, String> mapHeadData)获取SourceFactory static DataSource.FactorygetHttpDataSourceFactory(Context context, boolean preview, String uerAgent, Map<String, String> mapHeadData)-
-
Method Detail
-
isForceRtspTcp
static boolean isForceRtspTcp()
-
newInstance
static ExoSourceManager newInstance(Context context, @Nullable() Map<String, String> mapHeadData)
-
getMediaSource
MediaSource getMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir, @Nullable() String overrideExtension)
- Parameters:
dataSource- 链接preview- 是否带上header,默认有header自动设置为truecacheEnable- 是否需要缓存isLooping- 是否循环cacheDir- 自定义缓存目录
-
setExoMediaSourceInterceptListener
static void setExoMediaSourceInterceptListener(ExoMediaSourceInterceptListener exoMediaSourceInterceptListener)
设置ExoPlayer 的 MediaSource 创建拦截
-
resetExoMediaSourceInterceptListener
static void resetExoMediaSourceInterceptListener()
-
getExoMediaSourceInterceptListener
static ExoMediaSourceInterceptListener getExoMediaSourceInterceptListener()
-
inferContentType
@C.ContentType() static int inferContentType(String fileName, @Nullable() String overrideExtension)
-
inferContentType
@C.ContentType() static int inferContentType(Uri uri, @Nullable() String overrideExtension)
-
getCacheSingleInstance
static synchronized Cache getCacheSingleInstance(Context context, File cacheDir)
本地缓存目录
-
release
void release()
-
clearCache
static void clearCache(Context context, File cacheDir, String url)
Cache需要release之后才能clear
-
removeCache
static void removeCache(Cache cache, String url)
-
buildCacheKey
static String buildCacheKey(String url)
-
cachePreView
static boolean cachePreView(Context context, File cacheDir, String url)
-
hadCached
boolean hadCached()
-
isSkipSSLChain
@Deprecated() static boolean isSkipSSLChain()
忽律Https证书校验
-
setSkipSSLChain
@Deprecated() static void setSkipSSLChain(boolean skipSSLChain)
设置https忽略证书
- Parameters:
skipSSLChain- true时是hulve
-
getHttpReadTimeout
static int getHttpReadTimeout()
-
setHttpReadTimeout
static void setHttpReadTimeout(int httpReadTimeout)
如果设置小于 0 就使用默认 8000 MILLIS
-
getHttpConnectTimeout
static int getHttpConnectTimeout()
-
setHttpConnectTimeout
static void setHttpConnectTimeout(int httpConnectTimeout)
如果设置小于 0 就使用默认 8000 MILLIS
-
getDatabaseProvider
static DatabaseProvider getDatabaseProvider()
-
setDatabaseProvider
static void setDatabaseProvider(DatabaseProvider databaseProvider)
-
setForceRtspTcp
static void setForceRtspTcp(boolean isForceRtspTcp)
-
getDataSourceFactory
static DataSource.Factory getDataSourceFactory(Context context, boolean preview, String uerAgent, Map<String, String> mapHeadData)
获取SourceFactory
-
getHttpDataSourceFactory
static DataSource.Factory getHttpDataSourceFactory(Context context, boolean preview, String uerAgent, Map<String, String> mapHeadData)
-
-
-
-