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


Java DataSpec.FLAG_ALLOW_GZIP属性代码示例

本文整理汇总了Java中com.google.android.exoplayer2.upstream.DataSpec.FLAG_ALLOW_GZIP属性的典型用法代码示例。如果您正苦于以下问题:Java DataSpec.FLAG_ALLOW_GZIP属性的具体用法?Java DataSpec.FLAG_ALLOW_GZIP怎么用?Java DataSpec.FLAG_ALLOW_GZIP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.exoplayer2.upstream.DataSpec的用法示例。


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

示例1: executePost

private byte[] executePost(String url, byte[] data, Map<String, String> requestProperties)
        throws IOException {
    HttpDataSource dataSource = dataSourceFactory.createDataSource();
    if (requestProperties != null) {
        for (Map.Entry<String, String> requestProperty : requestProperties.entrySet()) {
            dataSource.setRequestProperty(requestProperty.getKey(), requestProperty.getValue());
        }
    }
    DataSpec dataSpec = new DataSpec(Uri.parse(url), data, 0, 0, C.LENGTH_UNSET, null,
            DataSpec.FLAG_ALLOW_GZIP);
    DataSourceInputStream inputStream = new DataSourceInputStream(dataSource, dataSpec);
    try {
        return Util.toByteArray(inputStream);
    } finally {
        Util.closeQuietly(inputStream);
    }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:17,代码来源:CustomDrmCallback.java

示例2: executePost

private static byte[] executePost(HttpDataSource.Factory dataSourceFactory, String url,
    byte[] data, Map<String, String> requestProperties) throws IOException {
  HttpDataSource dataSource = dataSourceFactory.createDataSource();
  if (requestProperties != null) {
    for (Map.Entry<String, String> requestProperty : requestProperties.entrySet()) {
      dataSource.setRequestProperty(requestProperty.getKey(), requestProperty.getValue());
    }
  }
  DataSpec dataSpec = new DataSpec(Uri.parse(url), data, 0, 0, C.LENGTH_UNSET, null,
      DataSpec.FLAG_ALLOW_GZIP);
  DataSourceInputStream inputStream = new DataSourceInputStream(dataSource, dataSpec);
  try {
    return Util.toByteArray(inputStream);
  } finally {
    Util.closeQuietly(inputStream);
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:17,代码来源:HttpMediaDrmCallback.java

示例3: executePost

private byte[] executePost(String url, byte[] data, Map<String, String> requestProperties)
    throws IOException {
  HttpDataSource dataSource = dataSourceFactory.createDataSource();
  if (requestProperties != null) {
    for (Map.Entry<String, String> requestProperty : requestProperties.entrySet()) {
      dataSource.setRequestProperty(requestProperty.getKey(), requestProperty.getValue());
    }
  }
  DataSpec dataSpec = new DataSpec(Uri.parse(url), data, 0, 0, C.LENGTH_UNSET, null,
      DataSpec.FLAG_ALLOW_GZIP);
  DataSourceInputStream inputStream = new DataSourceInputStream(dataSource, dataSpec);
  try {
    return Util.toByteArray(inputStream);
  } finally {
    inputStream.close();
  }
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:17,代码来源:HttpMediaDrmCallback.java

示例4: newMediaPlaylistChunk

private MediaPlaylistChunk newMediaPlaylistChunk(int variantIndex, int trackSelectionReason,
    Object trackSelectionData) {
  Uri mediaPlaylistUri = UriUtil.resolveToUri(baseUri, variants[variantIndex].url);
  DataSpec dataSpec = new DataSpec(mediaPlaylistUri, 0, C.LENGTH_UNSET, null,
      DataSpec.FLAG_ALLOW_GZIP);
  return new MediaPlaylistChunk(dataSource, dataSpec, variants[variantIndex].format,
      trackSelectionReason, trackSelectionData, scratchSpace, playlistParser, variantIndex,
      mediaPlaylistUri);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:9,代码来源:HlsChunkSource.java

示例5: newEncryptionKeyChunk

private EncryptionKeyChunk newEncryptionKeyChunk(Uri keyUri, String iv, int variantIndex,
    int trackSelectionReason, Object trackSelectionData) {
  DataSpec dataSpec = new DataSpec(keyUri, 0, C.LENGTH_UNSET, null, DataSpec.FLAG_ALLOW_GZIP);
  return new EncryptionKeyChunk(encryptionDataSource, dataSpec, variants[variantIndex].format,
      trackSelectionReason, trackSelectionData, scratchSpace, iv);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:6,代码来源:HlsChunkSource.java

示例6: newEncryptionKeyChunk

private EncryptionKeyChunk newEncryptionKeyChunk(Uri keyUri, String iv, int variantIndex,
    int trackSelectionReason, Object trackSelectionData) {
  DataSpec dataSpec = new DataSpec(keyUri, 0, C.LENGTH_UNSET, null, DataSpec.FLAG_ALLOW_GZIP);
  return new EncryptionKeyChunk(dataSource, dataSpec, variants[variantIndex].format,
      trackSelectionReason, trackSelectionData, scratchSpace, iv);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:6,代码来源:HlsChunkSource.java


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