I changed the response code bk138 to just change the color of the elements. Not the drawings themselves. This solution is compatible with older devices in combination with the v4 support library.
private void styleMediaController(View view) { if (view instanceof MediaController) { MediaController v = (MediaController) view; for (int i = 0; i < v.getChildCount(); i++) { styleMediaController(v.getChildAt(i)); } } else if (view instanceof LinearLayout) { LinearLayout ll = (LinearLayout) view; for (int i = 0; i < ll.getChildCount(); i++) { styleMediaController(ll.getChildAt(i)); } } else if (view instanceof SeekBar) { ((SeekBar) view) .getProgressDrawable() .mutate() .setColorFilter( getResources().getColor( R.color.MediaPlayerMeterColor), PorterDuff.Mode.SRC_IN); Drawable thumb = ((SeekBar) view).getThumb().mutate(); if (thumb instanceof android.support.v4.graphics.drawable.DrawableWrapper) {
Then just call
styleMediaController(myMC);
I had to call styleMediaController(myMC) in the OnPreparedListener VideoView to make it work. Otherwise, there are no children in the MediaController view.
OneWorld Mar 23 '16 at 8:37 2016-03-23 ββ08:37
source share