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


Java DefaultHttpDataSourceFactory类代码示例

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


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

示例1: buildDrmSessionManager

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
@Override
protected final DefaultDrmSessionManager<FrameworkMediaCrypto> buildDrmSessionManager(
    final String userAgent) {
  DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = null;
  if (parameters.isWidevineEncrypted) {
    try {
      MediaDrmCallback drmCallback = new HttpMediaDrmCallback(parameters.widevineLicenseUrl,
          new DefaultHttpDataSourceFactory(userAgent));
      drmSessionManager = DefaultDrmSessionManager.newWidevineInstance(drmCallback, null,
          null, null);
      if (!parameters.useL1Widevine) {
        drmSessionManager.setPropertyString(SECURITY_LEVEL_PROPERTY, WIDEVINE_SECURITY_LEVEL_3);
      }
      if (offlineLicenseKeySetId != null) {
        drmSessionManager.setMode(DefaultDrmSessionManager.MODE_PLAYBACK,
            offlineLicenseKeySetId);
      }
    } catch (UnsupportedDrmException e) {
      throw new IllegalStateException(e);
    }
  }
  return drmSessionManager;
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:24,代码来源:DashTest.java

示例2: buildMediaSource

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
private MediaSource buildMediaSource(Context context, Uri uri) {
    int type = getUrlType(uri.toString());
    switch (type) {
        case C.TYPE_SS:
            return new SsMediaSource(uri, new DefaultDataSourceFactory(context, null,
                    new DefaultHttpDataSourceFactory(USER_AGENT, null)),
                    new DefaultSsChunkSource.Factory(new DefaultDataSourceFactory(context, BANDWIDTH_METER,
                            new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER))), mainThreadHandler, null);
        case C.TYPE_DASH:
            return new DashMediaSource(uri, new DefaultDataSourceFactory(context, null,
                    new DefaultHttpDataSourceFactory(USER_AGENT, null)),
                    new DefaultDashChunkSource.Factory(new DefaultDataSourceFactory(context, BANDWIDTH_METER,
                            new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER))), mainThreadHandler, null);
        case C.TYPE_HLS:
            return new HlsMediaSource(uri, new DefaultDataSourceFactory(context, BANDWIDTH_METER,
                    new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER)), mainThreadHandler, null);
        case C.TYPE_OTHER:
            return new ExtractorMediaSource(uri, new DefaultDataSourceFactory(context, BANDWIDTH_METER,
                    new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER)), new DefaultExtractorsFactory(),
                    mainThreadHandler, null);
        default: {
            throw new IllegalStateException("Unsupported type: " + type);
        }
    }
}
 
开发者ID:tohodog,项目名称:QSVideoPlayer,代码行数:26,代码来源:ExoMedia.java

示例3: buildDrmSessionManager

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
@Override
protected DefaultDrmSessionManager<FrameworkMediaCrypto> buildDrmSessionManager(
    final String userAgent) {
  if (widevineLicenseUrl == null) {
    return null;
  }
  try {
    MediaDrmCallback drmCallback = new HttpMediaDrmCallback(widevineLicenseUrl,
        new DefaultHttpDataSourceFactory(userAgent));
    DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager =
        DefaultDrmSessionManager.newWidevineInstance(drmCallback, null, null, null);
    if (!useL1Widevine) {
      drmSessionManager.setPropertyString(
          SECURITY_LEVEL_PROPERTY, WIDEVINE_SECURITY_LEVEL_3);
    }
    if (offlineLicenseKeySetId != null) {
      drmSessionManager.setMode(DefaultDrmSessionManager.MODE_PLAYBACK,
          offlineLicenseKeySetId);
    }
    return drmSessionManager;
  } catch (UnsupportedDrmException e) {
    throw new IllegalStateException(e);
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:25,代码来源:DashTestRunner.java

示例4: setUp

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  testRunner = new DashTestRunner(TAG, getActivity(), getInstrumentation())
      .setStreamName("test_widevine_h264_fixed_offline")
      .setManifestUrl(DashTestData.WIDEVINE_H264_MANIFEST)
      .setWidevineInfo(MimeTypes.VIDEO_H264, true)
      .setFullPlaybackNoSeeking(true)
      .setCanIncludeAdditionalVideoFormats(false)
      .setAudioVideoFormats(DashTestData.WIDEVINE_AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.WIDEVINE_H264_CDD_FIXED);

  boolean useL1Widevine = DashTestRunner.isL1WidevineAvailable(MimeTypes.VIDEO_H264);
  String widevineLicenseUrl = DashTestData.getWidevineLicenseUrl(true, useL1Widevine);
  httpDataSourceFactory = new DefaultHttpDataSourceFactory(USER_AGENT);
  if (Util.SDK_INT >= 18) {
    offlineLicenseHelper = OfflineLicenseHelper.newWidevineInstance(widevineLicenseUrl,
        httpDataSourceFactory);
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:21,代码来源:DashWidevineOfflineTest.java

示例5: TestOfflineLicenseHelper

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
public TestOfflineLicenseHelper(DashHostedTestEncParameters parameters)
    throws UnsupportedDrmException {
  this.parameters = parameters;
  httpDataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayerPlaybackTests");
  offlineLicenseHelper = OfflineLicenseHelper.newWidevineInstance(
      parameters.widevineLicenseUrl, httpDataSourceFactory);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:8,代码来源:DashTest.java

示例6: buildMediaSource

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
private MediaSource buildMediaSource(Uri uri) {
  DataSource.Factory manifestDataSourceFactory = new DefaultHttpDataSourceFactory("ua");
  DashChunkSource.Factory dashChunkSourceFactory = new DefaultDashChunkSource.Factory(
      new DefaultHttpDataSourceFactory("ua", BANDWIDTH_METER));
  return new DashMediaSource.Factory(dashChunkSourceFactory, manifestDataSourceFactory)
      .createMediaSource(uri);
}
 
开发者ID:googlecodelabs,项目名称:exoplayer-intro,代码行数:8,代码来源:PlayerActivity.java

示例7: buildMediaSource

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
private MediaSource buildMediaSource(Uri uri) {
  DashChunkSource.Factory dashChunkSourceFactory = new DefaultDashChunkSource.Factory(
      new DefaultHttpDataSourceFactory("ua", BANDWIDTH_METER));
  DataSource.Factory manifestDataSourceFactory = new DefaultHttpDataSourceFactory("ua");
  return new DashMediaSource.Factory(dashChunkSourceFactory, manifestDataSourceFactory).
      createMediaSource(uri);
}
 
开发者ID:googlecodelabs,项目名称:exoplayer-intro,代码行数:8,代码来源:PlayerActivity.java

示例8: getHttpDataSourceFactory

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
private DataSource.Factory getHttpDataSourceFactory(boolean preview) {
    DefaultHttpDataSourceFactory dataSourceFactory = new DefaultHttpDataSourceFactory(Util.getUserAgent(mAppContext,
            TAG), preview ? null : new DefaultBandwidthMeter());
    if (mHeaders != null && mHeaders.size() > 0) {
        for (Map.Entry<String, String> header : mHeaders.entrySet()) {
            dataSourceFactory.getDefaultRequestProperties().set(header.getKey(), header.getValue());
        }
    }
    return dataSourceFactory;
}
 
开发者ID:CarGuo,项目名称:GSYVideoPlayer,代码行数:11,代码来源:IjkExo2MediaPlayer.java

示例9: CacheDataSourceFactory

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
CacheDataSourceFactory(Context context, long maxCacheSize, long maxFileSize) {
    super();
    this.context = context;
    this.maxCacheSize = maxCacheSize;
    this.maxFileSize = maxFileSize;
    String userAgent = Util.getUserAgent(context, context.getString(R.string.app_name));
    DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
    defaultDatasourceFactory = new DefaultDataSourceFactory(this.context, bandwidthMeter,
            new DefaultHttpDataSourceFactory(userAgent, bandwidthMeter));
}
 
开发者ID:ccrama,项目名称:Slide,代码行数:11,代码来源:MediaVideoView.java

示例10: buildHttpDataSourceFactory

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
public HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
    return new DefaultHttpDataSourceFactory(userAgent, bandwidthMeter);
}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:4,代码来源:DemoApplication.java

示例11: buildHttpDataSourceFactory

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
public static
@NonNull
HttpDataSource.Factory buildHttpDataSourceFactory(@NonNull Context context, @NonNull DefaultBandwidthMeter bandwidthMeter) {
    return new DefaultHttpDataSourceFactory(Util.getUserAgent(context, "TubiExoPlayer"), bandwidthMeter);
}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:6,代码来源:MediaHelper.java

示例12: buildHttpDataSourceFactory

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
public HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
    return new DefaultHttpDataSourceFactory(Util.getUserAgent(this, "TubiPlayerActivity"), bandwidthMeter);
}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:4,代码来源:TubiPlayerActivity.java

示例13: buildHttpDataSourceFactory

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
public HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
    return new DefaultHttpDataSourceFactory(deviceIdentifier, bandwidthMeter);
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:4,代码来源:TgbApp.java

示例14: buildHttpDataSourceFactory

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
	return new DefaultHttpDataSourceFactory(mUserAgent, bandwidthMeter,
			DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
			DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
			true /* allowCrossProtocolRedirects */);
}
 
开发者ID:NiciDieNase,项目名称:chaosflix-leanback,代码行数:7,代码来源:PlayerActivity.java

示例15: buildMediaSource

import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; //导入依赖的package包/类
private MediaSource buildMediaSource(Uri uri) {
  return new ExtractorMediaSource.Factory(new DefaultHttpDataSourceFactory("exoplayer-codelab"))
      .createMediaSource(uri);
}
 
开发者ID:googlecodelabs,项目名称:exoplayer-intro,代码行数:5,代码来源:PlayerActivity.java


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