本文整理汇总了Java中com.google.android.exoplayer2.source.LoopingMediaSource类的典型用法代码示例。如果您正苦于以下问题:Java LoopingMediaSource类的具体用法?Java LoopingMediaSource怎么用?Java LoopingMediaSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoopingMediaSource类属于com.google.android.exoplayer2.source包,在下文中一共展示了LoopingMediaSource类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setupExoPlayer
import com.google.android.exoplayer2.source.LoopingMediaSource; //导入依赖的package包/类
private void setupExoPlayer() {
TrackSelection.Factory adaptiveTrackSelectionFactory =
new AdaptiveTrackSelection.Factory(new DefaultBandwidthMeter());
exoPlayer = ExoPlayerFactory.newSimpleInstance(
new DefaultRenderersFactory(this),
new DefaultTrackSelector(adaptiveTrackSelectionFactory),
new DefaultLoadControl());
pvVideoPreview.setPlayer(exoPlayer);
exoPlayer.setPlayWhenReady(true);
Uri uri = Uri.parse("asset:///sample_video.mp4");
MediaSource mediaSource = createMediaSource(this, uri);
LoopingMediaSource loopingMediaSource = new LoopingMediaSource(mediaSource);
exoPlayer.prepare(loopingMediaSource, true, false);
}
开发者ID:akexorcist,项目名称:Android-O-Feature,代码行数:17,代码来源:PictureInPictureActivity.java
示例2: initializePlayer
import com.google.android.exoplayer2.source.LoopingMediaSource; //导入依赖的package包/类
private void initializePlayer() {
if (player == null) {
TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveVideoTrackSelection.Factory(BANDWIDTH_METER);
trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
player = ExoPlayerFactory.newSimpleInstance(getContext(), trackSelector, new DefaultLoadControl());
player.addListener(this);
exoPlayerView.setPlayer(player);
if (isTimelineStatic) {
if (playerPosition == C.TIME_UNSET) {
player.seekToDefaultPosition(playerWindow);
} else {
player.seekTo(playerWindow, playerPosition);
}
}
audioBecomingNoisyReceiver.setListener(this);
setPlayWhenReady(!isPaused);
playerNeedsSource = true;
}
if (playerNeedsSource && srcUri != null) {
MediaSource mediaSource = buildMediaSource(srcUri, extension);
mediaSource = repeat ? new LoopingMediaSource(mediaSource) : mediaSource;
player.prepare(mediaSource, !shouldRestorePosition, true);
playerNeedsSource = false;
eventEmitter.loadStart();
loadVideoStarted = true;
}
}
开发者ID:12d,项目名称:react-native-videoplayer,代码行数:29,代码来源:ReactExoplayerView.java
示例3: getMediaSource
import com.google.android.exoplayer2.source.LoopingMediaSource; //导入依赖的package包/类
/***
* 获取视频数据源
* @return the media source
*/
MediaSource getMediaSource() {
if (loopingCount > 0) {
return new LoopingMediaSource(mediaSource, loopingCount);
}
return mediaSource;
}
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:11,代码来源:MediaSourceBuilder.java
示例4: buildRepeatOneMediaSource
import com.google.android.exoplayer2.source.LoopingMediaSource; //导入依赖的package包/类
private MediaSource buildRepeatOneMediaSource(DataSource.Factory srcFactory,
ExtractorsFactory extFactory) {
if (mQueue.isEmpty()) {
// We need to return an empty MediaSource (can't be null), so return a
// ConcatenatingMediaSource with nothing to concatenate
return new ConcatenatingMediaSource();
}
Uri uri = mQueue.get(mQueueIndex).getLocation();
MediaSource source = new ExtractorMediaSource(uri, srcFactory, extFactory, null, null);
return new LoopingMediaSource(source);
}
开发者ID:marverenic,项目名称:Jockey,代码行数:14,代码来源:QueuedExoPlayer.java
示例5: buildRepeatAllMediaSource
import com.google.android.exoplayer2.source.LoopingMediaSource; //导入依赖的package包/类
private MediaSource buildRepeatAllMediaSource(DataSource.Factory sourceFactory,
ExtractorsFactory extractorsFactory) {
MediaSource queue = buildNoRepeatMediaSource(sourceFactory, extractorsFactory);
return new LoopingMediaSource(queue);
}
开发者ID:marverenic,项目名称:Jockey,代码行数:7,代码来源:QueuedExoPlayer.java
示例6: CreateLoopSource
import com.google.android.exoplayer2.source.LoopingMediaSource; //导入依赖的package包/类
/**
* Creates a loop source. The child source will be played multiple times.
*Pass -1 to play it indefinitely.
*/
public Object CreateLoopSource (Object Source, int Count) {
return new LoopingMediaSource((MediaSource) Source, Count > 0 ? Count : Integer.MAX_VALUE);
}
开发者ID:AnywhereSoftware,项目名称:B4A_ExoPlayer,代码行数:8,代码来源:SimpleExoPlayerWrapper.java
注:本文中的com.google.android.exoplayer2.source.LoopingMediaSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论