There are callbacks in libVLC for that. Please refer to the API documentation.
Hi ,
I try to use python-vlc to create a player. And I also try to set log callback function. I get error about wrong type.
"argument 2: <class 'TypeError'>: wrong type"
Does anyone have idea?
the python code is :
class Player:
def __init__(self, *args):
def log_handler():
print("here output log")
if args:
print("here 1")
instance = vlc.Instance(*args)
self.media = instance.media_player_new()
else:
print("here 3")
#self.media = vlc.MediaPlayer()
instance = vlc.Instance()
instance.log_set(log_handler, None)
self.media = instance.media_player_new()
the error is :
here 3
Traceback (most recent call last):
File "G:\VideoLan_Py\vlc-py-test.py", line 132, in <module>
player = Player()
File "G:\VideoLan_Py\vlc-py-test.py", line 27, in __init__
instance.log_set(log_handler, None)
File "G:\Python_win\lib\site-packages\vlc.py", line 2049, in log_set
return libvlc_log_set(self, cb, data)
File "G:\Python_win\lib\site-packages\vlc.py", line 5171, in libvlc_log_set
return f(p_instance, cb, data)
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type