In this article we will see how we can create a MediaListPlayer class object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. Media list player is used to play multiple media in a row for example playing a series, instead of taking single media it accepts media list. Its working is almost similar like the MediaPlayer object but it is capable of playing list of media.
In order to do this we will use
mediaListPlayermethodSyntax : vlc.mediaListPlayer()
Argument : It takes no argument
Return : It returns MediaListPlayer object
Below is the implementation
# importing vlc moduleimport vlc # importing time moduleimport time # creating a media player objectmedia_player = vlc.MediaListPlayer() # creating Instance class objectplayer = vlc.Instance() # creating a new media listmedia_list = player.media_list_new() # creating a new mediamedia = player.media_new("death_note.mkv") # adding media to media listmedia_list.add_media(media) # setting media list to the media playermedia_player.set_media_list(media_list) # start playing videomedia_player.play() |
Output :
Another example
Below is the implementation
# importing vlc moduleimport vlc # importing time moduleimport time # creating a media player objectmedia_player = vlc.MediaListPlayer() # creating Instance class objectplayer = vlc.Instance() # creating a new media listmedia_list = player.media_list_new() # creating a new mediamedia = player.media_new("1.mp4") # adding media to media listmedia_list.add_media(media) # setting media list to the media playermedia_player.set_media_list(media_list) # start playing videomedia_player.play() |
Output :
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course


