Java 类com.google.android.exoplayer.util.PlayerControl 实例源码

项目:android-tv-leanback    文件:PlayerActivity.java   
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);
    }
项目:android-tv-leanback    文件:PlayerActivity.java   
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);
    }
项目:android-tv-leanback    文件:PlayerActivity.java   
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);
    }
项目:android-tv-leanback    文件:PlayerActivity.java   
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);
    }
项目:Exoplayer_VLC    文件:DemoPlayer.java   
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;
}
项目:androidtv-sample    文件:DemoPlayer.java   
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);
}
项目:androidtv-sample    文件:VideoPlayer.java   
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);
}
项目:AndroidTvDemo    文件:DemoPlayer.java   
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);
}
项目:chilly    文件:VideoPlayer.java   
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);
}
项目:ShaddockVideoPlayer    文件:DemoPlayer.java   
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);
}
项目:android-tv-news    文件:VideoPlayer.java   
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);
}
项目:ExVidPlayer    文件:ExVidPlayerImp.java   
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);
  }
}
项目:mimi-reader    文件:ExoPlayerHelper.java   
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);
}
项目:ExoPlayerController    文件:DemoPlayer.java   
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);
}
项目:FriendsCameraSDK-android    文件:DemoPlayer.java   
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);
}
项目:talk-android    文件:DemoPlayer.java   
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);
}
项目:OKPlayer    文件:DemoPlayer.java   
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);
}
项目:miku    文件:MediaPlayer.java   
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;
}
项目:ExoPlayer-Demo    文件:PlayerActivity.java   
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);
}
项目:ExoPlayer-Demo    文件:PlayerActivity.java   
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);
}
项目:ExoPlayer-Demo    文件:DemoPlayer.java   
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);
}
项目:Mediathek    文件:Player.java   
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);
}
项目:sbs-android-tv    文件:VideoPlayer.java   
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;
}
项目:droidkaigi2016    文件:DemoPlayer.java   
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);
}
项目:danish-media-license    文件:DemoPlayer.java   
/**
 * 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);
}
项目:WliveTV    文件:DemoPlayer.java   
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);
}
项目:Android-Example-HLS-ExoPlayer    文件:DemoPlayer.java   
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);
}
项目:AdvancedVideoView    文件:DemoPlayer.java   
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;
}
项目:android-tv-leanback    文件:PlayerActivity.java   
private void preparePlayer() {
    Log.d(TAG, "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);
    player.prepare(videoRenderer, audioRenderer);
    if (mIsOnTv) {
        // This PlayerControl must stay in sync with PlaybackOverlayFragment.
        // We created methods such as PlaybackOverlayFragment.pressPlay() to request
        // that the fragment change the playback state. When the fragment receives a playback
        // request, it updates the UI and then calls a method in this activity according to
        // PlaybackOverlayFragment.OnPlayPauseClickedListener.
        playerControl = new PlayerControl(player);
    } else {
        // Build the player controls
        mediaController.setMediaPlayer(new PlayerControl(player));
        mediaController.setEnabled(true);
    }
    maybeStartPlayback();
}
项目:android-tv-leanback    文件:PlayerActivity.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_player);

    View root = findViewById(R.id.root);
    mediaController = new MediaController(this);

    //overscan safe on 1980 * 1080 TV
    mediaController.setPadding(48, 27, 48, 27);
    mediaController.setAnchorView(root);
    shutterView = findViewById(R.id.shutter);
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    SampleSource sampleSource =
            new FrameworkSampleSource(this, Uri.parse(url), /* 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);
}
项目:android-tv-leanback    文件:PlayerActivity.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_player);

    View root = findViewById(R.id.root);
    mediaController = new MediaController(this);

    //overscan safe on 1980 * 1080 TV
    mediaController.setPadding(48, 27, 48, 27);
    mediaController.setAnchorView(root);
    shutterView = findViewById(R.id.shutter);
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    SampleSource sampleSource =
            new FrameworkSampleSource(this, Uri.parse(url), /* 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);
}
项目:exoplayer-textureview    文件:Player.java   
public Player() {
    eventProxy = new EventProxy();
    eventProxy.setPlayer(this);
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
    player.addListener(this);
    playerControl = new PlayerControl(player);
    listeners = new CopyOnWriteArrayList<>();
    lastReportedPlaybackState = STATE_IDLE;
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    // Disable text initially.
    player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
}
项目:ExoPlayerWrapper    文件:ExoPlayerWrapper.java   
public ExoPlayerWrapper(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;
}
项目:android-exoplayer    文件:DemoPlayer.java   
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;
}
项目:android-exoplayer    文件:SimplePlayerActivity.java   
@Override
public void onResume() {
  super.onResume();
  // Setup the player
  player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
  player.addListener(this);
  player.seekTo(playerPosition);
  // Build the player controls
  mediaController.setMediaPlayer(new PlayerControl(player));
  mediaController.setEnabled(true);
  // Request the renderers
  callback = new RendererBuilderCallback();
  builder.buildRenderers(callback);
}
项目:exoPlayerHLS    文件:DemoPlayer.java   
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;
    selectedTracks = new int[RENDERER_COUNT];
  }
项目:iview-android-tv    文件:VideoPlayer.java   
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;
}
项目:Android-Birdcopy-Application    文件:FlyingPlayer.java   
public FlyingPlayer(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);
}
项目:SimpleExoPlayer    文件:DemoPlayer.java   
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);
}
项目:OkPlayer    文件:OkPlayer.java   
public OkPlayer(RendererBuilder rendererBuilder) {
    this.rendererBuilder = rendererBuilder;
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1500, 5000);
    player.addListener(this);
    playerControl = new PlayerControl(player);
    mainHandler = new Handler();
    listeners = new CopyOnWriteArrayList<>();
    //初始化播放器状态
    lastReportedPlaybackState = ExoPlayer.STATE_IDLE;
    //初始化渲染器状态
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    //初始化时禁用字幕渲染器的轨道
    player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
}