Use a media keyboard with your pHat Beat, can it be done?

Not too bad! This is looking incredibly close to being functional from what I can tell at a glance :D

Note that if vlc.connect() fails then the code from if dev.is_kernel_driver_active onwards will still be run and the program will fail when a button is pressed.

It looks like you need to import sys at the top of your code too, I missed that when I was skimming through looking for the imports that the VLC class needed.