From fc0a26c74ee6da20f412123629150a0a23c2532e Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sun, 10 Jul 2022 15:14:32 +0200 Subject: [PATCH] Overwrite playlist when selecting a new video --- scripts/cast | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/cast b/scripts/cast index 726f516..3311b02 100755 --- a/scripts/cast +++ b/scripts/cast @@ -54,7 +54,6 @@ class Cast(wx.Frame): args=(), kwargs={}) self.m_vlc = Instance() - self.m_vlc_medialist = self.m_vlc.media_list_new() self.m_vlc_listplayer = self.m_vlc.media_list_player_new() self.m_chromecast_thr.start() self.m_sizer: wx.Sizer = wx.BoxSizer(wx.VERTICAL) @@ -347,8 +346,10 @@ class Cast(wx.Frame): :param uri str: the link to the video stream """ media = self.m_vlc.media_new(uri) - self.m_vlc_medialist.add_media(media) - self.m_vlc_listplayer.set_media_list(self.m_vlc_medialist) + medialist = self.m_vlc.media_list_new() + + medialist.add_media(media) + self.m_vlc_listplayer.set_media_list(medialist) self.m_sizer.Clear(delete_windows=True) self.m_sizer = wx.BoxSizer(wx.VERTICAL)