Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

切换至JZMediaExo内核 报 NullPointerException #484

Open
zippo88888888 opened this issue Apr 24, 2023 · 0 comments
Open

切换至JZMediaExo内核 报 NullPointerException #484

zippo88888888 opened this issue Apr 24, 2023 · 0 comments

Comments

@zippo88888888
Copy link

**什么jzvd版本
7.7.0

**什么播放器内核
JZMediaExo

**相关log是什么

Process: cn.jzvd.demo, PID: 21648
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.media.AudioManager.getStreamVolume(int)' on a null object reference
        at cn.jzvd.Jzvd.touchActionMove(Jzvd.java:470)
        at cn.jzvd.Jzvd.onTouch(Jzvd.java:403)
        at cn.jzvd.JzvdStd.onTouch(JzvdStd.java:323)
        at android.view.View.dispatchTouchEvent(View.java:14864)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2798)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:576)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1895)
        at android.app.Activity.dispatchTouchEvent(Activity.java:4353)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:534)
        at android.view.View.dispatchPointerEvent(View.java:15143)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6723)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6511)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5952)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6009)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5975)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6140)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5983)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6197)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5956)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6009)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5975)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5983)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5956)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8993)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8944)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8912)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9129)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:285)
        at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
        at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:257)
        at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:9075)
        at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:9215)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1188)
        at android.view.Choreographer.doCallbacks(Choreographer.java:978)
        at android.view.Choreographer.doFrame(Choreographer.java:887)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1170)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:211)
        at android.os.Looper.loop(Looper.java:300)
        at android.app.ActivityThread.main(ActivityThread.java:8237)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1046)

**demo是否有这个问题

**自己做了哪些修改

**如何操作复现
切换内核至JZMediaExo,播放后全屏,通过手势控制音量,闪退

**什么安卓版本,什么机型
Android12 小米12S

**截图或者视频说明情况

解决办法:

Jzvd 471行 增加空判定即可解决

if (mAudioManager == null) {
    mAudioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant