本文整理汇总了Java中com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener类的典型用法代码示例。如果您正苦于以下问题:Java AdaptiveMediaSourceEventListener类的具体用法?Java AdaptiveMediaSourceEventListener怎么用?Java AdaptiveMediaSourceEventListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AdaptiveMediaSourceEventListener类属于com.google.android.exoplayer2.source包,在下文中一共展示了AdaptiveMediaSourceEventListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onLoadStarted
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadStarted(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs) {
for (AdaptiveMediaSourceEventListener listener : listeners) {
listener.onLoadStarted(
dataSpec,
dataType,
trackType,
trackFormat,
trackSelectionReason,
trackSelectionData,
mediaStartTimeMs,
mediaEndTimeMs,
elapsedRealtimeMs
);
}
}
示例2: SsMediaSource
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
private SsMediaSource(SsManifest manifest, Uri manifestUri,
DataSource.Factory manifestDataSourceFactory, SsManifestParser manifestParser,
SsChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount,
long livePresentationDelayMs, Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) {
Assertions.checkState(manifest == null || !manifest.isLive);
this.manifest = manifest;
this.manifestUri = manifestUri == null ? null
: Util.toLowerInvariant(manifestUri.getLastPathSegment()).equals("manifest") ? manifestUri
: Uri.withAppendedPath(manifestUri, "Manifest");
this.manifestDataSourceFactory = manifestDataSourceFactory;
this.manifestParser = manifestParser;
this.chunkSourceFactory = chunkSourceFactory;
this.minLoadableRetryCount = minLoadableRetryCount;
this.livePresentationDelayMs = livePresentationDelayMs;
this.eventDispatcher = new EventDispatcher(eventHandler, eventListener);
mediaPeriods = new ArrayList<>();
}
示例3: HlsMediaSource
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public HlsMediaSource(Uri manifestUri, HlsDataSourceFactory dataSourceFactory,
int minLoadableRetryCount, Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) {
this.manifestUri = manifestUri;
this.dataSourceFactory = dataSourceFactory;
this.minLoadableRetryCount = minLoadableRetryCount;
eventDispatcher = new EventDispatcher(eventHandler, eventListener);
}
示例4: create
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public MediaSource create(ContentType contentType,
Uri uri,
ExtractorMediaSource.EventListener eventListener,
AdaptiveMediaSourceEventListener mediaSourceEventListener) {
switch (contentType) {
case HLS:
return new HlsMediaSource(
uri,
mediaDataSourceFactory,
handler,
mediaSourceEventListener
);
case H264:
DefaultExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
return new ExtractorMediaSource(
uri,
mediaDataSourceFactory,
extractorsFactory,
handler,
eventListener
);
case DASH:
DefaultDashChunkSource.Factory chunkSourceFactory = new DefaultDashChunkSource.Factory(mediaDataSourceFactory);
return new DashMediaSource(
uri,
mediaDataSourceFactory,
chunkSourceFactory,
handler,
mediaSourceEventListener
);
default:
throw new UnsupportedOperationException("Content type: " + contentType + " is not supported.");
}
}
示例5: onLoadCompleted
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadCompleted(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs,
long loadDurationMs,
long bytesLoaded) {
for (AdaptiveMediaSourceEventListener listener : listeners) {
listener.onLoadCompleted(
dataSpec,
dataType,
trackType,
trackFormat,
trackSelectionReason,
trackSelectionData,
mediaStartTimeMs,
mediaEndTimeMs,
elapsedRealtimeMs,
loadDurationMs,
bytesLoaded
);
}
}
示例6: onLoadCanceled
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadCanceled(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs,
long loadDurationMs,
long bytesLoaded) {
for (AdaptiveMediaSourceEventListener listener : listeners) {
listener.onLoadCanceled(
dataSpec,
dataType,
trackType,
trackFormat,
trackSelectionReason,
trackSelectionData,
mediaStartTimeMs,
mediaEndTimeMs,
elapsedRealtimeMs,
loadDurationMs,
bytesLoaded
);
}
}
示例7: onLoadError
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadError(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs,
long loadDurationMs,
long bytesLoaded,
IOException error,
boolean wasCanceled) {
for (AdaptiveMediaSourceEventListener listener : listeners) {
listener.onLoadError(
dataSpec,
dataType,
trackType,
trackFormat,
trackSelectionReason,
trackSelectionData,
mediaStartTimeMs,
mediaEndTimeMs,
elapsedRealtimeMs,
loadDurationMs,
bytesLoaded,
error,
wasCanceled
);
}
}
示例8: onDownstreamFormatChanged
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@Override
public void onDownstreamFormatChanged(int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaTimeMs) {
for (AdaptiveMediaSourceEventListener listener : listeners) {
listener.onDownstreamFormatChanged(trackType, trackFormat, trackSelectionReason, trackSelectionData, mediaTimeMs);
}
}
示例9: DashMediaSource
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
private DashMediaSource(DashManifest manifest, Uri manifestUri,
DataSource.Factory manifestDataSourceFactory, DashManifestParser manifestParser,
DashChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount,
long livePresentationDelayMs, Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) {
this.manifest = manifest;
this.manifestUri = manifestUri;
this.manifestDataSourceFactory = manifestDataSourceFactory;
this.manifestParser = manifestParser;
this.chunkSourceFactory = chunkSourceFactory;
this.minLoadableRetryCount = minLoadableRetryCount;
this.livePresentationDelayMs = livePresentationDelayMs;
sideloadedManifest = manifest != null;
eventDispatcher = new EventDispatcher(eventHandler, eventListener);
manifestUriLock = new Object();
periodsById = new SparseArray<>();
if (sideloadedManifest) {
Assertions.checkState(!manifest.dynamic);
manifestCallback = null;
refreshManifestRunnable = null;
simulateManifestRefreshRunnable = null;
} else {
manifestCallback = new ManifestCallback();
refreshManifestRunnable = new Runnable() {
@Override
public void run() {
startLoadingManifest();
}
};
simulateManifestRefreshRunnable = new Runnable() {
@Override
public void run() {
processManifest(false);
}
};
}
}
示例10: HlsMediaSource
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public HlsMediaSource(Uri manifestUri, DataSource.Factory dataSourceFactory,
int minLoadableRetryCount, Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) {
this.manifestUri = manifestUri;
this.dataSourceFactory = dataSourceFactory;
this.minLoadableRetryCount = minLoadableRetryCount;
eventDispatcher = new EventDispatcher(eventHandler, eventListener);
}
示例11: DashMediaSource
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public DashMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory,
DashChunkSource.Factory chunkSourceFactory, Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) {
this(manifestUri, manifestDataSourceFactory, chunkSourceFactory,
DEFAULT_MIN_LOADABLE_RETRY_COUNT, DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS,
eventHandler, eventListener);
}
示例12: SsMediaSource
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public SsMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory,
SsChunkSource.Factory chunkSourceFactory, Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) {
this(manifestUri, manifestDataSourceFactory, chunkSourceFactory,
DEFAULT_MIN_LOADABLE_RETRY_COUNT, DEFAULT_LIVE_PRESENTATION_DELAY_MS, eventHandler,
eventListener);
}
示例13: add
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public void add(AdaptiveMediaSourceEventListener listener) {
listeners.add(listener);
}
示例14: onUpstreamDiscarded
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@Override
public void onUpstreamDiscarded(int trackType, long mediaStartTimeMs, long mediaEndTimeMs) {
for (AdaptiveMediaSourceEventListener listener : listeners) {
listener.onUpstreamDiscarded(trackType, mediaStartTimeMs, mediaEndTimeMs);
}
}
示例15: mediaSourceEventListener
import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public AdaptiveMediaSourceEventListener mediaSourceEventListener() {
return mediaSourceEventListener;
}