本文整理汇总了Java中com.google.android.exoplayer2.source.ExtractorMediaSource.EventListener方法的典型用法代码示例。如果您正苦于以下问题:Java ExtractorMediaSource.EventListener方法的具体用法?Java ExtractorMediaSource.EventListener怎么用?Java ExtractorMediaSource.EventListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.exoplayer2.source.ExtractorMediaSource
的用法示例。
在下文中一共展示了ExtractorMediaSource.EventListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import com.google.android.exoplayer2.source.ExtractorMediaSource; //导入方法依赖的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.");
}
}
示例2: add
import com.google.android.exoplayer2.source.ExtractorMediaSource; //导入方法依赖的package包/类
public void add(ExtractorMediaSource.EventListener listener) {
listeners.add(listener);
}
示例3: onLoadError
import com.google.android.exoplayer2.source.ExtractorMediaSource; //导入方法依赖的package包/类
@Override
public void onLoadError(IOException error) {
for (ExtractorMediaSource.EventListener listener : listeners) {
listener.onLoadError(error);
}
}
示例4: extractorMediaSourceListener
import com.google.android.exoplayer2.source.ExtractorMediaSource; //导入方法依赖的package包/类
public ExtractorMediaSource.EventListener extractorMediaSourceListener() {
return extractorMediaSourceListener;
}
示例5: initMp4Player
import com.google.android.exoplayer2.source.ExtractorMediaSource; //导入方法依赖的package包/类
private void initMp4Player(String mp4URL) {
MediaSource sampleSource =
new ExtractorMediaSource(Uri.parse(mp4URL), dataSourceFactory, new DefaultExtractorsFactory(),
handler, new ExtractorMediaSource.EventListener() {
@Override public void onLoadError(IOException error) {
}
});
initExoPlayer(sampleSource);
}