This commit is contained in:
Raoul Snyman 2013-03-13 09:08:58 +02:00
commit cee8d228f2
3 changed files with 9 additions and 3 deletions

View File

@ -440,7 +440,7 @@ class MediaController(object):
controller.media_info = MediaInfo()
controller.media_info.volume = 0
controller.media_info.file_info = QtCore.QFileInfo(service_item.get_frame_path())
display = controller._display
display = controller.preview_display
if not self._check_file_type(controller, display, service_item):
# Media could not be loaded correctly
critical_error_message_box(translate('MediaPlugin.MediaItem', 'Unsupported File'),

View File

@ -450,7 +450,7 @@ class WebkitPlayer(MediaPlayer):
currentTime = display.frame.evaluateJavaScript(u'show_flash("currentTime");')
length = display.frame.evaluateJavaScript(u'show_flash("length");')
else:
if display.frame.evaluateJavaScript(u'show_video("isEnded");') == 'true':
if display.frame.evaluateJavaScript(u'show_video("isEnded");'):
self.stop(display)
currentTime = display.frame.evaluateJavaScript(u'show_video("currentTime");')
# check if conversion was ok and value is not 'NaN'

View File

@ -5,7 +5,7 @@
import os
from unittest import TestCase
from PyQt4 import QtGui
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Registry, ImageManager, ScreenList
@ -43,6 +43,12 @@ class TestImageManager(TestCase):
# THEN returned record is a type of image
self.assertEqual(isinstance(image, QtGui.QImage), True, u'The returned object should be a QImage')
# WHEN: The image bytes are requested.
byte_array = self.image_manager.get_image_bytes(TEST_PATH, u'church.jpg')
# THEN: Type should be a byte array.
self.assertEqual(isinstance(byte_array, QtCore.QByteArray), True, u'The returned object should be a QByteArray')
# WHEN the image is retrieved has not been loaded
# THEN a KeyError is thrown
with self.assertRaises(KeyError) as context: