-
public interface ExoMediaSourceInterceptListener设置 ExoPlayer 的 MediaSource 创建拦截 Created by guoshuyu Date: 2018-08-22
-
-
Method Summary
Modifier and Type Method Description abstract MediaSourcegetMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir)abstract DataSource.FactorygetHttpDataSourceFactory(String userAgent, @Nullable() TransferListener listener, int connectTimeoutMillis, int readTimeoutMillis, Map<String, String> mapHeadData, boolean allowCrossProtocolRedirects)一般用户自定义 http 忽略 ssl 证书之类的可用于自定义Demo 有对应例子 abstract DataSink.FactorycacheWriteDataSinkFactory(String CachePath, String url)一般情况下返回 null 就可以了如果 getMediaSource 不为 null ,此方法不会被调用用于每次自定义自己的 CacheDataSink -
-
Method Detail
-
getMediaSource
abstract MediaSource getMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir)
- Parameters:
dataSource- 链接preview- 是否带上header,默认有header自动设置为truecacheEnable- 是否需要缓存isLooping- 是否循环cacheDir- 自定义缓存目录
-
getHttpDataSourceFactory
abstract DataSource.Factory getHttpDataSourceFactory(String userAgent, @Nullable() TransferListener listener, int connectTimeoutMillis, int readTimeoutMillis, Map<String, String> mapHeadData, boolean allowCrossProtocolRedirects)
一般用户自定义 http 忽略 ssl 证书之类的可用于自定义Demo 有对应例子
-
cacheWriteDataSinkFactory
abstract DataSink.Factory cacheWriteDataSinkFactory(String CachePath, String url)
一般情况下返回 null 就可以了如果 getMediaSource 不为 null ,此方法不会被调用用于每次自定义自己的 CacheDataSink
-
-
-
-