private void openFullscreenDialog() { ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView); mFullScreenDialog.addContentView(mExoPlayerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_fullscreen_skrink)); mExoPlayerFullscreen = true; mFullScreenDialog.show(); }
private void closeFullscreenDialog() { ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView); ((FrameLayout) findViewById(R.id.main_media_frame)).addView(mExoPlayerView); mExoPlayerFullscreen = false; mFullScreenDialog.dismiss(); mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(DetailedImageVideo.this, R.drawable .ic_fullscreen)); }
private void closeFullscreenDialog() { ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView); ((FrameLayout) findViewById(R.id.main_media_frame)).addView(mExoPlayerView); mExoPlayerFullscreen = false; mFullScreenDialog.dismiss(); mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_fullscreen_expand)); }
private void openFullscreenDialog() { ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView); mFullScreenDialog.addContentView(mExoPlayerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(DetailedImageVideo.this, R.drawable.ic_fullscreen_exit_white_24dp)); mExoPlayerFullscreen = true; mFullScreenDialog.show(); }
@Override protected void onResume() { super.onResume(); if (mExoPlayerView == null) { mExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.exoplayer); initFullscreenDialog(); initFullscreenButton(); String streamUrl = "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"; String userAgent = Util.getUserAgent(MainActivity.this, getApplicationContext().getApplicationInfo().packageName); DefaultHttpDataSourceFactory httpDataSourceFactory = new DefaultHttpDataSourceFactory(userAgent, null, DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS, DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS, true); DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(MainActivity.this, null, httpDataSourceFactory); Uri daUri = Uri.parse(streamUrl); mVideoSource = new HlsMediaSource(daUri, dataSourceFactory, 1, null, null); } initExoPlayer(); if (mExoPlayerFullscreen) { ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView); mFullScreenDialog.addContentView(mExoPlayerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_fullscreen_skrink)); mFullScreenDialog.show(); } }