Media List in Python VLC
Posted: 29 Jul 2016 07:05
Hello! I need to write a program in Python that will play video files from a folder in the VLC player, using the Linux OS. These files must be in the playlist. Code:
The problem is that after running the first video, the player closes. I think that it does not add the second video to the list.
How to add a video to a playlist in Python's binding for LibVLC?
Is there a utility function that plays all the videos in a folder?
UPD: I've created a playlist, and ran it to test in VLC player. Playing only the first video. After VLC is also closed. What is the problem?
Code: Select all
import vlc
mrl1 = '....1.3gp'
mrl2 = '....2.3gp'
Instance = vlc.Instance('--input-repeat=-1', '--fullscreen', '--mouse-hide-timeout=0')
MediaList = Instance.media_list_new()
MediaList.add_media(Instance.media_new(mrl2))
MediaList.add_media(Instance.media_new(mrl1))
list_player = Instance.media_list_player_new()
list_player.set_media_list(MediaList)
list_player.next()
player.play()
How to add a video to a playlist in Python's binding for LibVLC?
Is there a utility function that plays all the videos in a folder?
UPD: I've created a playlist, and ran it to test in VLC player. Playing only the first video. After VLC is also closed. What is the problem?