I have this in a convenience abstraction I made for midifile: [c_midiplay].
I feel that midifile is low-level on purpose which allows you to make abstractions depending on the use case, so I don't know if I agree for the need for yet another object, however it's your time, so enjoy!
Now one just needs to click on a toggle to start/stop playing the midifile, no need to harvest metadata to find out a tick tempo value to feed a metro object.