I'm trying to create a custom Quick Look preview on macOS. I've found the Quick Look Preview Extension target, which is brilliant, and does most of the 'heavy' lifting, but I've run into a few problems.
I'm implementing a preview for MIDI files (which has been missing since 2009...) using AVMIDIPlayer.
-
The player keeps playing when the file is no longer selected! What's the mechanism for fixing that? Some sort of check that the view exists..?
-
I notice that the OS preview for audio files has a different interface for the Finder's preview column and for the QuickLook 'pop-up' window. Again, I can't see how you define different views for those two environments.
Is there any documentation that's specifically "Mac"? I can only find iOS stuff. (Same for third-party tutorials.)
@benwiggy This was the only way I could reliably start and stop audio feedback.
viewWillDisappear is not called immediately when you navigate away from your file, it looks like the OS keeps 2-3 preview controllers active as you navigate between files.
Here's the workaround that seem to work on Ventura: https://stackoverflow.com/a/76433758/1182910