import mpv from loguru import logger def mpv_log(loglevel, component, message): if loglevel == 'info': logger.info(f'{component} {message}') elif loglevel == 'error': logger.error(f'{component} {message}') player = mpv.MPV(log_handler=mpv_log, ytdl=False, player_operation_mode='pseudo-gui', script_opts='osc-layout=box,osc-seekbarstyle=bar,osc-deadzonesize=0,osc-minmousemove=3', input_default_bindings=True, input_vo_keyboard=True, osc=True)