From 564f63d67d9648873a33949a4fc42c4b3675546c Mon Sep 17 00:00:00 2001 From: Michal Sykacek <75931611+sykacek@users.noreply.github.com> Date: Sun, 3 Nov 2024 12:21:44 -0500 Subject: [PATCH] example/pyqtvlc.py aesthetics (#286) * init audio with non_zero value (pyqt5vlc.py) * add shortcuts to example/pyqt5vlc.py --- examples/pyqt5vlc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/pyqt5vlc.py b/examples/pyqt5vlc.py index e733fba..13deb3a 100644 --- a/examples/pyqt5vlc.py +++ b/examples/pyqt5vlc.py @@ -46,6 +46,7 @@ def __init__(self, master=None): # Create an empty vlc media player self.mediaplayer = self.instance.media_player_new() + self.mediaplayer.audio_set_volume(50) self.create_ui() self.is_paused = False @@ -104,8 +105,13 @@ def create_ui(self): # Add actions to file menu open_action = QtWidgets.QAction("Load Video", self) - close_action = QtWidgets.QAction("Close App", self) + open_shortcut = QtGui.QKeySequence(QtGui.QKeySequence.StandardKey.Open) + open_action.setShortcut(open_shortcut) file_menu.addAction(open_action) + + close_action = QtWidgets.QAction("Close App", self) + close_shortcut = QtGui.QKeySequence(QtGui.QKeySequence.StandardKey.Close) + close_action.setShortcut(close_shortcut) file_menu.addAction(close_action) open_action.triggered.connect(self.open_file)