本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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);
}