The top half of my app has a VideoView
with a MediaController
under it. The bottom half is an image with some buttons. While the MediaController
is visible, the buttons below are not clickable. It's like while the MediaController
is visible, it intercepts all other touch events, even if they are not within the bounds of the MediaController
.
Any idea around that?
You can check out my answer on overriding dispatchTouchEvent()
to pass clicks through MediaController
to an underlying Button
, but I'm guessing there's something wrong with the way you use MediaController. Can you post your layout?
UPD:
Actually, strike that. I've just taken a look at MediaController
code and it turns out it creates a new Window
for itself. That's why your clicks don't get dispatched — they're dispatched to another window. Also, as far as I can tell from the constructor code, if you inflate the MediaController via xml (i.e. use it in a layout file and then just find it by id from you code) — it won't create the extra Window
. That's weird, but I'm sure they had reasons for that.
So, the solution is to either try to use MediaController in a layout file or go with CommonsWare's solution. Please, let me know how it goes in case you give the xml thing a try.
Any idea around that?
Do not use MediaController
. Create your own controller UI that you pop up and display as needed. While this sample project may no longer completely work, as I have not touched in three years, it demonstrates having your own controller panel that pops up on a touch and then goes away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With