Update player location on server seek.
This commit is contained in:
parent
4c7c526b8d
commit
094a204d9e
@ -175,10 +175,15 @@ class SyncplayClient(object):
|
|||||||
seeked = _playerDiff > constants.SEEK_THRESHOLD and _globalDiff > constants.SEEK_THRESHOLD
|
seeked = _playerDiff > constants.SEEK_THRESHOLD and _globalDiff > constants.SEEK_THRESHOLD
|
||||||
return pauseChange, seeked
|
return pauseChange, seeked
|
||||||
|
|
||||||
|
def _ignoringPlayerStatus(self, cookie=None):
|
||||||
|
if cookie is None:
|
||||||
|
cookie = time.time()
|
||||||
|
return cookie < self._lastPlayerCommand + self._config['playerCommandDelay']
|
||||||
|
|
||||||
def updatePlayerStatus(self, paused, position, cookie=None):
|
def updatePlayerStatus(self, paused, position, cookie=None):
|
||||||
# Ignore status report if the cookie is stale
|
# Ignore status report if the cookie is stale
|
||||||
if cookie is not None and \
|
if self._ignoringPlayerStatus(cookie):
|
||||||
cookie < self._lastPlayerCommand + self._config['playerCommandDelay']:
|
self.ui.showDebugMessage('Ignoring stale player status with cookie {}'.format(cookie))
|
||||||
return
|
return
|
||||||
|
|
||||||
position -= self.getUserOffset()
|
position -= self.getUserOffset()
|
||||||
@ -515,6 +520,7 @@ class SyncplayClient(object):
|
|||||||
def setPosition(self, position):
|
def setPosition(self, position):
|
||||||
if self._lastPlayerUpdate:
|
if self._lastPlayerUpdate:
|
||||||
self._lastPlayerUpdate = time.time()
|
self._lastPlayerUpdate = time.time()
|
||||||
|
self._playerPosition = position
|
||||||
position += self.getUserOffset()
|
position += self.getUserOffset()
|
||||||
if self._player and self.userlist.currentUser.file:
|
if self._player and self.userlist.currentUser.file:
|
||||||
if position < 0:
|
if position < 0:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user