use of com.google.android.exoplayer2.ui.SimpleExoPlayerView in project ExoPlayer by google.
the class PlayerActivity method onCreate.
// Activity lifecycle
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
shouldAutoPlay = true;
clearResumePosition();
mediaDataSourceFactory = buildDataSourceFactory(true);
mainHandler = new Handler();
if (CookieHandler.getDefault() != DEFAULT_COOKIE_MANAGER) {
CookieHandler.setDefault(DEFAULT_COOKIE_MANAGER);
}
setContentView(R.layout.player_activity);
View rootView = findViewById(R.id.root);
rootView.setOnClickListener(this);
debugRootView = (LinearLayout) findViewById(R.id.controls_root);
debugTextView = (TextView) findViewById(R.id.debug_text_view);
retryButton = (Button) findViewById(R.id.retry_button);
retryButton.setOnClickListener(this);
simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
simpleExoPlayerView.setControllerVisibilityListener(this);
simpleExoPlayerView.requestFocus();
}
use of com.google.android.exoplayer2.ui.SimpleExoPlayerView in project PreviewSeekBar by rubensousa.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SimpleExoPlayerView playerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
SimpleExoPlayerView previewPlayerView = (SimpleExoPlayerView) findViewById(R.id.previewPlayerView);
seekBar = (PreviewSeekBar) playerView.findViewById(R.id.exo_progress);
seekBarLayout = (PreviewSeekBarLayout) findViewById(R.id.previewSeekBarLayout);
seekBarLayout.setTintColorResource(R.color.colorPrimary);
seekBar.addOnSeekBarChangeListener(this);
exoPlayerManager = new ExoPlayerManager(playerView, previewPlayerView, seekBarLayout, getString(R.string.url_hls));
requestFullScreenIfLandscape();
}
Aggregations