Implement pause on the libspotify backend by seeking to the resume position
This commit is contained in:
parent
1db7b84fe6
commit
250168ebba
@ -40,12 +40,13 @@ class LibspotifyPlaybackController(BasePlaybackController):
|
||||
return False
|
||||
|
||||
def _resume(self):
|
||||
return self._set_output_state('PLAYING')
|
||||
return self._seek(self.time_position)
|
||||
|
||||
def _seek(self, time_position):
|
||||
self._set_output_state('READY')
|
||||
result = self.backend.spotify.session.seek(time_position)
|
||||
self.backend.spotify.session.seek(time_position)
|
||||
self._set_output_state('PLAYING')
|
||||
return True
|
||||
|
||||
def _stop(self):
|
||||
result = self._set_output_state('READY')
|
||||
|
||||
@ -156,6 +156,7 @@ class GStreamerProcess(BaseProcess):
|
||||
:type state_name: string
|
||||
:rtype: :class:`True` or :class:`False`
|
||||
"""
|
||||
# XXX Setting state to PLAYING often returns False even if it works
|
||||
result = self.gst_pipeline.set_state(
|
||||
getattr(gst, 'STATE_' + state_name))
|
||||
if result == gst.STATE_CHANGE_SUCCESS:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user