Fix player runtime and current position
This commit is contained in:
parent
ca43b19357
commit
74e87892d0
1 changed files with 3 additions and 3 deletions
|
@ -222,7 +222,7 @@ class Player(xbmc.Player):
|
|||
'playQueueVersion': playQueueVersion,
|
||||
'playQueueID': playQueueID,
|
||||
'playQueueItemID': playQueueItemID,
|
||||
'runtime': runtime * 1000,
|
||||
'runtime': runtime,
|
||||
'item_id': itemId,
|
||||
'refresh_id': refresh_id,
|
||||
'currentfile': currentFile,
|
||||
|
@ -477,7 +477,7 @@ class Player(xbmc.Player):
|
|||
|
||||
if currentPosition and runtime:
|
||||
try:
|
||||
percentComplete = currentPosition / int(runtime)
|
||||
percentComplete = float(currentPosition) / float(runtime)
|
||||
except ZeroDivisionError:
|
||||
# Runtime is 0.
|
||||
percentComplete = 0
|
||||
|
@ -549,7 +549,7 @@ class Player(xbmc.Player):
|
|||
args = {
|
||||
'ratingKey': itemId,
|
||||
'state': 'stopped', # 'stopped', 'paused', 'buffering', 'playing'
|
||||
'time': int(playTime) * 1000,
|
||||
'time': int(playTime),
|
||||
'duration': int(duration)
|
||||
}
|
||||
url = url + urlencode(args)
|
||||
|
|
Loading…
Reference in a new issue