code: def event_callback(self, *event_types):
          
          def register(callback):
              types = [MpvEventID.from_str(t) if isinstance(t, str) else t for t in event_types] or MpvEventID.ANY
              @wraps(callback)
              def wrapper(event, *args, **kwargs):
                  if event['event_id'] in types:
                      callback(event, *args, **kwargs)
              self._event_callbacks.append(wrapper)
              wrapper.unregister_mpv_events = partial(self.unregister_event_callback, wrapper)
              return wrapper
          return register
docs: Function decorator to register a blanket event callback for the given event types. Event types can be given
          as str (e.g.  'start-file'), integer or MpvEventID object.
  
          WARNING: Due to the way this is filtering events, this decorator cannot be chained with itself.
  
          To unregister the event callback, call its ``unregister_mpv_events`` function::
  
              player = mpv.MPV()
              @player.event_callback('shutdown')
              def my_handler(event):
                  print('It ded.')
  
              my_handler.unregister_mpv_events()