سؤال

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