Android Question User-agent exoplayer

MAGAREY

Member
Licensed User
Longtime User
Hi everyone, i tried to change the user-agent of exoplayer i tried with the code that error wrote here https://www.b4x.com/android/forum/threads/exoplayer-user-agent.86695/#post-548886
Without succes, i don't know if i have to initialize the view or create a layout with the designer.

B4X:
Error occurred on line: 190 (reproductor2)
java.lang.ClassCastException: com.prueba.tv.reproductor2$MySimpleExoPlayerWrapper cannot be cast to com.google.android.exoplayer2.ui.SimpleExoPlayerView
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setPlayer(SimpleExoPlayerViewWrapper.java:80)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
    at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:19)
    at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:240)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
    at anywheresoftware.b4a.BA$2.run(BA.java:360)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
This error ocurred when pass the líne simpleplayerview.player=player


This one ocurred when i tried to add the view by code
B4X:
java.lang.ClassCastException: com.prueba.tv.reproductor2$MySimpleExoPlayerWrapper cannot be cast to android.view.View
    at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:73)
    at anywheresoftware.b4a.objects.ViewWrapper.Initialize(ViewWrapper.java:67)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
    at com.prueba.tv.reproductor2.afterFirstLayout(reproductor2.java:106)
    at com.prueba.tv.reproductor2.access$000(reproductor2.java:21)
    at com.prueba.tv.reproductor2$WaitForLayout.run(reproductor2.java:84)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776

Any advice.?
 
Top