forked from openlp/openlp
volume
This commit is contained in:
parent
415f79b9ed
commit
5f5c207b20
@ -313,11 +313,12 @@ class MainDisplay(DisplayWidget):
|
|||||||
Changes the volume of a running video
|
Changes the volume of a running video
|
||||||
"""
|
"""
|
||||||
log.debug(u'videoVolume %d' % volume)
|
log.debug(u'videoVolume %d' % volume)
|
||||||
|
vol = float(volume)/float(10)
|
||||||
if self.phononActive:
|
if self.phononActive:
|
||||||
self.audio.setVolume(volume)
|
self.audio.setVolume(vol)
|
||||||
else:
|
else:
|
||||||
self.frame.evaluateJavaScript(u'show_video(null, null, %s);' %
|
self.frame.evaluateJavaScript(u'show_video(null, null, %s);' %
|
||||||
str(float(volume)/float(10)))
|
str(vol))
|
||||||
|
|
||||||
def video(self, videoPath, volume, isBackground=False):
|
def video(self, videoPath, volume, isBackground=False):
|
||||||
"""
|
"""
|
||||||
@ -325,10 +326,11 @@ class MainDisplay(DisplayWidget):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'video')
|
log.debug(u'video')
|
||||||
self.loaded = True
|
self.loaded = True
|
||||||
|
vol = float(volume)/float(10)
|
||||||
if isBackground or not self.usePhonon:
|
if isBackground or not self.usePhonon:
|
||||||
js = u'show_video("init", "%s", %s, true); show_video("play");' % \
|
js = u'show_video("init", "%s", %s, true); show_video("play");' % \
|
||||||
(videoPath.replace(u'\\', u'\\\\'), \
|
(videoPath.replace(u'\\', u'\\\\'), \
|
||||||
str(float(volume)/float(10)))
|
str(vol))
|
||||||
self.frame.evaluateJavaScript(js)
|
self.frame.evaluateJavaScript(js)
|
||||||
else:
|
else:
|
||||||
self.phononActive = True
|
self.phononActive = True
|
||||||
@ -338,6 +340,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.mediaObject.play()
|
self.mediaObject.play()
|
||||||
self.webView.setVisible(False)
|
self.webView.setVisible(False)
|
||||||
self.videoWidget.setVisible(True)
|
self.videoWidget.setVisible(True)
|
||||||
|
self.audio.setVolume(vol)
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
def isLoaded(self):
|
def isLoaded(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user