문제

I'm using libvlc and python to play vidoes.

I've searched the libvlc API documentation and here on StackOverflow, but i couldn't find a solution for 2 issues i'm struggling with:

  1. How to position the VLC video playback window in the center of the screen.
  2. How to hide the window title, so that only the video will be visible.

Any help would be much appreciated :)

도움이 되었습니까?

해결책

Well, i got it working :-)

Once i got to know PyQt better, i was able to handle it properly.

If anyone is interested in the solutions to the two problems:

The 1st problem was solved by learning how to center elements in PyQt. To be more precise, I used the following code to achieve that:

def center_element(element):
    element.move(QtGui.QDesktopWidget().screenGeometry(1).center() -  element.rect().center())

The 2nd problem was solved by adding the following code when initializing a QtWidget (self refers to the widget):

self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top