当前位置: 首页>>代码示例>>Java>>正文


Java TransferListener类代码示例

本文整理汇总了Java中com.google.android.exoplayer2.upstream.TransferListener的典型用法代码示例。如果您正苦于以下问题:Java TransferListener类的具体用法?Java TransferListener怎么用?Java TransferListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TransferListener类属于com.google.android.exoplayer2.upstream包,在下文中一共展示了TransferListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EncryptedFileDataSourceFactory

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
/**
 * Instantiates a new Encrypted file data source factory.
 *
 * @param context         the context
 * @param cipher          the cipher
 * @param secretKeySpec   the secret key spec
 * @param ivParameterSpec the iv parameter spec
 * @param listener        the listener
 */
public EncryptedFileDataSourceFactory(Context context, Cipher cipher, SecretKeySpec secretKeySpec, IvParameterSpec ivParameterSpec, TransferListener<? super DataSource> listener) {
    mCipher = cipher;
    mSecretKeySpec = secretKeySpec;
    mIvParameterSpec = ivParameterSpec;
    mTransferListener = listener;
    String userAgent = Util.getUserAgent(context, context.getPackageName());
    this.context = context.getApplicationContext();
    this.baseDataSourceFactory = new DefaultDataSourceFactory(context, userAgent);
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:19,代码来源:EncryptedFileDataSourceFactory.java

示例2: configureExoMedia

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
private void configureExoMedia() {
    // Registers the media sources to use the OkHttp client instead of the standard Apache one
    // Note: the OkHttpDataSourceFactory can be found in the ExoPlayer extension library `extension-okhttp`
    ExoMedia.setDataSourceFactoryProvider(new ExoMedia.DataSourceFactoryProvider() {
        @NonNull
        @Override
        public DataSource.Factory provide(@NonNull String userAgent, @Nullable TransferListener<? super DataSource> listener) {
            // Updates the network data source to use the OKHttp implementation
            DataSource.Factory upstreamFactory = new OkHttpDataSourceFactory(new OkHttpClient(), userAgent, listener);

            // Adds a cache around the upstreamFactory
            Cache cache = new SimpleCache(getCacheDir(), new LeastRecentlyUsedCacheEvictor(50 * 1024 * 1024));
            return new CacheDataSourceFactory(cache, upstreamFactory, CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR);
        }
    });
}
 
开发者ID:brianwernick,项目名称:ExoMedia,代码行数:17,代码来源:App.java

示例3: buildSource

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@Override
protected MediaSource buildSource(HostActivity host, String userAgent,
    TransferListener<? super DataSource> mediaTransferListener) {
  DataSource.Factory manifestDataSourceFactory = dataSourceFactory != null
      ? dataSourceFactory : new DefaultDataSourceFactory(host, userAgent);
  DataSource.Factory mediaDataSourceFactory = dataSourceFactory != null
      ? dataSourceFactory
      : new DefaultDataSourceFactory(host, userAgent, mediaTransferListener);
  Uri manifestUri = Uri.parse(manifestUrl);
  DefaultDashChunkSource.Factory chunkSourceFactory = new DefaultDashChunkSource.Factory(
      mediaDataSourceFactory);
  return new DashMediaSource.Factory(chunkSourceFactory, manifestDataSourceFactory)
      .setMinLoadableRetryCount(MIN_LOADABLE_RETRY_COUNT)
      .setLivePresentationDelayMs(0)
      .createMediaSource(manifestUri);
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashTestRunner.java

示例4: CronetDataSource

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
CronetDataSource(CronetEngine cronetEngine, Executor executor,
    Predicate<String> contentTypePredicate, TransferListener<? super CronetDataSource> listener,
    int connectTimeoutMs, int readTimeoutMs, boolean resetTimeoutOnRedirects, Clock clock,
    RequestProperties defaultRequestProperties, boolean handleSetCookieRequests) {
  this.cronetEngine = Assertions.checkNotNull(cronetEngine);
  this.executor = Assertions.checkNotNull(executor);
  this.contentTypePredicate = contentTypePredicate;
  this.listener = listener;
  this.connectTimeoutMs = connectTimeoutMs;
  this.readTimeoutMs = readTimeoutMs;
  this.resetTimeoutOnRedirects = resetTimeoutOnRedirects;
  this.clock = Assertions.checkNotNull(clock);
  this.defaultRequestProperties = defaultRequestProperties;
  this.handleSetCookieRequests = handleSetCookieRequests;
  requestProperties = new RequestProperties();
  operation = new ConditionVariable();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:18,代码来源:CronetDataSource.java

示例5: buildSource

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@Override
protected MediaSource buildSource(HostActivity host, String userAgent,
    TransferListener<? super DataSource> mediaTransferListener) {
  DataSource.Factory manifestDataSourceFactory = new DefaultDataSourceFactory(host, userAgent);
  DataSource.Factory mediaDataSourceFactory = new DefaultDataSourceFactory(host, userAgent,
      mediaTransferListener);
  Uri manifestUri = Uri.parse(parameters.manifestUrl);
  DefaultDashChunkSource.Factory chunkSourceFactory = new DefaultDashChunkSource.Factory(
      mediaDataSourceFactory);
  return new DashMediaSource(manifestUri, manifestDataSourceFactory, chunkSourceFactory,
      MIN_LOADABLE_RETRY_COUNT, 0 /* livePresentationDelayMs */, null, null);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:13,代码来源:DashTest.java

示例6: PlayerController

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
public PlayerController(Context context) {
    this.bandwidthMeter = new DefaultBandwidthMeter();
    this.loadControl = new DefaultLoadControl();
    this.extractorsFactory = new DefaultExtractorsFactory();
    this.trackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
    this.dataSourceFactory = new DefaultDataSourceFactory(context, Util.getUserAgent(context.getApplicationContext(), TAG_NAME), (TransferListener<? super DataSource>) bandwidthMeter);
    this.trackSelector = new DefaultTrackSelector(trackSelectionFactory);
    this.player = ExoPlayerFactory.newSimpleInstance(context, this.trackSelector, this.loadControl);
    this.playerView = new PlayerView(context,this.player);
}
 
开发者ID:herudi,项目名称:react-native-exoplayer-intent-video,代码行数:11,代码来源:PlayerController.java

示例7: PartDataSource

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
public PartDataSource(@NonNull Context context,
                      @NonNull MasterSecret masterSecret,
                      @Nullable TransferListener<? super PartDataSource> listener)
{
  this.context      = context.getApplicationContext();
  this.masterSecret = masterSecret;
  this.listener     = listener;
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:9,代码来源:PartDataSource.java

示例8: AttachmentDataSourceFactory

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
public AttachmentDataSourceFactory(@NonNull Context context, @NonNull MasterSecret masterSecret,
                                   @NonNull DefaultDataSourceFactory defaultDataSourceFactory,
                                   @Nullable TransferListener<? super DataSource> listener)
{
  this.context                  = context;
  this.masterSecret             = masterSecret;
  this.defaultDataSourceFactory = defaultDataSourceFactory;
  this.listener                 = listener;
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:10,代码来源:AttachmentDataSourceFactory.java

示例9: CustomDefaultHttpDataSourceFactory

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的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);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:13,代码来源:CustomDefaultHttpDataSourceFactory.java

示例10: CustomHttpDataSource

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@SuppressWarnings("SameParameterValue")
public CustomHttpDataSource(String userAgent, TransferListener<? super DataSource> listener) {

    setUserAgent(userAgent);
    setListener(listener);
    setConnectTimeoutMillis();
    setReadTimeoutMillis();
    setAllowCrossProtocolRedirects();
}
 
开发者ID:Old-Geek,项目名称:Radio2,代码行数:10,代码来源:CustomHttpDataSource.java

示例11: onCreate

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_video_player);

    shouldAutoPlay = true;
    bandwidthMeter = new DefaultBandwidthMeter();
    mediaDataSourceFactory = new DefaultDataSourceFactory(this, Util.getUserAgent(this, "mediaPlayerSample"), (TransferListener<? super DataSource>) bandwidthMeter);
    window = new Timeline.Window();
    ivHideControllerButton = (ImageView) findViewById(R.id.exo_controller);

}
 
开发者ID:yusufcakmak,项目名称:ExoPlayerSample,代码行数:13,代码来源:VideoPlayerActivity.java

示例12: generate

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@NonNull
public MediaSource generate(@NonNull Context context, @NonNull Handler handler, @NonNull Uri uri, @Nullable TransferListener<? super DataSource> transferListener ) {
    String extension = MediaSourceUtil.getExtension(uri);

    // Searches for a registered builder
    SourceTypeBuilder sourceTypeBuilder = findByExtension(extension);
    if (sourceTypeBuilder == null) {
        sourceTypeBuilder = findByLooseComparison(uri);
    }

    // If a registered builder wasn't found then use the default
    MediaSourceBuilder builder = sourceTypeBuilder != null ? sourceTypeBuilder.builder : new DefaultMediaSourceBuilder();
    return builder.build(context, uri, userAgent, handler, transferListener);
}
 
开发者ID:brianwernick,项目名称:ExoMedia,代码行数:15,代码来源:MediaSourceProvider.java

示例13: build

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@NonNull
@Override
public MediaSource build(@NonNull Context context, @NonNull Uri uri, @NonNull String userAgent, @NonNull Handler handler, @Nullable TransferListener<? super DataSource> transferListener) {
    DataSource.Factory dataSourceFactory = buildDataSourceFactory(context, userAgent, null);
    DataSource.Factory meteredDataSourceFactory = buildDataSourceFactory(context, userAgent, transferListener);

    return new SsMediaSource(uri, dataSourceFactory, new DefaultSsChunkSource.Factory(meteredDataSourceFactory), handler, null);
}
 
开发者ID:brianwernick,项目名称:ExoMedia,代码行数:9,代码来源:SsMediaSourceBuilder.java

示例14: build

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@NonNull
@Override
public MediaSource build(@NonNull Context context, @NonNull Uri uri, @NonNull String userAgent, @NonNull Handler handler, @Nullable TransferListener<? super DataSource> transferListener) {
    DataSource.Factory dataSourceFactory = buildDataSourceFactory(context, userAgent, transferListener);

    return new ExtractorMediaSource(uri, dataSourceFactory, new DefaultExtractorsFactory(), handler, null);
}
 
开发者ID:brianwernick,项目名称:ExoMedia,代码行数:8,代码来源:DefaultMediaSourceBuilder.java

示例15: build

import com.google.android.exoplayer2.upstream.TransferListener; //导入依赖的package包/类
@NonNull
@Override
public MediaSource build(@NonNull Context context, @NonNull Uri uri, @NonNull String userAgent, @NonNull Handler handler, @Nullable TransferListener<? super DataSource> transferListener) {
    DataSource.Factory dataSourceFactory = buildDataSourceFactory(context, userAgent, transferListener);

    return new HlsMediaSource(uri, dataSourceFactory, handler, null);
}
 
开发者ID:brianwernick,项目名称:ExoMedia,代码行数:8,代码来源:HlsMediaSourceBuilder.java


注:本文中的com.google.android.exoplayer2.upstream.TransferListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。