forked from openlp/openlp
Fixed bug 900038. Corrected signal names. Corrected pause/stop check.
bzr-revno: 1907 Fixes: https://launchpad.net/bugs/900038
This commit is contained in:
commit
2d18402e0b
@ -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):
|
||||||
@ -451,6 +456,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() > \
|
||||||
|
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user