本文整理汇总了Java中com.google.android.exoplayer2.upstream.DefaultHttpDataSource类的典型用法代码示例。如果您正苦于以下问题:Java DefaultHttpDataSource类的具体用法?Java DefaultHttpDataSource怎么用?Java DefaultHttpDataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultHttpDataSource类属于com.google.android.exoplayer2.upstream包,在下文中一共展示了DefaultHttpDataSource类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CustomDefaultHttpDataSourceFactory
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
public CustomDefaultHttpDataSourceFactory(String userAgent,
TransferListener<? super DataSource> listener,
boolean enableShoutcast,
PlayerCallback playerCallback) {
this(userAgent,
listener,
DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
false,
enableShoutcast,
playerCallback);
}
示例2: createDataSource
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
@Override
public DefaultHttpDataSource createDataSource() {
// toggle Shoutcast extraction
if (enableShoutcast) {
return new IcyDataSource(userAgent, null, playerCallback);
} else {
return new DefaultHttpDataSource(userAgent, null, listener, connectTimeoutMillis,
readTimeoutMillis, allowCrossProtocolRedirects, null);
}
}
示例3: buildHttpDataSourceFactory
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
return new DefaultHttpDataSourceFactory(mUserAgent, bandwidthMeter,
DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
true /* allowCrossProtocolRedirects */);
}
示例4: buildHttpDataSourceFactory
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
return new DefaultHttpDataSourceFactory(Util.getUserAgent(mContext, TAG), bandwidthMeter, DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS, true);
}
示例5: setConnectTimeoutMillis
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
private void setConnectTimeoutMillis() {
connectTimeoutMillis = DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS;
}
示例6: setReadTimeoutMillis
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
private void setReadTimeoutMillis() {
readTimeoutMillis = DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS;
}
示例7: createDataSource
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
@Override
public DefaultHttpDataSource createDataSource() {
return new DefaultHttpDataSource(userAgent, null, listener, connectTimeoutMillis, readTimeoutMillis, allowCrossProtocolRedirects, null);
}
示例8: MyDefaultDataSource
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
/**
* Constructs a new instance, optionally configured to follow cross-protocol redirects.
*
* @param context A context.
* @param listener An optional listener.
* @param userAgent The User-Agent string that should be used when requesting remote data.
* @param connectTimeoutMillis The connection timeout that should be used when requesting remote data, in milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param readTimeoutMillis The read timeout that should be used when requesting remote data, in milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param allowCrossProtocolRedirects Whether cross-protocol redirects (i.e. redirects from HTTP to HTTPS and vice versa) are enabled when fetching remote data.
*/
public MyDefaultDataSource(Context context, TransferListener<? super DataSource> listener,
String userAgent, int connectTimeoutMillis, int readTimeoutMillis,
boolean allowCrossProtocolRedirects) {
this(context, listener,
new DefaultHttpDataSource(userAgent, null, listener, connectTimeoutMillis,
readTimeoutMillis, allowCrossProtocolRedirects, null));
}
示例9: AitripDataSource
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; //导入依赖的package包/类
/**
* Constructs a new instance, optionally configured to follow cross-protocol redirects.
*
* @param context A context.
* @param listener An optional listener.
* @param userAgent The User-Agent string that should be used when requesting remote data.
* @param connectTimeoutMillis The connection timeout that should be used when requesting remote
* data, in milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param readTimeoutMillis The read timeout that should be used when requesting remote data,
* in milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param allowCrossProtocolRedirects Whether cross-protocol redirects (i.e. redirects from HTTP
* to HTTPS and vice versa) are enabled when fetching remote data.
*/
public AitripDataSource(Context context, TransferListener<? super DataSource> listener,
String userAgent, int connectTimeoutMillis, int readTimeoutMillis,
boolean allowCrossProtocolRedirects) {
this(context, listener,
new DefaultHttpDataSource(userAgent, null, listener, connectTimeoutMillis,
readTimeoutMillis, allowCrossProtocolRedirects, null));
}