From e19161e0399465627a27d068cdcd91606c61d81d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 7 Mar 2013 16:05:17 +0100 Subject: [PATCH 01/39] use loop video attribute; fixed regression prevent media adding --- openlp/core/ui/media/mediacontroller.py | 2 +- openlp/core/ui/media/webkitplayer.py | 130 +++++++----------------- 2 files changed, 35 insertions(+), 97 deletions(-) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index cc39cb5f8..c6df532e4 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -440,7 +440,7 @@ class MediaController(object): controller.media_info = MediaInfo() controller.media_info.volume = 0 controller.media_info.file_info = QtCore.QFileInfo(service_item.get_frame_path()) - display = controller._display + display = controller.preview_display if not self._check_file_type(controller, display, service_item): # Media could not be loaded correctly critical_error_message_box(translate('MediaPlugin.MediaItem', 'Unsupported File'), diff --git a/openlp/core/ui/media/webkitplayer.py b/openlp/core/ui/media/webkitplayer.py index 7262622bb..031e3bbd0 100644 --- a/openlp/core/ui/media/webkitplayer.py +++ b/openlp/core/ui/media/webkitplayer.py @@ -44,113 +44,57 @@ VIDEO_CSS = u""" z-index:3; background-color: %(bgcolor)s; } -#video1 { - background-color: %(bgcolor)s; - z-index:4; -} -#video2 { +#video { background-color: %(bgcolor)s; z-index:4; } """ VIDEO_JS = u""" - var video_timer = null; - var current_video = '1'; + function show_video(state, path, volume, loop, variable_value){ + // Sometimes video.currentTime stops slightly short of video.duration and video.ended is intermittent! - function show_video(state, path, volume, loop, varVal){ - // Note, the preferred method for looping would be to use the - // video tag loop attribute. - // But QtWebKit doesn't support this. Neither does it support the - // onended event, hence the setInterval() - // In addition, setting the currentTime attribute to zero to restart - // the video raises an INDEX_SIZE_ERROR: DOM Exception 1 - // To complicate it further, sometimes vid.currentTime stops - // slightly short of vid.duration and vid.ended is intermittent! - // - // Note, currently the background may go black between loops. Not - // desirable. Need to investigate using two