Java 类com.google.android.exoplayer2.upstream.DefaultHttpDataSource 实例源码

项目:Exoplayer2Radio    文件:CustomDefaultHttpDataSourceFactory.java   
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);
}
项目:Exoplayer2Radio    文件:CustomDefaultHttpDataSourceFactory.java   
@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);
    }
}
项目:transistor    文件:CustomDefaultHttpDataSourceFactory.java   
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);
}
项目:transistor    文件:CustomDefaultHttpDataSourceFactory.java   
@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);
    }
}
项目:chaosflix-leanback    文件:PlayerActivity.java   
private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
    return new DefaultHttpDataSourceFactory(mUserAgent, bandwidthMeter,
            DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
            DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
            true /* allowCrossProtocolRedirects */);
}
项目:chaosflix    文件:PlayerActivity.java   
private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
    return new DefaultHttpDataSourceFactory(mUserAgent, bandwidthMeter,
            DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
            DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
            true /* allowCrossProtocolRedirects */);
}
项目:TigerVideo    文件:VideoExoPlayer.java   
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);
    }
项目:Radio2    文件:CustomHttpDataSource.java   
private void setConnectTimeoutMillis() {
    connectTimeoutMillis = DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS;
}
项目:Radio2    文件:CustomHttpDataSource.java   
private void setReadTimeoutMillis() {
    readTimeoutMillis = DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS;
}
项目:Radio2    文件:CustomHttpDataSource.java   
@Override
public DefaultHttpDataSource createDataSource() {

    return new DefaultHttpDataSource(userAgent, null, listener, connectTimeoutMillis, readTimeoutMillis, allowCrossProtocolRedirects, null);
}
项目:yjPlay    文件:MyDefaultDataSource.java   
/**
 * 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));
}
项目:AesExoPlayer    文件:AitripDataSource.java   
/**
 * 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));
}
项目:yjPlay    文件:MyDefaultDataSource.java   
/**
 * 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);
}
项目:AesExoPlayer    文件:AitripDataSource.java   
/**
 * 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);
}