[vlc-commits] Fixed PyQt example for MacOS X platform.
Hendrik Buschmeier
git at videolan.org
Fri Oct 18 23:34:00 CEST 2013
vlc/python | branch: master | Hendrik Buschmeier <hbuschme at uni-bielefeld.de> | Thu Oct 17 07:48:31 2013 +0000| [e4ce04bca758d81550894dc88351d96526723278] | committer: Olivier Aubert
Fixed PyQt example for MacOS X platform.
* Draws the video onto the QWidget instead of only showing a
a black box.
* Uses QMacCocoaViewContainer instead of QFrame as videoframe
QWidget.
* Uses MediaPlayer's set_nsobject method instead of set_agl.
* Fixes spelling error in QWidget method being called.
Signed-off-by: Olivier Aubert <contact at olivieraubert.net>
> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=e4ce04bca758d81550894dc88351d96526723278
---
examples/qtvlc.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/examples/qtvlc.py b/examples/qtvlc.py
index 34aeedc..2d427e7 100755
--- a/examples/qtvlc.py
+++ b/examples/qtvlc.py
@@ -46,7 +46,10 @@ class Player(QtGui.QMainWindow):
self.setCentralWidget(self.widget)
# In this widget, the video will be drawn
- self.videoframe = QtGui.QFrame()
+ if sys.platform == "darwin": # for MacOS
+ self.videoframe = QtGui.QMacCocoaViewContainer(0)
+ else:
+ self.videoframe = QtGui.QFrame()
self.palette = self.videoframe.palette()
self.palette.setColor (QtGui.QPalette.Window,
QtGui.QColor(0,0,0))
@@ -152,7 +155,7 @@ class Player(QtGui.QMainWindow):
elif sys.platform == "win32": # for Windows
self.mediaplayer.set_hwnd(self.videoframe.winId())
elif sys.platform == "darwin": # for MacOS
- self.mediaplayer.set_agl(self.videoframe.windId())
+ self.mediaplayer.set_nsobject(self.videoframe.winId())
self.PlayPause()
def setVolume(self, Volume):
More information about the vlc-commits
mailing list