I don't like this code. Think of the mediafile as  a third party plugin that can not change the core. If you need a method to hook into the set_active_slide function, you should add this hook into the api. If you don't find a way yet, then please open a Issue.

It is the same with the config-var 'projector_active_slide'. It is an 'private' variable that could change. For example if we add multiple projectors. So you should not use it directly.