
Android - Play audio in background service (startForeground)
Hello,
I've tried JW player and need to just check below-mentioned things before proceeding to use in product and before going to license and finance matters.
How can we Play an Audio track in background service(If user exit from application)?
I tried something like (Creating an instance of JWPlayerView in my activity and bound service and given created instance of the JWPlayerView from Activity/Fragment to
Service where it should keep playing if user exit from the application.
But if service Stopped from Android System and somehow JWPlayerView instance is stopped or crashed then how can I recreate the instance of the JWPlayerView if user exit from the application?
if user exit from an application(onPause & service is bounded) than I am setting setBackgroundAudio(true) to JWPlayerView instance.
Is there any other class or player which can play without a view and use in background service.?
Or is there any sample which handles above-mentioned cases.?
Please provide any solution or suggestion on above.
Thanks.