Search in sources :

Example 1 with ExoPlayerUtil

use of in.testpress.course.util.ExoPlayerUtil in project android-sdk by testpress.

the class ExoPlayerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.testpress_exo_player_view);
    PlayerView playerView = findViewById(R.id.exo_player_view);
    int matchParent = ConstraintLayout.LayoutParams.MATCH_PARENT;
    playerView.setLayoutParams(new ConstraintLayout.LayoutParams(matchParent, matchParent));
    findViewById(R.id.exo_fullscreen_button).setVisibility(View.GONE);
    String url = getIntent().getStringExtra(VIDEO_URL);
    float startPosition = getIntent().getFloatExtra(START_POSITION, 0);
    float speedRate = getIntent().getFloatExtra(SPEED_RATE, 1);
    FrameLayout exoPlayerMainFrame = findViewById(R.id.exo_player_main_frame);
    exoPlayerUtil = new ExoPlayerUtil(this, exoPlayerMainFrame, url, startPosition, true, speedRate);
    exoPlayerUtil.openOnlyInFullScreen();
}
Also used : ExoPlayerUtil(in.testpress.course.util.ExoPlayerUtil) FrameLayout(android.widget.FrameLayout) PlayerView(com.google.android.exoplayer2.ui.PlayerView) ConstraintLayout(androidx.constraintlayout.widget.ConstraintLayout)

Aggregations

FrameLayout (android.widget.FrameLayout)1 ConstraintLayout (androidx.constraintlayout.widget.ConstraintLayout)1 PlayerView (com.google.android.exoplayer2.ui.PlayerView)1 ExoPlayerUtil (in.testpress.course.util.ExoPlayerUtil)1