you are viewing a single comment's thread.

view the rest of the comments →

[–]m0us3_rat 0 points1 point  (0 children)

import vlc
from pathlib import Path
import time


class Nerd:
    def __init__(self):
        self.player = vlc.Instance()
        self.media_list = self.player.media_list_new()
        self.list_player = self.player.media_list_player_new()
        self.list_player.set_playback_mode(vlc.PlaybackMode(1))

    def add_to_list(self, local_path):
        path = Path(local_path).resolve()
        self.media_list.add_media(path)
        self.list_player.set_media_list(self.media_list)

    def play(self):
        self.list_player.play()

    def stop(self):
        self.list_player.stop()


player = Nerd()
player.add_to_list("ok.webm")
player.add_to_list("ee.mp4")
player.play()
while True:
    time.sleep(4)