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)
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
"""
@ -333,17 +333,26 @@ class MediaController(object):
if controller.isLive and not controller.media_info.is_background:
display.frame.evaluateJavaScript(u'show_video( \
"setBackBoard", null, null, null,"visible");')
# now start playing
if controller.isLive and \
(Settings().value(u'general/auto unblank',
QtCore.QVariant(False)).toBool() or \
controller.media_info.is_background) or not controller.isLive:
# now start playing - Preview is autoplay!
autoplay = False
# Preview requested
if 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]):
critical_error_message_box(
translate('MediaPlugin.MediaItem', 'Unsupported File'),
unicode(translate('MediaPlugin.MediaItem',
'Unsupported File')))
return 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

View File

@ -889,8 +889,6 @@ class SlideController(Controller):
self.display.buildHtml(self.serviceItem)
if serviceItem.is_media():
self.onMediaStart(serviceItem)
if self.isLive:
Receiver.send_message('playbackPlay', [self, u'(False,)'])
self.slideSelected(True)
self.previewListWidget.setFocus()
if old_item:
@ -1349,7 +1347,7 @@ class SlideController(Controller):
"""
log.debug(u'SlideController onMediaStart')
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:
self.previewDisplay.show()
self.slidePreview.hide()