forked from openlp/openlp
handle missing live display preserve prview
This commit is contained in:
parent
6bea242ae4
commit
737d320b3d
@ -125,8 +125,10 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties):
|
|||||||
self.setup()
|
self.setup()
|
||||||
self.vlc_player = VlcPlayer(self)
|
self.vlc_player = VlcPlayer(self)
|
||||||
State().add_service("mediacontroller", 0)
|
State().add_service("mediacontroller", 0)
|
||||||
|
State().add_service("media_live", 0, requires="mediacontroller")
|
||||||
if get_vlc() and pymediainfo_available:
|
if get_vlc() and pymediainfo_available:
|
||||||
State().update_pre_conditions("mediacontroller", True)
|
State().update_pre_conditions("mediacontroller", True)
|
||||||
|
State().update_pre_conditions('media_live', True)
|
||||||
else:
|
else:
|
||||||
State().missing_text("mediacontroller", translate('OpenLP.SlideController',
|
State().missing_text("mediacontroller", translate('OpenLP.SlideController',
|
||||||
"VLC or pymediainfo are missing, so you are unable to play any media"))
|
"VLC or pymediainfo are missing, so you are unable to play any media"))
|
||||||
@ -141,7 +143,7 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties):
|
|||||||
try:
|
try:
|
||||||
self.setup_display(self.live_controller.display, False)
|
self.setup_display(self.live_controller.display, False)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
State().update_pre_conditions('media', False)
|
State().update_pre_conditions('media_live', False)
|
||||||
self.setup_display(self.preview_controller.preview_display, True)
|
self.setup_display(self.preview_controller.preview_display, True)
|
||||||
|
|
||||||
def display_controllers(self, controller_type):
|
def display_controllers(self, controller_type):
|
||||||
|
@ -34,6 +34,19 @@ from openlp.core.ui.icons import UiIcons
|
|||||||
LINUX_STREAM = 'v4l2:///dev/video0'
|
LINUX_STREAM = 'v4l2:///dev/video0'
|
||||||
WIN_STREAM = 'dshow:// :dshow-vdev='
|
WIN_STREAM = 'dshow:// :dshow-vdev='
|
||||||
|
|
||||||
|
#from PyQt5.QtMultimedia import QCameraInfo, QAudioDeviceInfo, QAudio
|
||||||
|
|
||||||
|
#print('Video input:')
|
||||||
|
#for cam in QCameraInfo.availableCameras():
|
||||||
|
# print('===============')
|
||||||
|
### print(cam.deviceName())
|
||||||
|
# print(cam.description())#
|
||||||
|
#print()
|
||||||
|
#print('Audio input:')
|
||||||
|
#for au in QAudioDeviceInfo.availableDevices(QAudio.AudioInput):
|
||||||
|
# print('===============')
|
||||||
|
# print(au.deviceName())
|
||||||
|
|
||||||
|
|
||||||
class MediaTab(SettingsTab):
|
class MediaTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
|
@ -116,6 +116,8 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties):
|
|||||||
self.can_preview = False
|
self.can_preview = False
|
||||||
self.can_make_live = False
|
self.can_make_live = False
|
||||||
self.can_add_to_service = False
|
self.can_add_to_service = False
|
||||||
|
if State().check_preconditions('media_live'):
|
||||||
|
self.can_make_live = False
|
||||||
|
|
||||||
def add_list_view_to_toolbar(self):
|
def add_list_view_to_toolbar(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user