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


Java PlayerControl类代码示例

本文整理汇总了Java中com.google.android.exoplayer.util.PlayerControl的典型用法代码示例。如果您正苦于以下问题:Java PlayerControl类的具体用法?Java PlayerControl怎么用?Java PlayerControl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PlayerControl类属于com.google.android.exoplayer.util包,在下文中一共展示了PlayerControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preparePlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
private void preparePlayer() {

        SampleSource sampleSource =
                new FrameworkSampleSource(this, Uri.parse(mVideo.getContentUrl()), /* headers */ null, RENDERER_COUNT);

        // Build the track renderers
        videoRenderer = new MediaCodecVideoTrackRenderer(sampleSource, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT);
        TrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource);


        // Setup the player
        player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
        player.addListener(this);
        // Build the player controls
        mediaController.setMediaPlayer(new PlayerControl(player));
        mediaController.setEnabled(true);
        player.prepare(videoRenderer, audioRenderer);
    }
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:19,代码来源:PlayerActivity.java

示例2: preparePlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
private void preparePlayer() {

        SampleSource sampleSource =
                new FrameworkSampleSource(this, Uri.parse(mVideo.getContentUrl()), /* headers */ null, RENDERER_COUNT);

        // Build the track renderers
        videoRenderer = new MediaCodecVideoTrackRenderer(sampleSource, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT);
        TrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource);

        // Setup the player
        player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
        player.addListener(this);
        // Build the player controls
        mediaController.setMediaPlayer(new PlayerControl(player));
        mediaController.setEnabled(true);
        player.prepare(videoRenderer, audioRenderer);
    }
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:18,代码来源:PlayerActivity.java

示例3: DemoPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public DemoPlayer(RendererBuilder rendererBuilder) {
  this.rendererBuilder = rendererBuilder;
  //###AXT:: --> try to start the player without internal buffering. We do buffering in Raw Sample sources
  // player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
  player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, -1, -1);
  //###AXT:: <--
  player.addListener(this);
  playerControl = new PlayerControl(player);
  mainHandler = new Handler();
  listeners = new CopyOnWriteArrayList<Listener>();
  lastReportedPlaybackState = STATE_IDLE;
  rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
  selectedTracks = new int[RENDERER_COUNT];
  // Disable text initially.
  selectedTracks[TYPE_TEXT] = DISABLED_TRACK;
}
 
开发者ID:tyazid,项目名称:Exoplayer_VLC,代码行数:17,代码来源:DemoPlayer.java

示例4: DemoPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public DemoPlayer(RendererBuilder rendererBuilder) {
    this.rendererBuilder = rendererBuilder;
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
    player.addListener(this);
    playerControl = new PlayerControl(player);
    mainHandler = new Handler();
    listeners = new CopyOnWriteArrayList<>();
    lastReportedPlaybackState = STATE_IDLE;
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    // Enable text initially.
    player.setSelectedTrack(TYPE_TEXT, TRACK_DEFAULT);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:13,代码来源:DemoPlayer.java

示例5: VideoPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public VideoPlayer(RendererBuilder rendererBuilder) {
    this.rendererBuilder = rendererBuilder;
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
    player.addListener(this);
    playerControl = new PlayerControl(player);
    mainHandler = new Handler();
    listeners = new CopyOnWriteArrayList<>();
    lastReportedPlaybackState = STATE_IDLE;
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    // Disable text initially.
    player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:13,代码来源:VideoPlayer.java

示例6: DemoPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public DemoPlayer(RendererBuilder rendererBuilder) {
  this.rendererBuilder = rendererBuilder;
  player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
  player.addListener(this);
  playerControl = new PlayerControl(player);
  mainHandler = new Handler();
  listeners = new CopyOnWriteArrayList<>();
  lastReportedPlaybackState = STATE_IDLE;
  rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
  // Disable text initially.
  player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:13,代码来源:DemoPlayer.java

示例7: initPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
private void initPlayer() {
  player = ExoPlayer.Factory.newInstance(RENDERER_COUNT);
  playerControl = new PlayerControl(player);
  if (player != null) {
    rendererBuilder = getHpLibRendererBuilder();
    rendererBuilder.buildRenderers(this);
    mainHandler.postDelayed(updatePlayer, 200);
  }
}
 
开发者ID:karanvs,项目名称:ExVidPlayer,代码行数:10,代码来源:ExVidPlayerImp.java

示例8: ExoPlayerHelper

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public ExoPlayerHelper(RendererBuilder rendererBuilder) {
    this.rendererBuilder = rendererBuilder;
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
    player.addListener(this);
    playerControl = new PlayerControl(player);
    mainHandler = new Handler();
    listeners = new CopyOnWriteArrayList<>();
    lastReportedPlaybackState = STATE_IDLE;
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    // Disable text initially.
    player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
}
 
开发者ID:MimiReader,项目名称:mimi-reader,代码行数:13,代码来源:ExoPlayerHelper.java

示例9: MediaPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public MediaPlayer(Context context) {
  this.context = context;
  player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
  player.addListener(this);
  playerControl = new PlayerControl(player);
  mainHandler = new Handler();
  listeners = new CopyOnWriteArrayList<>();
  lastReportedPlaybackState = STATE_IDLE;
  rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
  selectedTracks = new int[RENDERER_COUNT];
  // Disable text initially.
  selectedTracks[TYPE_TEXT] = DISABLED_TRACK;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:14,代码来源:MediaPlayer.java

示例10: startBasicPlayback

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
private void startBasicPlayback() {
  player = ExoPlayer.Factory.newInstance(4);
  player.addListener(this);
  mediaController.setMediaPlayer(new PlayerControl(player));
  mediaController.setEnabled(true);
  ExtractorSampleSource sampleSource = new ExtractorSampleSource(
      contentUri,
      new DefaultUriDataSource(this, Util.getUserAgent(this, "ExoPlayerExtWebMDemo")),
      new DefaultAllocator(BUFFER_SEGMENT_SIZE), BUFFER_SEGMENT_SIZE * BUFFER_SEGMENT_COUNT,
      new WebmExtractor(), new FlacExtractor(), new OggExtractor());
  TrackRenderer videoRenderer =
      new LibvpxVideoTrackRenderer(sampleSource, true, handler, this, 50);
  if (useOpenGL) {
    player.sendMessage(videoRenderer, LibvpxVideoTrackRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER,
        vpxVideoSurfaceView);
    surfaceView.setVisibility(View.GONE);
  } else {
    player.sendMessage(
        videoRenderer, LibvpxVideoTrackRenderer.MSG_SET_SURFACE,
        surfaceView.getHolder().getSurface());
    vpxVideoSurfaceView.setVisibility(View.GONE);
  }
  TrackRenderer opusAudioTrackRenderer = new LibopusAudioTrackRenderer(sampleSource);
  TrackRenderer flacAudioTrackRenderer = new LibflacAudioTrackRenderer(sampleSource);
  TrackRenderer mediaCodecAudioTrackRenderer = new MediaCodecAudioTrackRenderer(sampleSource,
      MediaCodecSelector.DEFAULT);

  player.prepare(videoRenderer, opusAudioTrackRenderer, flacAudioTrackRenderer,
      mediaCodecAudioTrackRenderer);
  player.setPlayWhenReady(true);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:32,代码来源:PlayerActivity.java

示例11: onRenderersBuilt

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public void onRenderersBuilt(TrackRenderer[] renderers) {
  surfaceView.setVisibility(View.GONE);
  player = ExoPlayer.Factory.newInstance(renderers.length);
  player.addListener(this);
  mediaController.setMediaPlayer(new PlayerControl(player));
  mediaController.setEnabled(true);
  player.sendMessage(renderers[0], LibvpxVideoTrackRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER,
      vpxVideoSurfaceView);
  player.prepare(renderers);
  player.setPlayWhenReady(true);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:12,代码来源:PlayerActivity.java

示例12: Player

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public Player(RendererBuilder rendererBuilder) {
    this.rendererBuilder = rendererBuilder;
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 2000, 5000);
    player.addListener(this);
    playerControl = new PlayerControl(player);
    mainHandler = new Handler();
    listeners = new CopyOnWriteArrayList<>();
    lastReportedPlaybackState = STATE_IDLE;
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    // Disable text initially.
    player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
}
 
开发者ID:PJakcson,项目名称:Mediathek,代码行数:13,代码来源:Player.java

示例13: VideoPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public VideoPlayer(RendererBuilder rendererBuilder) {
    this.rendererBuilder = rendererBuilder;
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
    player.addListener(this);
    playerControl = new PlayerControl(player);
    mainHandler = new Handler();
    listeners = new CopyOnWriteArrayList<>();
    lastReportedPlaybackState = STATE_IDLE;
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    selectedTracks = new int[RENDERER_COUNT];
    // Disable text initially.
    selectedTracks[TYPE_TEXT] = DISABLED_TRACK;
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:14,代码来源:VideoPlayer.java

示例14: DemoPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
/**
 * Creates a {@link DemoPlayer} instance.
 */
public DemoPlayer(RendererBuilder rendererBuilder) {
  this.rendererBuilder = rendererBuilder;
  player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
  player.addListener(this);
  playerControl = new PlayerControl(player);
  mainHandler = new Handler();
  listeners = new CopyOnWriteArrayList<>();
  lastReportedPlaybackState = STATE_IDLE;
  rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
  // Disable text initially.
  player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
}
 
开发者ID:mkjensen,项目名称:danish-media-license,代码行数:16,代码来源:DemoPlayer.java

示例15: DemoPlayer

import com.google.android.exoplayer.util.PlayerControl; //导入依赖的package包/类
public DemoPlayer(RendererBuilder rendererBuilder) {
  this.rendererBuilder = rendererBuilder;
  player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
  player.addListener(this);
  playerControl = new PlayerControl(player);
  mainHandler = new Handler();
  listeners = new CopyOnWriteArrayList<Listener>();
  lastReportedPlaybackState = STATE_IDLE;
  rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
  selectedTracks = new int[RENDERER_COUNT];
  // Disable text initially.
  selectedTracks[TYPE_TEXT] = DISABLED_TRACK;
}
 
开发者ID:korrio,项目名称:AdvancedVideoView,代码行数:14,代码来源:DemoPlayer.java


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