Use one master VLC instance

This commit is contained in:
Keith Edmunds 2021-04-25 00:01:32 +01:00
parent 2e41a673f4
commit 4f4e81ab75

View File

@ -15,6 +15,7 @@ class Music:
def __init__(self, max_volume=100):
self.fading = False
self.VLC = vlc.Instance()
self.player = None
self.track_path = None
self.max_volume = max_volume
@ -95,7 +96,7 @@ class Music:
self.track_path = path
self.player = vlc.MediaPlayer(path)
self.player = self.VLC.media_player_new(path)
self.player.audio_set_volume(self.max_volume)
self.player.play()