From 5f6e9f7c286d6ab1f26667139caff3c19d5c7bb6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 21 Jan 2013 06:46:38 +0000 Subject: [PATCH] Fix more tests --- openlp/core/ui/media/webkitplayer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/media/webkitplayer.py b/openlp/core/ui/media/webkitplayer.py index 58e7a40f5..ff21a879b 100644 --- a/openlp/core/ui/media/webkitplayer.py +++ b/openlp/core/ui/media/webkitplayer.py @@ -411,13 +411,13 @@ class WebkitPlayer(MediaPlayer): else: if display.frame.evaluateJavaScript(u'show_video("isEnded");') == 'true': self.stop(display) - (currentTime, ok) = display.frame.evaluateJavaScript(u'show_video("currentTime");') + currentTime = display.frame.evaluateJavaScript(u'show_video("currentTime");') # check if conversion was ok and value is not 'NaN' - if ok and currentTime != float('inf'): + if currentTime and currentTime != float('inf'): currentTime = int(currentTime * 1000) - (length, ok) = display.frame.evaluateJavaScript(u'show_video("length");') + length = display.frame.evaluateJavaScript(u'show_video("length");') # check if conversion was ok and value is not 'NaN' - if ok and length != float('inf'): + if length and length != float('inf'): length = int(length * 1000) if currentTime > 0: controller.media_info.length = length