quit method

Future<void> quit()

Quits the MPV player

All event handlers are unbound (thus preventing the close event from restarting MPV
The socket is destroyed

Implementation

Future<void> quit() async {
  // Clear all the listeners of this module
  // this.mpvPlayer.removeAllListeners('close');
  // this.mpvPlayer.removeAllListeners('error');
  // this.mpvPlayer.removeAllListeners('message');
  _timepositionListenerId?.cancel();
  // send the quit message to MPV
  await command("quit", []);
  // Quit the socket
  socket.quit();
  // unset the running flag
  running = false;
}