forked from openlp/openlp
Video starts to work
This commit is contained in:
parent
992cebb05c
commit
c10fc012a3
@ -205,6 +205,26 @@ class MainDisplay(DisplayWidget):
|
||||
log.debug(u'resetVideo')
|
||||
self.frame.findFirstElement('img').setAttribute(u'src',u'display: none;' )
|
||||
|
||||
def videoPlay(self):
|
||||
log.debug(u'videoPlay')
|
||||
self.frame.evaluateJavaScript("document.getElementById('video').play()")
|
||||
|
||||
def videoPause(self):
|
||||
log.debug(u'videoPause')
|
||||
self.frame.evaluateJavaScript("document.getElementById('video').pause()")
|
||||
|
||||
def videoStop(self):
|
||||
log.debug(u'videoStop')
|
||||
self.frame.evaluateJavaScript("document.getElementById('video').pause()")
|
||||
self.frame.evaluateJavaScript(
|
||||
"document.getElementById('video').style.visibility = 'hidden'")
|
||||
self.frame.evaluateJavaScript(
|
||||
"document.getElementById('image').style.visibility = 'visible'")
|
||||
|
||||
def videoVolume(self, amount):
|
||||
log.debug(u'videoVolume')
|
||||
self.frame.evaluateJavaScript("document.getElementById('video').volume = 0")
|
||||
|
||||
def video(self, videoPath, noSound=False):
|
||||
log.debug(u'video')
|
||||
self.frame.findFirstElement('video').setAttribute('src', videoPath)
|
||||
@ -212,9 +232,9 @@ class MainDisplay(DisplayWidget):
|
||||
"document.getElementById('video').style.visibility = 'visible'")
|
||||
self.frame.evaluateJavaScript(
|
||||
"document.getElementById('image').style.visibility = 'hidden'")
|
||||
self.frame.evaluateJavaScript("document.getElementById('video').play()")
|
||||
self.videoPlay()
|
||||
if noSound:
|
||||
self.frame.evaluateJavaScript("document.getElementById('video').volume = 0")
|
||||
self.videoVolume(0)
|
||||
|
||||
def loaded(self):
|
||||
"""
|
||||
|
@ -257,10 +257,10 @@ class SlideController(QtGui.QWidget):
|
||||
self.seekSlider.setObjectName(u'seekSlider')
|
||||
self.Mediabar.addToolbarWidget(
|
||||
u'Seek Slider', self.seekSlider)
|
||||
self.volumeSlider = Phonon.VolumeSlider()
|
||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
self.Mediabar.addToolbarWidget(u'Audio Volume', self.volumeSlider)
|
||||
self.volumeSlider = Phonon.VolumeSlider()
|
||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
self.Mediabar.addToolbarWidget(u'Audio Volume', self.volumeSlider)
|
||||
self.ControllerLayout.addWidget(self.Mediabar)
|
||||
# Build the Song Toolbar
|
||||
if isLive:
|
||||
@ -458,8 +458,6 @@ class SlideController(QtGui.QWidget):
|
||||
if item.is_media():
|
||||
self.Toolbar.setVisible(False)
|
||||
self.Mediabar.setVisible(True)
|
||||
#self.volumeSlider.setAudioOutput(
|
||||
# self.mainDisplay.videoDisplay.audio)
|
||||
|
||||
def enablePreviewToolBar(self, item):
|
||||
"""
|
||||
@ -927,7 +925,6 @@ class SlideController(QtGui.QWidget):
|
||||
if self.isLive:
|
||||
file = os.path.join(item.get_frame_path(), item.get_frame_title())
|
||||
self.display.video(file)
|
||||
#Receiver.send_message(u'videodisplay_start', item)
|
||||
else:
|
||||
self.mediaObject.stop()
|
||||
self.mediaObject.clearQueue()
|
||||
@ -943,7 +940,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
log.debug(u'SlideController onMediaPause')
|
||||
if self.isLive:
|
||||
Receiver.send_message(u'videodisplay_pause')
|
||||
self.display.videoPause()
|
||||
else:
|
||||
self.mediaObject.pause()
|
||||
|
||||
@ -953,7 +950,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
log.debug(u'SlideController onMediaPlay')
|
||||
if self.isLive:
|
||||
Receiver.send_message(u'videodisplay_play')
|
||||
self.display.videoPlay()
|
||||
else:
|
||||
self.SlidePreview.hide()
|
||||
self.video.show()
|
||||
@ -965,7 +962,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
log.debug(u'SlideController onMediaStop')
|
||||
if self.isLive:
|
||||
Receiver.send_message(u'videodisplay_stop')
|
||||
self.display.videoStop()
|
||||
else:
|
||||
self.mediaObject.stop()
|
||||
self.video.hide()
|
||||
|
Loading…
Reference in New Issue
Block a user