本文整理汇总了Java中com.google.android.exoplayer2.ExoPlayerFactory.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ExoPlayerFactory.newInstance方法的具体用法?Java ExoPlayerFactory.newInstance怎么用?Java ExoPlayerFactory.newInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.exoplayer2.ExoPlayerFactory
的用法示例。
在下文中一共展示了ExoPlayerFactory.newInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
@Override
public void run() {
Looper.prepare();
LibvpxVideoRenderer videoRenderer = new LibvpxVideoRenderer(true, 0);
DefaultTrackSelector trackSelector = new DefaultTrackSelector();
player = ExoPlayerFactory.newInstance(new Renderer[] {videoRenderer}, trackSelector);
player.addListener(this);
ExtractorMediaSource mediaSource = new ExtractorMediaSource(
uri,
new DefaultDataSourceFactory(context, "ExoPlayerExtVp9Test"),
MatroskaExtractor.FACTORY,
null,
null);
player.sendMessages(new ExoPlayer.ExoPlayerMessage(videoRenderer,
LibvpxVideoRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER,
new VpxVideoSurfaceView(context)));
player.prepare(mediaSource);
player.setPlayWhenReady(true);
Looper.loop();
}
示例2: run
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
@Override
public void run() {
Looper.prepare();
LibopusAudioRenderer audioRenderer = new LibopusAudioRenderer();
DefaultTrackSelector trackSelector = new DefaultTrackSelector();
player = ExoPlayerFactory.newInstance(new Renderer[] {audioRenderer}, trackSelector);
player.addListener(this);
ExtractorMediaSource mediaSource = new ExtractorMediaSource(
uri,
new DefaultDataSourceFactory(context, "ExoPlayerExtOpusTest"),
MatroskaExtractor.FACTORY,
null,
null);
player.prepare(mediaSource);
player.setPlayWhenReady(true);
Looper.loop();
}
示例3: run
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
@Override
public void run() {
Looper.prepare();
LibflacAudioRenderer audioRenderer = new LibflacAudioRenderer();
DefaultTrackSelector trackSelector = new DefaultTrackSelector();
player = ExoPlayerFactory.newInstance(new Renderer[] {audioRenderer}, trackSelector);
player.addListener(this);
ExtractorMediaSource mediaSource = new ExtractorMediaSource(
uri,
new DefaultDataSourceFactory(context, "ExoPlayerExtFlacTest"),
MatroskaExtractor.FACTORY,
null,
null);
player.prepare(mediaSource);
player.setPlayWhenReady(true);
Looper.loop();
}
示例4: ExoMediaPlayer
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
public ExoMediaPlayer(@NonNull Context context) {
this.context = context;
bufferRepeater.setRepeaterDelay(BUFFER_REPEAT_DELAY);
bufferRepeater.setRepeatListener(new BufferRepeatListener());
mainHandler = new Handler();
ComponentListener componentListener = new ComponentListener();
RendererProvider rendererProvider = new RendererProvider(context, mainHandler, componentListener, componentListener, componentListener, componentListener);
rendererProvider.setDrmSessionManager(generateDrmSessionManager());
renderers = rendererProvider.generate();
adaptiveTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
trackSelector = new DefaultTrackSelector(adaptiveTrackSelectionFactory);
LoadControl loadControl = ExoMedia.Data.loadControl != null ? ExoMedia.Data.loadControl : new DefaultLoadControl();
player = ExoPlayerFactory.newInstance(renderers.toArray(new Renderer[renderers.size()]), trackSelector, loadControl);
player.addListener(this);
}
示例5: run
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
@Override
public void run() {
Looper.prepare();
LibvpxVideoRenderer videoRenderer = new LibvpxVideoRenderer(true, 0);
DefaultTrackSelector trackSelector = new DefaultTrackSelector();
player = ExoPlayerFactory.newInstance(new Renderer[] {videoRenderer}, trackSelector);
player.addListener(this);
MediaSource mediaSource =
new ExtractorMediaSource.Factory(
new DefaultDataSourceFactory(context, "ExoPlayerExtVp9Test"))
.setExtractorsFactory(MatroskaExtractor.FACTORY)
.createMediaSource(uri);
player.sendMessages(new ExoPlayer.ExoPlayerMessage(videoRenderer,
LibvpxVideoRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER,
new VpxVideoSurfaceView(context)));
player.prepare(mediaSource);
player.setPlayWhenReady(true);
Looper.loop();
}
示例6: run
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
@Override
public void run() {
Looper.prepare();
LibopusAudioRenderer audioRenderer = new LibopusAudioRenderer();
DefaultTrackSelector trackSelector = new DefaultTrackSelector();
player = ExoPlayerFactory.newInstance(new Renderer[] {audioRenderer}, trackSelector);
player.addListener(this);
MediaSource mediaSource =
new ExtractorMediaSource.Factory(
new DefaultDataSourceFactory(context, "ExoPlayerExtOpusTest"))
.setExtractorsFactory(MatroskaExtractor.FACTORY)
.createMediaSource(uri);
player.prepare(mediaSource);
player.setPlayWhenReady(true);
Looper.loop();
}
示例7: run
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
@Override
public void run() {
Looper.prepare();
LibflacAudioRenderer audioRenderer = new LibflacAudioRenderer();
DefaultTrackSelector trackSelector = new DefaultTrackSelector();
player = ExoPlayerFactory.newInstance(new Renderer[] {audioRenderer}, trackSelector);
player.addListener(this);
MediaSource mediaSource =
new ExtractorMediaSource.Factory(
new DefaultDataSourceFactory(context, "ExoPlayerExtFlacTest"))
.setExtractorsFactory(MatroskaExtractor.FACTORY)
.createMediaSource(uri);
player.prepare(mediaSource);
player.setPlayWhenReady(true);
Looper.loop();
}
示例8: createExoPlayerImpl
import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
protected ExoPlayer createExoPlayerImpl(Renderer[] renderers, TrackSelector trackSelector,
LoadControl loadControl) {
return ExoPlayerFactory.newInstance(renderers, trackSelector, loadControl);
}