This commit is contained in:
Tim Bentley 2012-09-07 17:58:13 +01:00
parent 4986fbdce8
commit 59ca1f5469
2 changed files with 21 additions and 14 deletions

View File

@ -287,7 +287,7 @@ class MediaController(object):
""" """
player.resize(display) player.resize(display)
def video(self, controller, file, muted, isBackground): def video(self, controller, file, muted, isBackground, hidden=False):
""" """
Loads and starts a video to run with the option of sound Loads and starts a video to run with the option of sound
""" """
@ -333,17 +333,26 @@ class MediaController(object):
if controller.isLive and not controller.media_info.is_background: if controller.isLive and not controller.media_info.is_background:
display.frame.evaluateJavaScript(u'show_video( \ display.frame.evaluateJavaScript(u'show_video( \
"setBackBoard", null, null, null,"visible");') "setBackBoard", null, null, null,"visible");')
# now start playing # now start playing - Preview is autoplay!
if controller.isLive and \ autoplay = False
(Settings().value(u'general/auto unblank', # Preview requested
QtCore.QVariant(False)).toBool() or \ if not controller.isLive:
controller.media_info.is_background) or not controller.isLive: autoplay = True
# Visible or background requested
elif not hidden or controller.media_info.is_background:
autoplay = True
# Unblank on load set
elif Settings().value(u'general/auto unblank',
QtCore.QVariant(False)).toBool():
autoplay = True
if autoplay:
if not self.video_play([controller]): if not self.video_play([controller]):
critical_error_message_box( if not self.video_play([controller]):
translate('MediaPlugin.MediaItem', 'Unsupported File'), critical_error_message_box(
unicode(translate('MediaPlugin.MediaItem', translate('MediaPlugin.MediaItem', 'Unsupported File'),
'Unsupported File'))) unicode(translate('MediaPlugin.MediaItem',
return False 'Unsupported File')))
return False
self.set_controls_visible(controller, True) self.set_controls_visible(controller, True)
log.debug(u'use %s controller' % self.curDisplayMediaPlayer[display]) log.debug(u'use %s controller' % self.curDisplayMediaPlayer[display])
return True return True

View File

@ -889,8 +889,6 @@ class SlideController(Controller):
self.display.buildHtml(self.serviceItem) self.display.buildHtml(self.serviceItem)
if serviceItem.is_media(): if serviceItem.is_media():
self.onMediaStart(serviceItem) self.onMediaStart(serviceItem)
if self.isLive:
Receiver.send_message('playbackPlay', [self, u'(False,)'])
self.slideSelected(True) self.slideSelected(True)
self.previewListWidget.setFocus() self.previewListWidget.setFocus()
if old_item: if old_item:
@ -1349,7 +1347,7 @@ class SlideController(Controller):
""" """
log.debug(u'SlideController onMediaStart') log.debug(u'SlideController onMediaStart')
file = os.path.join(item.get_frame_path(), item.get_frame_title()) file = os.path.join(item.get_frame_path(), item.get_frame_title())
self.mediaController.video(self, file, False, False) self.mediaController.video(self, file, False, False, self.hideMode())
if not self.isLive or self.mediaController.withLivePreview: if not self.isLive or self.mediaController.withLivePreview:
self.previewDisplay.show() self.previewDisplay.show()
self.slidePreview.hide() self.slidePreview.hide()