Search in sources :

Example 1 with LoaderErrorThrower

use of com.google.android.exoplayer2.upstream.LoaderErrorThrower in project ExoPlayer by google.

the class DashMediaSource method prepareSource.

// MediaSource implementation.
@Override
public void prepareSource(ExoPlayer player, boolean isTopLevelSource, Listener listener) {
    sourceListener = listener;
    if (sideloadedManifest) {
        loaderErrorThrower = new LoaderErrorThrower.Dummy();
        processManifest(false);
    } else {
        dataSource = manifestDataSourceFactory.createDataSource();
        loader = new Loader("Loader:DashMediaSource");
        loaderErrorThrower = loader;
        handler = new Handler();
        startLoadingManifest();
    }
}
Also used : LoaderErrorThrower(com.google.android.exoplayer2.upstream.LoaderErrorThrower) Loader(com.google.android.exoplayer2.upstream.Loader) Handler(android.os.Handler)

Example 2 with LoaderErrorThrower

use of com.google.android.exoplayer2.upstream.LoaderErrorThrower in project ExoPlayer by google.

the class DashMediaSource method createPeriod.

@Override
public MediaPeriod createPeriod(int periodIndex, Allocator allocator, long positionUs) {
    EventDispatcher periodEventDispatcher = eventDispatcher.copyWithMediaTimeOffsetMs(manifest.getPeriod(periodIndex).startMs);
    DashMediaPeriod mediaPeriod = new DashMediaPeriod(firstPeriodId + periodIndex, manifest, periodIndex, chunkSourceFactory, minLoadableRetryCount, periodEventDispatcher, elapsedRealtimeOffsetMs, loaderErrorThrower, allocator);
    periodsById.put(mediaPeriod.id, mediaPeriod);
    return mediaPeriod;
}
Also used : EventDispatcher(com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener.EventDispatcher)

Aggregations

Handler (android.os.Handler)1 EventDispatcher (com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener.EventDispatcher)1 Loader (com.google.android.exoplayer2.upstream.Loader)1 LoaderErrorThrower (com.google.android.exoplayer2.upstream.LoaderErrorThrower)1