funkwlmpv/src/mpv_control.py

18 lines
573 B
Python
Raw Normal View History

2022-11-01 10:15:28 +00:00
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)