preview issue fixed

This commit is contained in:
rimach 2011-08-23 22:19:45 +02:00
parent f1d7284e8d
commit 565c429bf9
6 changed files with 24 additions and 16 deletions

View File

@ -53,8 +53,8 @@ body {
position: absolute; position: absolute;
left: 0px; left: 0px;
top: 0px; top: 0px;
width: %spx; width: 100%%;//%spx;
height: %spx; height: 100%%;//%spx;
} }
#black { #black {
z-index: 8; z-index: 8;

View File

@ -69,6 +69,10 @@ class Display(QtGui.QGraphicsView):
QtWebKit.QWebSettings.PluginsEnabled, True) QtWebKit.QWebSettings.PluginsEnabled, True)
self.page = self.webView.page() self.page = self.webView.page()
self.frame = self.page.mainFrame() self.frame = self.page.mainFrame()
self.frame.setScrollBarPolicy(QtCore.Qt.Vertical,
QtCore.Qt.ScrollBarAlwaysOff)
self.frame.setScrollBarPolicy(QtCore.Qt.Horizontal,
QtCore.Qt.ScrollBarAlwaysOff)
screen = {} screen = {}
screen[u'size'] = self.size() screen[u'size'] = self.size()
serviceItem = ServiceItem() serviceItem = ServiceItem()

View File

@ -135,6 +135,7 @@ class MediaManager(object):
self.Timer.stop() self.Timer.stop()
else: else:
for display in self.curDisplayMediaAPI.keys(): for display in self.curDisplayMediaAPI.keys():
self.curDisplayMediaAPI[display].resize(display)
self.curDisplayMediaAPI[display].update_ui(display) self.curDisplayMediaAPI[display].update_ui(display)
if self.curDisplayMediaAPI[display] \ if self.curDisplayMediaAPI[display] \
.state == MediaState.Playing: .state == MediaState.Playing:
@ -228,7 +229,6 @@ class MediaManager(object):
return return
if display == self.parent.previewController.previewDisplay or \ if display == self.parent.previewController.previewDisplay or \
display == self.parent.liveController.previewDisplay: display == self.parent.liveController.previewDisplay:
display.resize(display.controller.slidePreview.size())
display.hasAudio = False display.hasAudio = False
for api in self.APIs.values(): for api in self.APIs.values():
api.setup(display) api.setup(display)
@ -246,9 +246,6 @@ class MediaManager(object):
After Mainwindow changes or Splitter moved all related media After Mainwindow changes or Splitter moved all related media
widgets have to be resized widgets have to be resized
""" """
if display == self.parent.previewController.previewDisplay or \
display == self.parent.liveController.previewDisplay:
display.resize(controller.slidePreview.size())
api.resize(display) api.resize(display)
def video(self, controller, file, muted, isBackground): def video(self, controller, file, muted, isBackground):

View File

@ -98,9 +98,10 @@ class PhononAPI(MediaAPI):
display.phononWidget = Phonon.VideoWidget(display) display.phononWidget = Phonon.VideoWidget(display)
display.phononWidget.resize(display.size()) display.phononWidget.resize(display.size())
display.mediaObject = Phonon.MediaObject(display) display.mediaObject = Phonon.MediaObject(display)
Phonon.createPath(display.mediaObject, display.phononWidget)
if display.hasAudio:
display.audio = Phonon.AudioOutput( \ display.audio = Phonon.AudioOutput( \
Phonon.VideoCategory, display.mediaObject) Phonon.VideoCategory, display.mediaObject)
Phonon.createPath(display.mediaObject, display.phononWidget)
Phonon.createPath(display.mediaObject, display.audio) Phonon.createPath(display.mediaObject, display.audio)
display.phononWidget.raise_() display.phononWidget.raise_()
display.phononWidget.hide() display.phononWidget.hide()

View File

@ -203,8 +203,8 @@ class WebkitAPI(MediaAPI):
var flashMovie = getFlashMovieObject("OpenLPFlashMovie"); var flashMovie = getFlashMovieObject("OpenLPFlashMovie");
var src = "src = 'file:///" + path + "'"; var src = "src = 'file:///" + path + "'";
var view_parm = " wmode='opaque'" + var view_parm = " wmode='opaque'" +
" width='" + window.innerWidth + "'" + " width='100%%'" +
" height='" + window.innerHeight + "'"; " height='100%%'";
var swf_parm = " name='OpenLPFlashMovie'" + var swf_parm = " name='OpenLPFlashMovie'" +
" autostart='true' loop='false' play='true'" + " autostart='true' loop='false' play='true'" +
" hidden='false' swliveconnect='true' allowscriptaccess='always'" + " hidden='false' swliveconnect='true' allowscriptaccess='always'" +
@ -275,8 +275,11 @@ class WebkitAPI(MediaAPI):
def load(self, display): def load(self, display):
log.debug(u'load vid in Webkit Controller') log.debug(u'load vid in Webkit Controller')
controller = display.controller controller = display.controller
if display.hasAudio:
volume = controller.media_info.volume volume = controller.media_info.volume
vol = float(volume) / float(100) vol = float(volume) / float(100)
else:
vol = 0
path = controller.media_info.file_info.absoluteFilePath() path = controller.media_info.file_info.absoluteFilePath()
if controller.media_info.is_background: if controller.media_info.is_background:
loop = u'true' loop = u'true'
@ -329,7 +332,7 @@ class WebkitAPI(MediaAPI):
def volume(self, display, vol): def volume(self, display, vol):
controller = display.controller controller = display.controller
# 1.0 is the highest value # 1.0 is the highest value
if display.hasVolume: if display.hasAudio:
vol = float(vol) / float(100) vol = float(vol) / float(100)
if not controller.media_info.isFlash: if not controller.media_info.isFlash:
display.frame.evaluateJavaScript( display.frame.evaluateJavaScript(

View File

@ -417,9 +417,8 @@ class SlideController(Controller):
# The SlidePreview's ratio. # The SlidePreview's ratio.
self.ratio = float(self.screens.current[u'size'].width()) / \ self.ratio = float(self.screens.current[u'size'].width()) / \
float(self.screens.current[u'size'].height()) float(self.screens.current[u'size'].height())
self.previewSizeChanged()
self.mediaManager.setup_display(self.display) self.mediaManager.setup_display(self.display)
self.previewDisplay.resize(self.slidePreview.size()) self.previewSizeChanged()
self.previewDisplay.setup() self.previewDisplay.setup()
self.mediaManager.setup_display(self.previewDisplay) self.mediaManager.setup_display(self.previewDisplay)
if self.serviceItem: if self.serviceItem:
@ -443,11 +442,15 @@ class SlideController(Controller):
max_height = self.previewFrame.height() - self.grid.margin() * 2 max_height = self.previewFrame.height() - self.grid.margin() * 2
self.slidePreview.setFixedSize(QtCore.QSize(max_height * self.ratio, self.slidePreview.setFixedSize(QtCore.QSize(max_height * self.ratio,
max_height)) max_height))
self.previewDisplay.setFixedSize(QtCore.QSize(max_height * self.ratio,
max_height))
else: else:
# We have to take the width as limit. # We have to take the width as limit.
max_width = self.previewFrame.width() - self.grid.margin() * 2 max_width = self.previewFrame.width() - self.grid.margin() * 2
self.slidePreview.setFixedSize(QtCore.QSize(max_width, self.slidePreview.setFixedSize(QtCore.QSize(max_width,
max_width / self.ratio)) max_width / self.ratio))
self.previewDisplay.setFixedSize(QtCore.QSize(max_width,
max_width / self.ratio))
# Make sure that the frames have the correct size. # Make sure that the frames have the correct size.
self.previewListWidget.setColumnWidth(0, self.previewListWidget.setColumnWidth(0,
self.previewListWidget.viewport().size().width()) self.previewListWidget.viewport().size().width())