Python VLC MediaList - Inserting Media Last Updated : 29 Aug, 2020 Comments Improve Suggest changes Like Article Like Report In this article we will see how we can insert media in the MediaList 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. MediaList object contains the multiple media, in other words it has list of media which can be used with MediaListPlayer object to play these multiple media object. Inserting means we can add media at given index, we can add media to media list with the help of add_media method. In order to do this we will use insert_media method with the MediaList object Syntax : media_list.insert_media(media, index) Argument : It takes Media object and index as argument Return : It returns 0 on success, -1 if the media list is read-only Below is the implementation Python3 # importing vlc module import vlc # importing time module import time # creating a media player object media_player = vlc.MediaListPlayer() # creating Instance class object player = vlc.Instance() # creating a media list object media_list = vlc.MediaList() # creating a new media media = player.media_new("death_note.mkv") # adding media to media list media_list.add_media(media) # creating a new media media = player.media_new("1.mp4") # inserting media to media list at index 0 media_list.insert_media(media, 0) # setting media list to the media player media_player.set_media_list(media_list) # start playing video media_player.play() # wait so the video can be played for 5 seconds # irrespective for length of video time.sleep(5) Output : Another example Python3 # importing vlc module import vlc # importing time module import time # creating a media player object media_player = vlc.MediaListPlayer() # creating Instance class object player = vlc.Instance() # creating a media list object media_list = vlc.MediaList() # creating a new media media = player.media_new("1.mp4") # adding media to media list media_list.add_media(media) # creating a new media media = player.media_new("death_note.mkv") # inserting media to media list at index 0 media_list.insert_media(media, 0) # setting media list to the media player media_player.set_media_list(media_list) # start playing video media_player.play() # wait so the video can be played for 5 seconds # irrespective for length of video time.sleep(5) Output : Comment More infoAdvertise with us Next Article Python VLC MediaList - Inserting Media R rakshitarora Follow Improve Article Tags : Python Python vlc-mediaList Practice Tags : python Similar Reads Python VLC MediaList - Adding Media to it In this article we will see how we can add media to the MediaList 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. MediaList object contains the multiple media, in o 2 min read Python VLC MediaList - Getting Total Count of Media In this article we will see how we can get the total count of media in the MediaList 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. MediaList object contains the m 2 min read Python VLC MediaList - Getting Media object from it In this article we will see how we can get media object from the MediaList 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. MediaList object contains the multiple me 2 min read Python VLC MediaList - Getting Media at given Index In this article we will see how we can get the media at the given index in the MediaList 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. MediaList object contains t 2 min read Python VLC MediaPlayer â Getting Media Role In this article we will see how we can get role of the MediaPlayer 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. MediPlyer object is the basic object in vlc modul 2 min read Python VLC Instance - Creating MediaList Instance In this article we will see how we can create a MediaList Instance from the Instance class 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. Instance act as a main object of 2 min read Python VLC MediaListPlayer - Getting Media Player of it In this article we will see how we can get media player object from the MediaListPlayer 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 2 min read Python VLC - MediaList In this article we will see how we can create a MediaList 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. MediaList object contains the multiple media, in other wor 2 min read Python VLC MediaList - Getting Index of given item In this article we will see how we can get the index of given media object in the MediaList 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. MediaList object contain 2 min read Python VLC MediaPlayer - Getting Current media time In this article we will see how we can get current media time of the MediaPlayer 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. MediPlyer object is the basic objec 2 min read Like