Don't play music if codec not found
This commit is contained in:
parent
093264c351
commit
9c77096bfb
@ -227,12 +227,15 @@ class TetrArcade(TetrisLogic, arcade.Window):
|
||||
self.on_resize(self.init_width, self.init_height)
|
||||
|
||||
if self.play_music:
|
||||
self.music = pyglet.media.Player()
|
||||
playlist = itertools.cycle(
|
||||
pyglet.media.load(path)
|
||||
for path in MUSICS_PATHS
|
||||
)
|
||||
self.music.queue(playlist)
|
||||
try:
|
||||
self.music = pyglet.media.Player()
|
||||
playlist = itertools.cycle(
|
||||
pyglet.media.load(path)
|
||||
for path in MUSICS_PATHS
|
||||
)
|
||||
self.music.queue(playlist)
|
||||
except:
|
||||
self.play_music = False
|
||||
|
||||
def new_conf(self):
|
||||
self.conf["WINDOW"] = {"width": WINDOW_WIDTH, "height": WINDOW_HEIGHT, "fullscreen": False}
|
||||
|
Loading…
x
Reference in New Issue
Block a user