I'm trying to embed a VLC player in a python application based on PyQt4. Currently, I'am able to display a video using VLC Python bindings but only in a separate windows (title: VLC Direct3D output) with the following code:
Code: Select all
import sys
from PyQt4 import Qt
import vlc
app = Qt.QApplication(sys.argv)
video = Qt.QWidget()
video.setMinimumSize(300, 300)
path="xxx"
instance=vlc.Instance()
media=instance.media_new(path)
player=instance.media_player_new()
player.set_media(media)
#Is it correct? Without these 2 lines I get a separate video display otherwise I see nothing...
hwnd = video.winId().__hex__()
player.set_hwnd(hwnd);
player.play()
video.show()
app.exec_()
Thanks!