I want to make a simple media player in python using the libvlc python bindings. I have downloaded the vlc.py and tested it. It works perfectly. So I started using vlc.py as a module in my code, here is my code:
import dev_vlc as vlc
import time
import os
vlcinstance = vlc.Instance()
myplayer = vlcinstance.media_player_new()
media = vlcinstance.media_new('test.mp3')
myplayer.set_media(media)
myplayer.play()
time.sleep(10)
When I run the above code instead of playing the audio file it throws the following error:
[034a2cb4] core libvlc error: No plugins found! Check your VLC installation.
Traceback (most recent call last):
File "C:/Users/krush/Documents/MyMediaPlayer/MyMediaPlayer.py", line 7, in <module>
myplayer = vlcinstance.media_player_new()
AttributeError: 'NoneType' object has no attribute 'media_player_new'
Can anyone please help me to fix and tell me where I went wrong.
Generally it is checking for libvlc.dll and other couple of dll files, which were not included in my installed version of VLC (may be due to some issues during installation or any other reason. IDK).
So copying the dlls to VLC installation folder or working directory of the project solved the problem.