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


Java Loadable类代码示例

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


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


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