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); }
@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); } }
private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) { return new DefaultHttpDataSourceFactory(mUserAgent, bandwidthMeter, DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS, DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS, true /* allowCrossProtocolRedirects */); }
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); }
private void setConnectTimeoutMillis() { connectTimeoutMillis = DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS; }
private void setReadTimeoutMillis() { readTimeoutMillis = DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS; }
@Override public DefaultHttpDataSource createDataSource() { return new DefaultHttpDataSource(userAgent, null, listener, connectTimeoutMillis, readTimeoutMillis, allowCrossProtocolRedirects, null); }
/** * 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)); }
/** * 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)); }
/** * 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 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, boolean allowCrossProtocolRedirects) { this(context, listener, userAgent, DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS, DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS, allowCrossProtocolRedirects); }
/** * 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 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, boolean allowCrossProtocolRedirects) { this(context, listener, userAgent, DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS, DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS, allowCrossProtocolRedirects); }