muslimtv / flutter_playout

AV Playout in Flutter
BSD 3-Clause "New" or "Revised" License
154 stars 93 forks source link

java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference #75

Open huxaiphaer opened 3 years ago

huxaiphaer commented 3 years ago

Am running on some devices , and am getting this exception :

E/PlayerLayout( 4516): java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference E/PlayerLayout( 4516): at tv.mta.flutter_playout.video.PlayerLayout$2.run(PlayerLayout.java:480) E/PlayerLayout( 4516): at android.os.Handler.handleCallback(Handler.java:938) E/PlayerLayout( 4516): at android.os.Handler.dispatchMessage(Handler.java:99) E/PlayerLayout( 4516): at android.os.Looper.loop(Looper.java:223) E/PlayerLayout( 4516): at android.app.ActivityThread.main(ActivityThread.java:7656) E/PlayerLayout( 4516): at java.lang.reflect.Method.invoke(Native Method) E/PlayerLayout( 4516): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/PlayerLayout( 4516): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) D/PlayerLayout( 4516): onTime: [time=49] E/PlayerLayout( 4516): onTime:

KhuramKhalid commented 3 years ago

Does it cause the app to crash?

huxaiphaer commented 3 years ago

No, it doesn't, it only shows a black screen @KhuramKhalid

KhuramKhalid commented 3 years ago

This happens in the onTime method when the event sink isn't ready before the stream has started but as you see in the error above as well, on the second last line, the onTime method starts working as soon as event sink is available.

We can suppress the logging of this error but for now just ignore it.

pinkeshAubergine commented 3 years ago

@KhuramKhalid Why this issue has been closed? Do we have any potential fix for this or any workaround in order to mitigate this black screen issue?

KhuramKhalid commented 3 years ago

I don't think this error causes black screen since this is caught, printed to logs and ignored. Also since this method is called after the stream has started playing so whatever caused black screen; already happened.

However, you're right this needs further investigation so will keep this open until we've found a fix.

If possible, please provide a stream url that produces this issue and I will try finding a solution.

Zamorite commented 3 years ago

Here's an example. https://cdn3.wowza.com/1/T0hFeU5yelVCK0xl/c3NYVkpw/hls/live/playlist.m3u8

I hope it helps in the investigation, @KhuramKhalid.