How to create custom / progressbar buttons for VideoView or MediaController?

I want to create a MediaPlayer with a custom design, but I cannot find how to do this. I create a streaming media player:

... mVideoView = (VideoView) findViewById(R.id.vedio_view); mBtnHttp = (Button) findViewById(R.id.btn_http); mBtnHttp.setOnClickListener(this); mMediaController = new MediaController(this); ... public void onClick(View v) { mVideoView.setVideoURI(Uri.parse(uri)); mVideoView.start(); mVideoView.requestFocus(); mMediaController.show(); } ... 

Please help me. I found many topics on stackoverflow, but the problem has not been resolved! Thanks in advance!

+4
source share
2 answers

Alternatively, you can use Exoplayer to play your videos.

 dependencies { [...] implementation 'com.google.android.exoplayer:exoplayer-core:2.7.3' implementation 'com.google.android.exoplayer:exoplayer-dash:2.7.3' implementation 'com.google.android.exoplayer:exoplayer-ui:2.7.3' } 

use PlayerView instead of watching the video and specify the path to custom_playback_control in the application: controller_layout_id attr

  <com.google.android.exoplayer2.ui.PlayerView android:id="@+id/video_view" android:layout_width="match_parent" android:layout_height="match_parent" app:controller_layout_id="@layout/custom_playback_control"/> 

https://codelabs.developers.google.com/codelabs/exoplayer-intro/#6

0
source

All Articles