forked from openlp/openlp
Fix playback of linked audio. Fixes bug 1533280.
Fixes: https://launchpad.net/bugs/1533280
This commit is contained in:
parent
fb8ee9a546
commit
6b23a2224f
@ -576,6 +576,7 @@ class AudioPlayer(OpenLPMixin, QtCore.QObject):
|
||||
self.player = QtMultimedia.QMediaPlayer()
|
||||
self.playlist = QtMultimedia.QMediaPlaylist(self.player)
|
||||
self.volume_slider = None
|
||||
self.player.setPlaylist(self.playlist)
|
||||
self.player.positionChanged.connect(self._on_position_changed)
|
||||
|
||||
def __del__(self):
|
||||
@ -643,7 +644,7 @@ class AudioPlayer(OpenLPMixin, QtCore.QObject):
|
||||
if not isinstance(file_names, list):
|
||||
file_names = [file_names]
|
||||
for file_name in file_names:
|
||||
self.playlist.addMedia(QtCore.QUrl(file_name))
|
||||
self.playlist.addMedia(QtMultimedia.QMediaContent(QtCore.QUrl.fromLocalFile(file_name)))
|
||||
|
||||
def next(self):
|
||||
"""
|
||||
|
@ -1420,7 +1420,7 @@ class SlideController(DisplayController, RegistryProperties):
|
||||
|
||||
:param time: the time remaining
|
||||
"""
|
||||
seconds = self.display.audio_player.media_object.remainingTime() // 1000
|
||||
seconds = (self.display.audio_player.player.duration() - self.display.audio_player.player.position()) // 1000
|
||||
minutes = seconds // 60
|
||||
seconds %= 60
|
||||
self.audio_time_label.setText(' %02d:%02d ' % (minutes, seconds))
|
||||
|
Loading…
Reference in New Issue
Block a user