# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Meinert Jordan, Armin Köhler, Edwin Lunando, Joshua Miller, Stevan Pettit, # # Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, # # Simon Scudder, Jeffrey Smith, Maikel Stuivenberg, Martin Thompson, Jon # # Tibble, Dave Warnock, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # # Software Foundation; version 2 of the License. # # # # This program is distributed in the hope that it will be useful, but WITHOUT # # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # more details. # # # # You should have received a copy of the GNU General Public License along # # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import logging from openlp.core.lib.mediaplayer import MediaPlayer from openlp.core.ui.media import MediaState log = logging.getLogger(__name__) VIDEO_CSS = u""" #videobackboard { z-index:3; background-color: black; } #video1 { z-index:4; } #video2 { z-index:4; } """ VIDEO_JS = u""" var video_timer = null; var current_video = '1'; 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