Search in sources :

Example 1 with SimpleExoPlayer

use of com.google.android.exoplayer2.SimpleExoPlayer in project ExoPlayer by google.

the class ExoHostedTest method buildExoPlayer.

@SuppressWarnings("unused")
protected SimpleExoPlayer buildExoPlayer(HostActivity host, Surface surface, MappingTrackSelector trackSelector, DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
    SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(host, trackSelector, new DefaultLoadControl(), drmSessionManager, SimpleExoPlayer.EXTENSION_RENDERER_MODE_OFF, 0);
    player.setVideoSurface(surface);
    return player;
}
Also used : SimpleExoPlayer(com.google.android.exoplayer2.SimpleExoPlayer) DefaultLoadControl(com.google.android.exoplayer2.DefaultLoadControl)

Example 2 with SimpleExoPlayer

use of com.google.android.exoplayer2.SimpleExoPlayer in project PreviewSeekBar by rubensousa.

the class ExoPlayerManager method createPreviewPlayer.

private SimpleExoPlayer createPreviewPlayer() {
    TrackSelection.Factory videoTrackSelectionFactory = new WorstVideoTrackSelection.Factory();
    TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
    LoadControl loadControl = new PreviewLoadControl();
    SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(previewPlayerView.getContext(), trackSelector, loadControl);
    player.setPlayWhenReady(false);
    player.prepare(mediaSourceBuilder.getMediaSource(true));
    return player;
}
Also used : SimpleExoPlayer(com.google.android.exoplayer2.SimpleExoPlayer) LoadControl(com.google.android.exoplayer2.LoadControl) DefaultLoadControl(com.google.android.exoplayer2.DefaultLoadControl) TrackSelector(com.google.android.exoplayer2.trackselection.TrackSelector) DefaultTrackSelector(com.google.android.exoplayer2.trackselection.DefaultTrackSelector) ExoPlayerFactory(com.google.android.exoplayer2.ExoPlayerFactory) DefaultTrackSelector(com.google.android.exoplayer2.trackselection.DefaultTrackSelector) TrackSelection(com.google.android.exoplayer2.trackselection.TrackSelection) AdaptiveVideoTrackSelection(com.google.android.exoplayer2.trackselection.AdaptiveVideoTrackSelection)

Example 3 with SimpleExoPlayer

use of com.google.android.exoplayer2.SimpleExoPlayer in project PreviewSeekBar by rubensousa.

the class ExoPlayerManager method createFullPlayer.

private SimpleExoPlayer createFullPlayer() {
    TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveVideoTrackSelection.Factory(new DefaultBandwidthMeter());
    TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
    LoadControl loadControl = new DefaultLoadControl();
    SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(playerView.getContext(), trackSelector, loadControl);
    player.setPlayWhenReady(true);
    player.prepare(mediaSourceBuilder.getMediaSource(false));
    player.addListener(this);
    return player;
}
Also used : SimpleExoPlayer(com.google.android.exoplayer2.SimpleExoPlayer) DefaultBandwidthMeter(com.google.android.exoplayer2.upstream.DefaultBandwidthMeter) LoadControl(com.google.android.exoplayer2.LoadControl) DefaultLoadControl(com.google.android.exoplayer2.DefaultLoadControl) TrackSelector(com.google.android.exoplayer2.trackselection.TrackSelector) DefaultTrackSelector(com.google.android.exoplayer2.trackselection.DefaultTrackSelector) ExoPlayerFactory(com.google.android.exoplayer2.ExoPlayerFactory) DefaultTrackSelector(com.google.android.exoplayer2.trackselection.DefaultTrackSelector) TrackSelection(com.google.android.exoplayer2.trackselection.TrackSelection) AdaptiveVideoTrackSelection(com.google.android.exoplayer2.trackselection.AdaptiveVideoTrackSelection) DefaultLoadControl(com.google.android.exoplayer2.DefaultLoadControl)

Aggregations

DefaultLoadControl (com.google.android.exoplayer2.DefaultLoadControl)3 SimpleExoPlayer (com.google.android.exoplayer2.SimpleExoPlayer)3 ExoPlayerFactory (com.google.android.exoplayer2.ExoPlayerFactory)2 LoadControl (com.google.android.exoplayer2.LoadControl)2 AdaptiveVideoTrackSelection (com.google.android.exoplayer2.trackselection.AdaptiveVideoTrackSelection)2 DefaultTrackSelector (com.google.android.exoplayer2.trackselection.DefaultTrackSelector)2 TrackSelection (com.google.android.exoplayer2.trackselection.TrackSelection)2 TrackSelector (com.google.android.exoplayer2.trackselection.TrackSelector)2 DefaultBandwidthMeter (com.google.android.exoplayer2.upstream.DefaultBandwidthMeter)1