• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Loadable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onLoadCompleted

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCompleted(Loadable loadable) {
  Assertions.checkState(loadable == currentLoadable);
  long now = SystemClock.elapsedRealtime();
  long loadDurationMs = now - currentLoadStartTimeMs;
  chunkSource.onChunkLoadCompleted(currentLoadable);
  if (isTsChunk(currentLoadable)) {
    Assertions.checkState(currentLoadable == currentTsLoadable);
    loadingFinished = currentTsLoadable.isLastChunk;
    previousTsLoadable = currentTsLoadable;
    notifyLoadCompleted(currentLoadable.bytesLoaded(), currentTsLoadable.type,
        currentTsLoadable.trigger, currentTsLoadable.format, currentTsLoadable.startTimeUs,
        currentTsLoadable.endTimeUs, now, loadDurationMs);
  } else {
    notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type,
        currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs);
  }
  clearCurrentLoadable();
  if (enabledTrackCount > 0 || !prepared) {
    maybeStartLoading();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:23,代码来源:HlsSampleSource.java


示例2: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable loadable, IOException e) {
  if (chunkSource.onChunkLoadError(currentLoadable, e)) {
    // Error handled by source.
    if (previousTsLoadable == null && !isPendingReset()) {
      pendingResetPositionUs = lastSeekPositionUs;
    }
    clearCurrentLoadable();
  } else {
    currentLoadableException = e;
    currentLoadableExceptionCount++;
    currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  }
  notifyLoadError(e);
  maybeStartLoading();
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:17,代码来源:HlsSampleSource.java


示例3: onLoadCompleted

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCompleted(Loadable loadable) {
  long now = SystemClock.elapsedRealtime();
  long loadDurationMs = now - currentLoadStartTimeMs;
  Chunk currentLoadable = currentLoadableHolder.chunk;
  chunkSource.onChunkLoadCompleted(currentLoadable);
  if (isMediaChunk(currentLoadable)) {
    MediaChunk mediaChunk = (MediaChunk) currentLoadable;
    notifyLoadCompleted(currentLoadable.bytesLoaded(), mediaChunk.type, mediaChunk.trigger,
        mediaChunk.format, mediaChunk.startTimeUs, mediaChunk.endTimeUs, now, loadDurationMs);
    loadingFinished = ((BaseMediaChunk) currentLoadable).isLastChunk;
  } else {
    notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type,
        currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs);
  }
  clearCurrentLoadable();
  updateLoadControl();
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:19,代码来源:ChunkSampleSource.java


示例4: onLoadCompleted

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCompleted(Loadable loadable) {
  if (currentLoadable != loadable) {
    // Stale event.
    return;
  }

  manifest = currentLoadable.getResult();
  manifestLoadStartTimestamp = currentLoadStartTimestamp;
  manifestLoadCompleteTimestamp = SystemClock.elapsedRealtime();
  loadExceptionCount = 0;
  loadException = null;

  if (manifest instanceof RedirectingManifest) {
    RedirectingManifest redirectingManifest = (RedirectingManifest) manifest;
    String nextLocation = redirectingManifest.getNextManifestUri();
    if (!TextUtils.isEmpty(nextLocation)) {
      manifestUri = nextLocation;
    }
  }

  notifyManifestRefreshed();
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:24,代码来源:ManifestFetcher.java


示例5: onLoadCompleted

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCompleted(Loadable loadable) {
  Assertions.checkState(loadable == currentLoadable);
  long now = SystemClock.elapsedRealtime();
  long loadDurationMs = now - currentLoadStartTimeMs;
  chunkSource.onChunkLoadCompleted(currentLoadable);
  if (isTsChunk(currentLoadable)) {
    Assertions.checkState(currentLoadable == currentTsLoadable);
    previousTsLoadable = currentTsLoadable;
    notifyLoadCompleted(currentLoadable.bytesLoaded(), currentTsLoadable.type,
        currentTsLoadable.trigger, currentTsLoadable.format, currentTsLoadable.startTimeUs,
        currentTsLoadable.endTimeUs, now, loadDurationMs);
  } else {
    notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type,
        currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs);
  }
  clearCurrentLoadable();
  maybeStartLoading();
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:20,代码来源:HlsSampleSource.java


示例6: onLoadCompleted

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCompleted(Loadable loadable) {
  long now = SystemClock.elapsedRealtime();
  long loadDurationMs = now - currentLoadStartTimeMs;
  Chunk currentLoadable = currentLoadableHolder.chunk;
  chunkSource.onChunkLoadCompleted(currentLoadable);
  if (isMediaChunk(currentLoadable)) {
    BaseMediaChunk mediaChunk = (BaseMediaChunk) currentLoadable;
    notifyLoadCompleted(currentLoadable.bytesLoaded(), mediaChunk.type, mediaChunk.trigger,
        mediaChunk.format, mediaChunk.startTimeUs, mediaChunk.endTimeUs, now, loadDurationMs);
  } else {
    notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type,
        currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs);
  }
  clearCurrentLoadable();
  updateLoadControl();
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:18,代码来源:ChunkSampleSource.java


示例7: onLoadCompleted

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCompleted(Loadable loadable) {
  Chunk currentLoadable = currentLoadableHolder.chunk;
  notifyLoadCompleted(currentLoadable.bytesLoaded());
  try {
    currentLoadable.consume();
  } catch (IOException e) {
    currentLoadableException = e;
    currentLoadableExceptionCount++;
    currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
    currentLoadableExceptionFatal = true;
    notifyConsumptionError(e);
  } finally {
    if (!isMediaChunk(currentLoadable)) {
      currentLoadable.release();
    }
    if (!currentLoadableExceptionFatal) {
      clearCurrentLoadable();
    }
    updateLoadControl();
  }
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:23,代码来源:ChunkSampleSource.java


示例8: onLoadCompleted

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCompleted(Loadable loadable) {
  try {
    currentLoadable.consume();
  } catch (IOException e) {
    currentLoadableException = e;
    currentLoadableExceptionCount++;
    currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
    currentLoadableExceptionFatal = true;
  } finally {
    if (isTsChunk(currentLoadable)) {
      TsChunk tsChunk = (TsChunk) loadable;
      loadingFinished = tsChunk.isLastChunk;
    }
    if (!currentLoadableExceptionFatal) {
      clearCurrentLoadable();
    }
    maybeStartLoading();
  }
}
 
开发者ID:tyazid,项目名称:Exoplayer_VLC,代码行数:21,代码来源:HlsSampleSource.java


示例9: onLoadCanceled

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCanceled(Loadable loadable) {
  notifyLoadCanceled(currentLoadable.bytesLoaded());
  if (enabledTrackCount > 0) {
    restartFrom(pendingResetPositionUs);
  } else {
    clearState();
    loadControl.trimAllocator();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:11,代码来源:HlsSampleSource.java


示例10: onLoadCanceled

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCanceled(Loadable loadable) {
  if (enabledTrackCount > 0) {
    restartFrom(pendingResetPositionUs);
  } else {
    clearState();
    allocator.trim(0);
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:10,代码来源:ExtractorSampleSource.java


示例11: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable ignored, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount = extractedSampleCount > extractedSampleCountAtStartOfLoad ? 1
      : currentLoadableExceptionCount + 1;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  maybeStartLoading();
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:9,代码来源:ExtractorSampleSource.java


示例12: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  maybeStartLoading();
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:8,代码来源:SingleSampleSource.java


示例13: onLoadCanceled

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCanceled(Loadable loadable) {
  Chunk currentLoadable = currentLoadableHolder.chunk;
  notifyLoadCanceled(currentLoadable.bytesLoaded());
  clearCurrentLoadable();
  if (state == STATE_ENABLED) {
    restartFrom(pendingResetPositionUs);
  } else {
    sampleQueue.clear();
    mediaChunks.clear();
    clearCurrentLoadable();
    loadControl.trimAllocator();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:15,代码来源:ChunkSampleSource.java


示例14: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyLoadError(e);
  chunkSource.onChunkLoadError(currentLoadableHolder.chunk, e);
  updateLoadControl();
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:10,代码来源:ChunkSampleSource.java


示例15: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable loadable, IOException exception) {
  if (currentLoadable != loadable) {
    // Stale event.
    return;
  }

  loadExceptionCount++;
  loadExceptionTimestamp = SystemClock.elapsedRealtime();
  loadException = new IOException(exception);

  notifyManifestError(loadException);
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:14,代码来源:ManifestFetcher.java


示例16: onLoadCanceled

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCanceled(Loadable loadable) {
  // This shouldn't ever happen, but handle it anyway.
  try {
    IOException exception = new IOException("Load cancelled", new CancellationException());
    wrappedCallback.onSingleManifestError(exception);
  } finally {
    releaseLoader();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:11,代码来源:ManifestFetcher.java


示例17: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable ignored, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount = extractedSampleCount > extractedSampleCountAtStartOfLoad ? 1
      : currentLoadableExceptionCount + 1;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyLoadError(e);
  maybeStartLoading();
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:10,代码来源:ExtractorSampleSource.java


示例18: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyLoadError(e);
  maybeStartLoading();
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:9,代码来源:SingleSampleSource.java


示例19: onLoadError

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadError(Loadable loadable, IOException exception) {
  if (currentLoadable != loadable) {
    // Stale event.
    return;
  }

  loadExceptionCount++;
  loadExceptionTimestamp = SystemClock.elapsedRealtime();
  loadException = new ManifestIOException(exception);

  notifyManifestError(loadException);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:14,代码来源:ManifestFetcher.java


示例20: onLoadCanceled

import com.google.android.exoplayer.upstream.Loader.Loadable; //导入依赖的package包/类
@Override
public void onLoadCanceled(Loadable loadable) {
  // This shouldn't ever happen, but handle it anyway.
  try {
    IOException exception = new ManifestIOException(new CancellationException());
    wrappedCallback.onSingleManifestError(exception);
  } finally {
    releaseLoader();
  }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:11,代码来源:ManifestFetcher.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SortTool类代码示例发布时间:2022-05-22
下一篇:
Java Expiration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap