Android Question VideoView MediaController Display

Rusty

Well-Known Member
Licensed User
Longtime User
Is there a way to display the mediacontroller on a videoview all the time as opposed to only when the user touches the view?
Thanks,
Rusty
 

Rusty

Well-Known Member
Licensed User
Longtime User
yes, please.
I've tried:
B4X:
MediaControllerVisible(VV, True)
...
Sub MediaControllerVisible(VidV As VideoView, visible As Boolean)
  Dim r As Reflector
  r.Target = VidV
  r.Target = r.GetField("mMediaController")
  If visible Then r.RunMethod("show") Else r.RunMethod("hide")
End Sub
and it doesn't work.
Thanks
Erel
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Hi Erel,
I have used the reflection to show the mediacontroller, but would like to move the controller to below wherever the videoview is located.
Right now it displays in the middle of the screen even though the panel containing the videoview is located somewhere else (upper right for example)
Is there a way to locate the mediacontroller with the videoview?
Thanks,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
I have tried putting it in a panel and putting it on the activity.
When it is on the activity, the mediacontroller is the width of the activity toward the bottom of the screen.
When it is in a panel, it is positioned at the bottom of the panel; the exact width of the panel, but centered in the screen.
So if the panel is 200dip wide and all the way to the right of the activity, the mediacontroller is in middle of the activity/screen and is 200dip wide.
I would very much like to have the mediacontroller appear to be part of the the videoview or the panel so that they stay together.
Is there any way to do this? Is there another lib that might allow this?
Thanks,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Erel,
i tried:
B4X:
Sub MediaControllerVisible(VidV As VideoView, visible As Boolean)
    Dim r As Reflector
    r.Target = VidV
    r.Target = r.GetField("mMediaController")
    If visible Then
        r.RunMethod2("setLeft", 100dip, "java.lang.int")
        r.RunMethod2("setTop", 100dip, "java.lang.int")
        r.RunMethod2("show", 0, "java.lang.int")
    Else
        r.RunMethod2("hide", 0, "java.lang.int")
    End If
End Sub

This doesn't seem to work. Have I done something incorrectly?
Thanks,
Rusty
 
Upvote 0
Top