Android- Not able to Play audio in background service (startForeground) from the provided sample
From the answer provided on query (Android - Play audio in background service (startForeground))
Want to add more details on this to get clarification.
Member from JW team provided sample source (http://qa.jwplayer.com.s3.amazonaws.com/~george/BackgroundAudioService.zip) from the above link you can check details.
By using sample code from the given link I am getting crash from jwplayerview class and here I've given link for the crash log
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.longtailvideo.jwplayer.c.g.a(boolean)' on a null object reference
What else I tried... ?
Removed mPlayerView.onPause(); from onPause method of activity where its giving NPE. and also make some changes to bind and start service.
Here application is not crashing & Service starting in foreground also,but after playing audio in service and if reopen the app after that Player's pause & play method is not functioning from service.
Steps to reproduce Play and pause method not responding.
1)Play Audio from activity
2)Exit from application
3)Play & pause from notification (in this it will work)
4)Open application from notification tap or from launcher icon
5)Repeat Step 4 here(Play button from notification not responding)
Please provide details on above and guide on what I am missing or doing wrong. So I can proceed with the next process.