Is there an event that gets fired when the currently playing media changes

Yes there is no specific event that I know of.

I would recommend implementing something like a mode that checkes if the source changed for specific events (frame-changed, after-graph-view-change…) and then send a custom internal event current-media-changed

This way you only have to check this once and every other mode can use it.