forked from openlp/openlp
Blank display at end of Video.
bzr-revno: 1387 Fixes: https://launchpad.net/bugs/657860
This commit is contained in:
commit
e109475154
@ -67,6 +67,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.isLive = live
|
||||
self.alertTab = None
|
||||
self.hideMode = None
|
||||
self.videoHide = False
|
||||
self.override = {}
|
||||
mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
|
||||
self.setWindowIcon(mainIcon)
|
||||
@ -90,7 +91,7 @@ class MainDisplay(DisplayWidget):
|
||||
"""
|
||||
Set up and build the output screen
|
||||
"""
|
||||
log.debug(u'Start setup for monitor %s (live = %s)' %
|
||||
log.debug(u'Start setup for monitor %s (live = %s)' %
|
||||
(self.screens.monitor_number, self.isLive))
|
||||
self.usePhonon = QtCore.QSettings().value(
|
||||
u'media/use phonon', QtCore.QVariant(True)).toBool()
|
||||
@ -110,6 +111,12 @@ class MainDisplay(DisplayWidget):
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
||||
self.videoStart)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'finished()'),
|
||||
self.videoFinished)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'tick(qint64)'),
|
||||
self.videoTick)
|
||||
log.debug(u'Setup webView for monitor %s' % self.screens.monitor_number)
|
||||
self.webView = QtWebKit.QWebView(self)
|
||||
self.webView.setGeometry(0, 0,
|
||||
@ -262,6 +269,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.displayImage(self.serviceItem.bg_image_bytes)
|
||||
else:
|
||||
self.displayImage(None)
|
||||
# clear the cache
|
||||
self.override = {}
|
||||
# Update the preview frame.
|
||||
if self.isLive:
|
||||
@ -349,6 +357,10 @@ class MainDisplay(DisplayWidget):
|
||||
self.mediaObject.stop()
|
||||
self.mediaObject.clearQueue()
|
||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(videoPath))
|
||||
# Need the timer to trigger set the trigger to 200ms
|
||||
# Value taken from web documentation.
|
||||
if self.serviceItem.start_time != 0:
|
||||
self.mediaObject.setTickInterval(200)
|
||||
self.mediaObject.play()
|
||||
self.webView.setVisible(False)
|
||||
self.videoWidget.setVisible(True)
|
||||
@ -363,8 +375,26 @@ class MainDisplay(DisplayWidget):
|
||||
Start the video at a predetermined point.
|
||||
"""
|
||||
if newState == Phonon.PlayingState:
|
||||
# set start time in milliseconds
|
||||
self.mediaObject.seek(self.serviceItem.start_time * 1000)
|
||||
|
||||
def videoFinished(self):
|
||||
"""
|
||||
Blank the Video when it has finished so the final frame is not left
|
||||
hanging
|
||||
"""
|
||||
self.videoStop()
|
||||
self.hideDisplay(HideMode.Blank)
|
||||
self.phononActive = False
|
||||
self.videoHide = True
|
||||
|
||||
def videoTick(self, tick):
|
||||
"""
|
||||
Triggered on video tick every 200 milli seconds
|
||||
Will be used to manage stop time later
|
||||
"""
|
||||
pass
|
||||
|
||||
def isWebLoaded(self):
|
||||
"""
|
||||
Called by webView event to show display is fully loaded
|
||||
@ -422,10 +452,12 @@ class MainDisplay(DisplayWidget):
|
||||
if u'video' in self.override:
|
||||
Receiver.send_message(u'video_background_replaced')
|
||||
self.override = {}
|
||||
# We have a different theme.
|
||||
elif self.override[u'theme'] != serviceItem.themedata.theme_name:
|
||||
Receiver.send_message(u'live_theme_changed')
|
||||
self.override = {}
|
||||
else:
|
||||
# replace the background
|
||||
background = self.imageManager. \
|
||||
get_image_bytes(self.override[u'image'])
|
||||
if self.serviceItem.themedata.background_filename:
|
||||
@ -441,6 +473,10 @@ class MainDisplay(DisplayWidget):
|
||||
# if was hidden keep it hidden
|
||||
if self.hideMode and self.isLive:
|
||||
self.hideDisplay(self.hideMode)
|
||||
# display hidden for video end we have a new item so must be shown
|
||||
if self.videoHide and self.isLive:
|
||||
self.videoHide = False
|
||||
self.showDisplay()
|
||||
self.__hideMouse()
|
||||
|
||||
def footer(self, text):
|
||||
|
Loading…
Reference in New Issue
Block a user