ExoMedia and controls

时间:2015-11-12 11:15:10

标签: android exoplayer

I have an issue with ExoMedia implementation. Here is the repository of this very good video player library based on ExoPlayer.

https://github.com/brianwernick/ExoMedia

It solved my issues with streaming videos on some Android devices.

My only problem is, I can't change / control default media controllers. Original code was:

private VideoView contentView;

contentView.setVideoURI(Uri.parse("http://127.0.0.1:54852/"));
MediaController mediaControllerView = new MediaController(this);
mediaControllerView.setAnchorView(contentView);
contentView.setMediaController(mediaControllerView); 

It worked nice with nice default media controller.

It appeared that after changing it to VideoView to EMVideoView which uses ExoPlayer disabled setMediaController method.

private EMVideoView contentView;

contentView.setVideoURI(Uri.parse("http://127.0.0.1:54852/"));
MediaController mediaControllerView = new MediaController(this);
mediaControllerView.setAnchorView(contentView);
*contentView.setMediaController(mediaControllerView);* <-- no such method

EMVideoView doesn't have it implemented. I can only set to use default controls using

contentView.setDefaultControlsEnabled(true); 

If I set to false, no controls are shown, and unable to control playing. I couldn't find the way, how to add MediaController to EMVideoView.

The main reason of changing it is controllers used in EMVideoView have fully transparent background, and it's not visible on some videos at all. The standard ones from VideoView have nice grey background, and the best would use them.

0 个答案:

没有答案