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;
left: 0px;
top: 0px;
width: %spx;
height: %spx;
width: 100%%;//%spx;
height: 100%%;//%spx;
}
#black {
z-index: 8;

View File

@ -69,6 +69,10 @@ class Display(QtGui.QGraphicsView):
QtWebKit.QWebSettings.PluginsEnabled, True)
self.page = self.webView.page()
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[u'size'] = self.size()
serviceItem = ServiceItem()

View File

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

View File

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

View File

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

View File

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