本文整理汇总了Java中com.google.android.exoplayer2.source.dash.DefaultDashChunkSource.Factory方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultDashChunkSource.Factory方法的具体用法?Java DefaultDashChunkSource.Factory怎么用?Java DefaultDashChunkSource.Factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.exoplayer2.source.dash.DefaultDashChunkSource
的用法示例。
在下文中一共展示了DefaultDashChunkSource.Factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
int type = Util.inferContentType(!TextUtils.isEmpty(overrideExtension) ? "." + overrideExtension
: uri.getLastPathSegment());
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, buildDataSourceFactory(false),
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), mainHandler, null);
case C.TYPE_DASH:
return new DashMediaSource(uri, buildDataSourceFactory(false),
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, null);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mediaDataSourceFactory, mainHandler, null);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(),
mainHandler, null);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例2: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
int type = Util.inferContentType(!TextUtils.isEmpty(overrideExtension) ? "." + overrideExtension
: uri.getLastPathSegment());
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, buildDataSourceFactory(false),
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), mainHandler, eventLogger);
case C.TYPE_DASH:
return new DashMediaSource(uri, buildDataSourceFactory(false),
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, eventLogger);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mediaDataSourceFactory, mainHandler, eventLogger);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(),
mainHandler, eventLogger);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例3: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Context context, Uri uri) {
int type = getUrlType(uri.toString());
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, new DefaultDataSourceFactory(context, null,
new DefaultHttpDataSourceFactory(USER_AGENT, null)),
new DefaultSsChunkSource.Factory(new DefaultDataSourceFactory(context, BANDWIDTH_METER,
new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER))), mainThreadHandler, null);
case C.TYPE_DASH:
return new DashMediaSource(uri, new DefaultDataSourceFactory(context, null,
new DefaultHttpDataSourceFactory(USER_AGENT, null)),
new DefaultDashChunkSource.Factory(new DefaultDataSourceFactory(context, BANDWIDTH_METER,
new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER))), mainThreadHandler, null);
case C.TYPE_HLS:
return new HlsMediaSource(uri, new DefaultDataSourceFactory(context, BANDWIDTH_METER,
new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER)), mainThreadHandler, null);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, new DefaultDataSourceFactory(context, BANDWIDTH_METER,
new DefaultHttpDataSourceFactory(USER_AGENT, BANDWIDTH_METER)), new DefaultExtractorsFactory(),
mainThreadHandler, null);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例4: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
DataSource.Factory mediaDataSourceFactory = buildDataSourceFactory(true);
int type = TextUtils.isEmpty(overrideExtension) ? Util.inferContentType(uri)
: Util.inferContentType("." + overrideExtension);
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, buildDataSourceFactory(false),
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), mainHandler, null);
case C.TYPE_DASH:
return new DashMediaSource(uri, buildDataSourceFactory(false),
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, null);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mediaDataSourceFactory, mainHandler, null);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(),
mainHandler, null);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例5: getMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
public MediaSource getMediaSource(boolean preview) {
switch (streamType) {
case C.TYPE_SS:
return new SsMediaSource(uri, new DefaultDataSourceFactory(context, null,
getHttpDataSourceFactory(preview)),
new DefaultSsChunkSource.Factory(getDataSourceFactory(preview)),
mainHandler, null);
case C.TYPE_DASH:
return new DashMediaSource(uri,
new DefaultDataSourceFactory(context, null,
getHttpDataSourceFactory(preview)),
new DefaultDashChunkSource.Factory(getDataSourceFactory(preview)),
mainHandler, null);
case C.TYPE_HLS:
return new HlsMediaSource(uri, getDataSourceFactory(preview), mainHandler, null);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, getDataSourceFactory(preview),
new DefaultExtractorsFactory(), mainHandler, null);
default: {
throw new IllegalStateException("Unsupported type: " + streamType);
}
}
}
示例6: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
int type = Util.inferContentType(!TextUtils.isEmpty(overrideExtension) ? "." + overrideExtension
: uri.getLastPathSegment());
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, buildDataSourceFactory(false),
new DefaultSsChunkSource.Factory(mMediaDataSourceFactory), mMainHandler, mEventLogger);
case C.TYPE_DASH:
return new DashMediaSource(uri, buildDataSourceFactory(false),
new DefaultDashChunkSource.Factory(mMediaDataSourceFactory), mMainHandler, mEventLogger);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mMediaDataSourceFactory, mMainHandler, mEventLogger);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, mMediaDataSourceFactory, new DefaultExtractorsFactory(),
mMainHandler, mEventLogger);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例7: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
int type = Util.inferContentType(!TextUtils.isEmpty(overrideExtension) ? "." + overrideExtension
: uri.getLastPathSegment());
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, new DefaultDataSourceFactory(context, userAgent),
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), mainHandler, eventLogger);
case C.TYPE_DASH:
return new DashMediaSource(uri, new DefaultDataSourceFactory(context, userAgent),
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, eventLogger);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mediaDataSourceFactory, mainHandler, eventLogger);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(),
mainHandler, eventLogger);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例8: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri) {
int type = Util.inferContentType(uri.getLastPathSegment());
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, buildDataSourceFactory(false),
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), new Handler(), null);
case C.TYPE_DASH:
return new DashMediaSource(uri, buildDataSourceFactory(false),
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), new Handler(), null);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mediaDataSourceFactory, new Handler(), null);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(),
new Handler(), null);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例9: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
int type = Util.inferContentType(!TextUtils.isEmpty(overrideExtension) ? "." + overrideExtension
: uri.getLastPathSegment());
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, buildDataSourceFactory(false),
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), mainHandler, eventLogger);
case C.TYPE_DASH:
return new DashMediaSource(uri, buildDataSourceFactory(false),
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, eventLogger);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mediaDataSourceFactory, mainHandler, eventLogger);
case C.TYPE_OTHER:
return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(),
mainHandler, eventLogger);
default: {
throw new IllegalStateException("Unsupported type: " + type);
}
}
}
示例10: buildSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
@Override
protected MediaSource buildSource(HostActivity host, String userAgent,
TransferListener<? super DataSource> mediaTransferListener) {
DataSource.Factory manifestDataSourceFactory = dataSourceFactory != null
? dataSourceFactory : new DefaultDataSourceFactory(host, userAgent);
DataSource.Factory mediaDataSourceFactory = dataSourceFactory != null
? dataSourceFactory
: new DefaultDataSourceFactory(host, userAgent, mediaTransferListener);
Uri manifestUri = Uri.parse(manifestUrl);
DefaultDashChunkSource.Factory chunkSourceFactory = new DefaultDashChunkSource.Factory(
mediaDataSourceFactory);
return new DashMediaSource.Factory(chunkSourceFactory, manifestDataSourceFactory)
.setMinLoadableRetryCount(MIN_LOADABLE_RETRY_COUNT)
.setLivePresentationDelayMs(0)
.createMediaSource(manifestUri);
}
示例11: buildSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
@Override
protected MediaSource buildSource(HostActivity host, String userAgent,
TransferListener<? super DataSource> mediaTransferListener) {
DataSource.Factory manifestDataSourceFactory = new DefaultDataSourceFactory(host, userAgent);
DataSource.Factory mediaDataSourceFactory = new DefaultDataSourceFactory(host, userAgent,
mediaTransferListener);
Uri manifestUri = Uri.parse(parameters.manifestUrl);
DefaultDashChunkSource.Factory chunkSourceFactory = new DefaultDashChunkSource.Factory(
mediaDataSourceFactory);
return new DashMediaSource(manifestUri, manifestDataSourceFactory, chunkSourceFactory,
MIN_LOADABLE_RETRY_COUNT, 0 /* livePresentationDelayMs */, null, null);
}
示例12: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri) {
DataSource.Factory manifestDataSourceFactory = new DefaultHttpDataSourceFactory("ua");
DashChunkSource.Factory dashChunkSourceFactory = new DefaultDashChunkSource.Factory(
new DefaultHttpDataSourceFactory("ua", BANDWIDTH_METER));
return new DashMediaSource.Factory(dashChunkSourceFactory, manifestDataSourceFactory)
.createMediaSource(uri);
}
示例13: buildMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource buildMediaSource(Uri uri) {
DashChunkSource.Factory dashChunkSourceFactory = new DefaultDashChunkSource.Factory(
new DefaultHttpDataSourceFactory("ua", BANDWIDTH_METER));
DataSource.Factory manifestDataSourceFactory = new DefaultHttpDataSourceFactory("ua");
return new DashMediaSource.Factory(dashChunkSourceFactory, manifestDataSourceFactory).
createMediaSource(uri);
}
示例14: getMediaSource
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的package包/类
private MediaSource getMediaSource(boolean preview) {
Uri contentUri = Uri.parse(mDataSource);
int contentType = inferContentType(mDataSource);
switch (contentType) {
case C.TYPE_SS:
return new SsMediaSource(contentUri, new DefaultDataSourceFactory(mAppContext, null,
getHttpDataSourceFactory(preview)),
new DefaultSsChunkSource.Factory(getDataSourceFactory(preview)),
mainHandler, null);
case C.TYPE_DASH:
return new DashMediaSource(contentUri,
new DefaultDataSourceFactory(mAppContext, null,
getHttpDataSourceFactory(preview)),
new DefaultDashChunkSource.Factory(getDataSourceFactory(preview)),
mainHandler, null);
case C.TYPE_HLS:
return new HlsMediaSource(contentUri, getDataSourceFactory(preview), mainHandler, null);
case TYPE_RTMP:
RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory(null);
return new ExtractorMediaSource(contentUri, rtmpDataSourceFactory,
new DefaultExtractorsFactory(), mainHandler, null);
case C.TYPE_OTHER:
default:
return new ExtractorMediaSource(contentUri, getDataSourceFactory(preview),
new DefaultExtractorsFactory(), mainHandler, null);
}
}
示例15: create
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource; //导入方法依赖的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.");
}
}