mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 07:07:58 +00:00
Fixed server music playback in new python versions
This commit is contained in:
@@ -601,8 +601,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.player.stop()
|
self.player.stop()
|
||||||
self.ui.action_play_music.setText("Play music")
|
self.ui.action_play_music.setText("Play music")
|
||||||
|
|
||||||
@asyncio.coroutine
|
async def play_music_at_time(self, t):
|
||||||
def play_music_at_time(self, t):
|
|
||||||
if self.player.mediaStatus() == QtMultimedia.QMediaPlayer.InvalidMedia:
|
if self.player.mediaStatus() == QtMultimedia.QMediaPlayer.InvalidMedia:
|
||||||
logging.error("Can't play media")
|
logging.error("Can't play media")
|
||||||
return
|
return
|
||||||
@@ -610,7 +609,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
logging.error("No media file")
|
logging.error("No media file")
|
||||||
return
|
return
|
||||||
self.player.stop()
|
self.player.stop()
|
||||||
yield from asyncio.sleep(t - time.time())
|
await asyncio.sleep(t - time.time())
|
||||||
logging.info("Playing music")
|
logging.info("Playing music")
|
||||||
self.player.play()
|
self.player.play()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user