diff --git a/src/controller/mainController.py b/src/controller/mainController.py index b650ba8..319dcaa 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -849,13 +849,16 @@ class Controller(object): self.search("me_audio").play_all() def menu_volume_down(self, *args, **kwargs): - player.player.volume = player.player.volume-2 + if player.player != None: + player.player.volume = player.player.volume-2 def menu_volume_up(self, *args, **kwargs): - player.player.volume = player.player.volume+2 + if player.player != None: + player.player.volume = player.player.volume+2 def menu_mute(self, *args, **kwargs): - player.player.volume = 0 + if player.player != None: + player.player.volume = 0 def seek_left(self, *args, **kwargs): pub.sendMessage("seek", ms=-500000) diff --git a/src/presenters/player.py b/src/presenters/player.py index 1f5e2c2..8b8b233 100644 --- a/src/presenters/player.py +++ b/src/presenters/player.py @@ -198,7 +198,7 @@ class audioPlayer(object): """ Check if the stream has reached the end of the file so it will play the next song. """ if self.message != None and self.message.is_playing == False and len(self.message) == self.message.position: volume_step = self.volume*0.15 - while self.stream.volume*100 < self.volume: + while self.stream != None and self.stream.volume*100 < self.volume: self.stream.volume = self.stream.volume+(volume_step/100) time.sleep(0.1) if self.stream != None and self.stream.is_playing == False and self.stopped == False and len(self.stream) == self.stream.position: