bleonard252 / just_audio_mpv

MIT License
5 stars 3 forks source link

player continues on closure of linux GTK embedder #14

Closed jwinarske closed 6 months ago

jwinarske commented 6 months ago

Player should be destroyed on exit.

bleonard252 commented 6 months ago

Unfortunately, it's not possible to destroy anything on exit from the plugin. MPV is an external process, which Flutter doesn't kill it when it exits, and the plugin is not offered any sort of "before-the-program-exits" hook to use.

This will have to be worked around in the app by using something like window_manager to tell the player to stop when the app closes.

jwinarske commented 6 months ago

In the case of Linux when you spawn a process you can store the process id, which you can use later to issue kill -9 <pid>. It's a minor implementation detail.