Android Question Exoplayer GestureDetector

Shivito1

Active Member
Licensed User
My issue is Exoplayer menu options no longer pop up when I tap the player. This happens when I added the following to the SimpleExoplayerView1.
B4X:
GD.SetOnGestureListener(SimpleExoPlayerView1, "Gesture")

I need a way to tell ExoPlayer to show the menu.
 

Shivito1

Active Member
Licensed User
Try this:
B4X:
Dim jo As JavaObject = SimpleExoPlayerView1
jo.RunMethod("showController", Null)
Well i tried to place this here:
B4X:
Sub Gesture_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
    Dim jo As JavaObject = SimpleExoPlayerView1
    jo.RunMethod("showController", Null)
    If vidon == 1 Then
    End If
    Log("onTouch action=" & Action & ", x=" & X & ", y=" & Y & ", ev=" & MotionEvent)
    Return True 'True = Handle this touch event, False = Ignore it
End Sub
Error:
B4X:
main_gesture_ontouch (java line: 2192)
java.lang.RuntimeException: Method: showController not found in: com.google.android.exoplayer2.ui.SimpleExoPlayerView
    at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:366)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:119)
    at com.subreaderFree.main._gesture_ontouch(main.java:2192)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:163)
    at flm.b4a.gesturedetector.GestureDetectorForB4A$1.onTouch(GestureDetectorForB4A.java:99)
    at android.view.View.dispatchTouchEvent(View.java:10771)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2859)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2535)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2865)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2492)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2865)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2492)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2865)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2492)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2865)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2492)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2865)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2492)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2865)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2492)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2865)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2492)
    at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:579)
    at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1884)
    at android.app.Activity.dispatchTouchEvent(Activity.java:3240)
    at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:541)
    at android.view.View.dispatchPointerEvent(View.java:11004)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5124)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4976)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4501)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4554)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4520)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4653)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4528)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4710)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4501)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4554)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4520)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4528)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4501)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7022)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6947)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6908)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7132)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:323)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:6780)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Message longer than Log limit (4000). Message was truncated.
 
Upvote 0

Shivito1

Active Member
Licensed User
What do you mean by menu. I get the pause, ff. nextvideo buttons. Is there more?
No there is not more options unfortunately. when I added volume gestures the menu stopped appearing when I taped the screen so I needed to force it.
 
Upvote 0
Top