当前位置: 首页>>代码示例>>Java>>正文


Java ExoPlayerFactory.newInstance方法代码示例

本文整理汇总了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();
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:21,代码来源:VpxPlaybackTest.java

示例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();
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:18,代码来源:OpusPlaybackTest.java

示例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();
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:18,代码来源:FlacPlaybackTest.java

示例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);
}
 
开发者ID:brianwernick,项目名称:ExoMedia,代码行数:22,代码来源:ExoMediaPlayer.java

示例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();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:20,代码来源:VpxPlaybackTest.java

示例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();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:OpusPlaybackTest.java

示例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();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:FlacPlaybackTest.java

示例8: createExoPlayerImpl

import com.google.android.exoplayer2.ExoPlayerFactory; //导入方法依赖的package包/类
protected ExoPlayer createExoPlayerImpl(Renderer[] renderers, TrackSelector trackSelector,
                                        LoadControl loadControl) {
  return ExoPlayerFactory.newInstance(renderers, trackSelector, loadControl);
}
 
开发者ID:CarGuo,项目名称:GSYVideoPlayer,代码行数:5,代码来源:SimpleExoPlayer2.java


注:本文中的com.google.android.exoplayer2.ExoPlayerFactory.newInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。