bugfixing

This commit is contained in:
rimach 2011-12-01 19:07:15 +01:00
parent af63888e31
commit e627960391
4 changed files with 27 additions and 26 deletions

View File

@ -301,13 +301,6 @@ class MainDisplay(Display):
# clear the cache
self.override = {}
def isWebLoaded(self):
"""
Called by webView event to show display is fully loaded
"""
log.debug(u'Webloaded')
self.webLoaded = True
def preview(self):
"""
Generates a preview of the image displayed.

View File

@ -329,24 +329,20 @@ class MediaController(object):
display.frame.evaluateJavaScript(u'show_video( \
"setBackBoard", null, null, null,"visible");')
# now start playing
if self.video_play([controller], False):
self.video_pause([controller])
self.video_seek([controller, [0]])
if controller.isLive and \
(QtCore.QSettings().value(u'general/auto unblank',
QtCore.QVariant(False)).toBool() or \
controller.media_info.is_background == True) or \
controller.isLive == False:
self.video_play([controller])
self.set_controls_visible(controller, True)
log.debug(u'use %s controller' % self.curDisplayMediaPlayer[display])
return True
else:
critical_error_message_box(
translate('MediaPlugin.MediaItem', 'Unsupported File'),
unicode(translate('MediaPlugin.MediaItem',
'Unsupported File')))
return False
if controller.isLive and \
(QtCore.QSettings().value(u'general/auto unblank',
QtCore.QVariant(False)).toBool() or \
controller.media_info.is_background == True) or \
controller.isLive == False:
if not self.video_play([controller]):
critical_error_message_box(
translate('MediaPlugin.MediaItem', 'Unsupported File'),
unicode(translate('MediaPlugin.MediaItem',
'Unsupported File')))
return False
self.set_controls_visible(controller, True)
log.debug(u'use %s controller' % self.curDisplayMediaPlayer[display])
return True
def check_file_type(self, controller, display):
"""

View File

@ -326,11 +326,17 @@ class WebkitPlayer(MediaPlayer):
controller = display.controller
display.webLoaded = True
length = 0
start_time = 0
if self.state != MediaState.Paused and \
controller.media_info.start_time > 0:
start_time = controller.media_info.start_time
self.set_visible(display, True)
if controller.media_info.is_flash:
display.frame.evaluateJavaScript(u'show_flash("play");')
else:
display.frame.evaluateJavaScript(u'show_video("play");')
if start_time > 0:
self.seek(display, controller.media_info.start_time*1000)
# TODO add playing check and get the correct media length
controller.media_info.length = length
self.state = MediaState.Playing

View File

@ -87,6 +87,8 @@ class MediaMediaItem(MediaManagerItem):
self.videobackgroundReplaced)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'mediaitem_media_rebuild'), self.rebuild)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.displaySetup)
# Allow DnD from the desktop
self.listView.activateDnD()
@ -232,7 +234,11 @@ class MediaMediaItem(MediaManagerItem):
'Videos (%s);;Audio (%s);;%s (*)')) % (
u' '.join(self.plugin.video_extensions_list),
u' '.join(self.plugin.audio_extensions_list), UiStrings().AllFiles)
def displaySetup(self):
self.plugin.mediaController.setup_display( \
self.mediaController.previewDisplay)
def populateDisplayTypes(self):
"""