Open IARI opened 5 years ago
Yess i should add more examples. You can call
player. stop() where player is your instance. Before you exit the application :)
You can also see the code of XR3Player which i have implemented everything and it is a JavaFX Media Player.
Keep me notified.
Hi and thanks for the quick reply :)
calling stop alone doesn't do it for me: the process keeps running. Currently I'm getting both private executors from the class via reflection like this (sorry, it's kotlin code)
init {
appCtl.exitHandler.add {
log.info("Exit handler")
stop()
getExecutorService("streamPlayerExecutorService").shutdownNow()
getExecutorService("eventsExecutorService").shutdownNow()
}
}
private fun getExecutorService(fieldname: String) =
StreamPlayer::class.java.getDeclaredField(fieldname).run {
isAccessible = true
get(streamPlayer) as ExecutorService
}
player. stop() doesn't work really? Like i am using it in my own app. How is that possible. Ah yes yes. You can exit your application with System.exit(-1) or 0
Executors shutdown isn't promising to terminate just the second you call it.
Maybe some wants the thread to be automatically halted right after all other threads finished. If the two (is it correct?) threads were daemon it would be helpful, so maybe adding daemon-thread option is one way.
Yes that's a good idea 💡. Hm i am thinking how to code it m
First of all thanks for the work on this project - works wonderfully.
I used it in a JavaFX application and noticed, that after calling Platform.exit(), the process was still running. It seems like the StreamPlayer class uses Java8 ExecutorService, but never shuts it down.
How about adding a public method to shut down the ExecutorServices ?