forked from openlp/openlp
Clean up video api
This commit is contained in:
parent
34b4828c30
commit
90a3493d89
@ -350,20 +350,16 @@ class MediaController(object):
|
||||
"""
|
||||
player.resize(display)
|
||||
|
||||
def video(self, source, serviceItem, muted, isBackground,
|
||||
hidden=False):
|
||||
def video(self, source, serviceItem, hidden=False):
|
||||
"""
|
||||
Loads and starts a video to run with the option of sound
|
||||
|
||||
``source``
|
||||
Where the call originated form
|
||||
|
||||
``serviceItem``
|
||||
The player which is doing the playing
|
||||
|
||||
``muted``
|
||||
The player which is doing the playing
|
||||
|
||||
``isBackground``
|
||||
The player which is doing the playing
|
||||
|
||||
``hidden``
|
||||
The player which is doing the playing
|
||||
"""
|
||||
@ -373,13 +369,14 @@ class MediaController(object):
|
||||
# stop running videos
|
||||
self.media_reset(controller)
|
||||
controller.media_info = MediaInfo()
|
||||
if muted:
|
||||
if source == DisplayControllerType.Plugin:
|
||||
controller.media_info.volume = 0
|
||||
controller.media_info.is_background = False
|
||||
else:
|
||||
controller.media_info.volume = controller.volumeSlider.value()
|
||||
controller.media_info.is_background = True
|
||||
controller.media_info.file_info = \
|
||||
QtCore.QFileInfo(serviceItem.get_filename())
|
||||
controller.media_info.is_background = isBackground
|
||||
display = None
|
||||
#self.curDisplayMediaPlayer[u'current'] = serviceItem.name
|
||||
if controller.isLive:
|
||||
|
@ -1355,8 +1355,7 @@ class SlideController(DisplayController):
|
||||
Respond to the arrival of a media service item
|
||||
"""
|
||||
log.debug(u'SlideController onMediaStart')
|
||||
self.mediaController.video(self.controllerType, item, False, False, \
|
||||
self.hideMode())
|
||||
self.mediaController.video(self.controllerType, item, self.hideMode())
|
||||
if not self.isLive:
|
||||
self.previewDisplay.show()
|
||||
self.slidePreview.hide()
|
||||
|
@ -161,7 +161,6 @@ class MediaMediaItem(MediaManagerItem):
|
||||
"""
|
||||
Called to replace Live background with the media selected.
|
||||
"""
|
||||
# Todo fix me up
|
||||
if check_item_selected(self.listView,
|
||||
translate('MediaPlugin.MediaItem',
|
||||
'You must select a media file to replace the background with.')):
|
||||
@ -175,7 +174,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
(path, name) = os.path.split(filename)
|
||||
service_item.add_from_command(path, name,CLAPPERBOARD)
|
||||
if self.plugin.liveController.mediaController.video(
|
||||
DisplayControllerType.Live, service_item, True, True):
|
||||
DisplayControllerType.Live, service_item):
|
||||
self.resetAction.setVisible(True)
|
||||
else:
|
||||
critical_error_message_box(UiStrings().LiveBGError,
|
||||
|
Loading…
Reference in New Issue
Block a user