forked from openlp/openlp
Head r1908
This commit is contained in:
commit
086a32d7b1
@ -58,15 +58,15 @@ class MediaController(object):
|
|||||||
QtCore.QObject.connect(self.timer,
|
QtCore.QObject.connect(self.timer,
|
||||||
QtCore.SIGNAL("timeout()"), self.video_state)
|
QtCore.SIGNAL("timeout()"), self.video_state)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_playback_play'), self.video_play)
|
QtCore.SIGNAL(u'playbackPlay'), self.video_play)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_playback_pause'), self.video_pause)
|
QtCore.SIGNAL(u'playbackPause'), self.video_pause)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_playback_stop'), self.video_stop)
|
QtCore.SIGNAL(u'playbackStop'), self.video_stop)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'seek_slider'), self.video_seek)
|
QtCore.SIGNAL(u'seekSlider'), self.video_seek)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'volume_slider'), self.video_volume)
|
QtCore.SIGNAL(u'volumeSlider'), self.video_volume)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_hide'), self.video_hide)
|
QtCore.SIGNAL(u'media_hide'), self.video_hide)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -160,6 +160,11 @@ class MediaController(object):
|
|||||||
if self.curDisplayMediaPlayer[display] \
|
if self.curDisplayMediaPlayer[display] \
|
||||||
.state == MediaState.Playing:
|
.state == MediaState.Playing:
|
||||||
return
|
return
|
||||||
|
# no players are active anymore
|
||||||
|
for display in self.curDisplayMediaPlayer.keys():
|
||||||
|
if self.curDisplayMediaPlayer[display] \
|
||||||
|
.state != MediaState.Paused:
|
||||||
|
display.controller.seekSlider.setSliderPosition(0)
|
||||||
self.timer.stop()
|
self.timer.stop()
|
||||||
|
|
||||||
def get_media_display_css(self):
|
def get_media_display_css(self):
|
||||||
@ -452,6 +457,7 @@ class MediaController(object):
|
|||||||
display.frame.evaluateJavaScript(u'show_blank("black");')
|
display.frame.evaluateJavaScript(u'show_blank("black");')
|
||||||
self.curDisplayMediaPlayer[display].stop(display)
|
self.curDisplayMediaPlayer[display].stop(display)
|
||||||
self.curDisplayMediaPlayer[display].set_visible(display, False)
|
self.curDisplayMediaPlayer[display].set_visible(display, False)
|
||||||
|
controller.seekSlider.setSliderPosition(0)
|
||||||
|
|
||||||
def video_volume(self, msg):
|
def video_volume(self, msg):
|
||||||
"""
|
"""
|
||||||
|
@ -192,6 +192,9 @@ class PhononPlayer(MediaPlayer):
|
|||||||
display.phononWidget.setVisible(status)
|
display.phononWidget.setVisible(status)
|
||||||
|
|
||||||
def update_ui(self, display):
|
def update_ui(self, display):
|
||||||
|
if display.mediaObject.state() == Phonon.PausedState and \
|
||||||
|
self.state != MediaState.Paused:
|
||||||
|
self.stop(display)
|
||||||
controller = display.controller
|
controller = display.controller
|
||||||
if controller.media_info.end_time > 0:
|
if controller.media_info.end_time > 0:
|
||||||
if display.mediaObject.currentTime() > \
|
if display.mediaObject.currentTime() > \
|
||||||
|
@ -83,7 +83,7 @@ VIDEO_EXT = [
|
|||||||
|
|
||||||
class VlcPlayer(MediaPlayer):
|
class VlcPlayer(MediaPlayer):
|
||||||
"""
|
"""
|
||||||
A specialised version of the MediaPlayer class, which provides a QtWebKit
|
A specialised version of the MediaPlayer class, which provides a VLC
|
||||||
display.
|
display.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -210,6 +210,8 @@ class VlcPlayer(MediaPlayer):
|
|||||||
display.vlcWidget.setVisible(status)
|
display.vlcWidget.setVisible(status)
|
||||||
|
|
||||||
def update_ui(self, display):
|
def update_ui(self, display):
|
||||||
|
if display.vlcMedia.get_state() == vlc.State.Ended:
|
||||||
|
self.stop(display)
|
||||||
controller = display.controller
|
controller = display.controller
|
||||||
if controller.media_info.end_time > 0:
|
if controller.media_info.end_time > 0:
|
||||||
if display.vlcMediaPlayer.get_time() > \
|
if display.vlcMediaPlayer.get_time() > \
|
||||||
|
@ -126,7 +126,7 @@ VIDEO_JS = u"""
|
|||||||
vid.src = '';
|
vid.src = '';
|
||||||
vid2.src = '';
|
vid2.src = '';
|
||||||
break;
|
break;
|
||||||
case 'length':
|
case 'length':
|
||||||
return vid.duration;
|
return vid.duration;
|
||||||
case 'currentTime':
|
case 'currentTime':
|
||||||
return vid.currentTime;
|
return vid.currentTime;
|
||||||
@ -134,6 +134,8 @@ VIDEO_JS = u"""
|
|||||||
// doesnt work currently
|
// doesnt work currently
|
||||||
vid.currentTime = varVal;
|
vid.currentTime = varVal;
|
||||||
break;
|
break;
|
||||||
|
case 'isEnded':
|
||||||
|
return vid.ended;
|
||||||
case 'setVisible':
|
case 'setVisible':
|
||||||
vid.style.visibility = varVal;
|
vid.style.visibility = varVal;
|
||||||
break;
|
break;
|
||||||
@ -211,6 +213,8 @@ FLASH_JS = u"""
|
|||||||
case 'seek':
|
case 'seek':
|
||||||
// flashMovie.GotoFrame(varVal);
|
// flashMovie.GotoFrame(varVal);
|
||||||
break;
|
break;
|
||||||
|
case 'isEnded':
|
||||||
|
return false;//TODO check flash end
|
||||||
case 'setVisible':
|
case 'setVisible':
|
||||||
text.style.visibility = varVal;
|
text.style.visibility = varVal;
|
||||||
break;
|
break;
|
||||||
@ -356,7 +360,6 @@ class WebkitPlayer(MediaPlayer):
|
|||||||
display.frame.evaluateJavaScript(u'show_flash("stop");')
|
display.frame.evaluateJavaScript(u'show_flash("stop");')
|
||||||
else:
|
else:
|
||||||
display.frame.evaluateJavaScript(u'show_video("stop");')
|
display.frame.evaluateJavaScript(u'show_video("stop");')
|
||||||
controller.seekSlider.setSliderPosition(0)
|
|
||||||
self.state = MediaState.Stopped
|
self.state = MediaState.Stopped
|
||||||
|
|
||||||
def volume(self, display, vol):
|
def volume(self, display, vol):
|
||||||
@ -408,6 +411,9 @@ class WebkitPlayer(MediaPlayer):
|
|||||||
length = display.frame.evaluateJavaScript( \
|
length = display.frame.evaluateJavaScript( \
|
||||||
u'show_flash("length");').toInt()[0]
|
u'show_flash("length");').toInt()[0]
|
||||||
else:
|
else:
|
||||||
|
if display.frame.evaluateJavaScript( \
|
||||||
|
u'show_video("isEnded");').toString() == 'true':
|
||||||
|
self.stop(display)
|
||||||
(currentTime, ok) = display.frame.evaluateJavaScript( \
|
(currentTime, ok) = display.frame.evaluateJavaScript( \
|
||||||
u'show_video("currentTime");').toFloat()
|
u'show_video("currentTime");').toFloat()
|
||||||
# check if conversion was ok and value is not 'NaN'
|
# check if conversion was ok and value is not 'NaN'
|
||||||
|
@ -186,7 +186,7 @@ class SlideController(Controller):
|
|||||||
tooltip=translate('OpenLP.SlideController', 'Move to next.'),
|
tooltip=translate('OpenLP.SlideController', 'Move to next.'),
|
||||||
shortcuts=[QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown],
|
shortcuts=[QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown],
|
||||||
context=QtCore.Qt.WidgetWithChildrenShortcut,
|
context=QtCore.Qt.WidgetWithChildrenShortcut,
|
||||||
category=self.category, triggers=self.onSlideSelectedNext)
|
category=self.category, triggers=self.onSlideSelectedNextAction)
|
||||||
self.toolbar.addAction(self.nextItem)
|
self.toolbar.addAction(self.nextItem)
|
||||||
self.toolbar.addSeparator()
|
self.toolbar.addSeparator()
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
@ -1140,6 +1140,13 @@ class SlideController(Controller):
|
|||||||
rect.y(), rect.width(), rect.height())
|
rect.y(), rect.width(), rect.height())
|
||||||
self.slidePreview.setPixmap(winimg)
|
self.slidePreview.setPixmap(winimg)
|
||||||
|
|
||||||
|
def onSlideSelectedNextAction(self, checked):
|
||||||
|
"""
|
||||||
|
Wrapper function from create_action so we can throw away the
|
||||||
|
incorrect parameter
|
||||||
|
"""
|
||||||
|
self.onSlideSelectedNext()
|
||||||
|
|
||||||
def onSlideSelectedNext(self, wrap=None):
|
def onSlideSelectedNext(self, wrap=None):
|
||||||
"""
|
"""
|
||||||
Go to the next slide.
|
Go to the next slide.
|
||||||
|
Loading…
Reference in New Issue
Block a user