Android Question Exoplayer GestureDetector

Discussion in 'Android Questions' started by Shivito1, Feb 19, 2018.

  1. Shivito1

    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.
    Code:
    GD.SetOnGestureListener(SimpleExoPlayerView1, "Gesture")
    I need a way to tell ExoPlayer to show the menu.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Try this:
    Code:
    Dim jo As JavaObject = SimpleExoPlayerView1
    jo.RunMethod(
    "showController"Null)
     
    Shivito1 likes this.
  3. Shivito1

    Shivito1 Active Member Licensed User

    Well i tried to place this here:
    Code:
    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:
    Code:
    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.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Tried here with this code:
    Code:
    Dim jo As JavaObject = SimpleExoPlayerView1
    jo.RunMethod(
    "showController"Null)
    Works fine.

    I guess that you are not using the latest version of ExoPlayer.
     
    Shivito1 likes this.
  5. Shivito1

    Shivito1 Active Member Licensed User

    I needed to update the arr files as well. Thank you for your time. :)
     
  6. shb777

    shb777 Active Member Licensed User

    What do you mean by menu. I get the pause, ff. nextvideo buttons. Is there more?
     
  7. Shivito1

    Shivito1 Active Member Licensed User

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice