Skip to main content

py_qt_video_player

A simple video player based on PyQt6.

Installation

pip install py_qt_video_player

Usage

[!TIP] You can press the Spacebar to toggle video play and pause, and use the bracket keys to adjust the playback speed.

You can use the arrow keys on your keyboard to control video progress and volume.

Normal Usage

import sys
from PyQt6.QtWidgets import QApplication
from py_qt_video_player import QtVideoPlayer

app = QApplication(sys.argv)
win = QtVideoPlayer()

video_path = r"test.mp4"
srt_path = None # Optional srt filepath
win.set_video_and_subtitle(video_path, srt_path)

win.show()
sys.exit(app.exec())

Ban/Allow user operation

import sys
from PyQt6.QtWidgets import QApplication
from py_qt_video_player import QtVideoPlayer

app = QApplication(sys.argv)
win = QtVideoPlayer()

video_path = r"test.mp4"
win.set_video_and_subtitle(video_path)

win.play()
# win.pause() # Pause video by program

win.seek(3.0) # seek to 3s

win.ban_operation() # use can not operate panel after ban_operation (except for volume)

# you can allow user operation after `ban_operation`
# win.allow_operation() 

win.show()
sys.exit(app.exec())

Set timer callback

import sys
from PyQt6.QtWidgets import QApplication
from py_qt_video_player import QtVideoPlayer

app = QApplication(sys.argv)
win = QtVideoPlayer()

video_path = r"test.mp4"
win.set_video_and_subtitle(video_path)

def callback():
    import time
    win.toggle_play_pause() # pause every 1.0s

# callback function will be called in main thread in about every 1.0s
win.set_timer_callback(callback, 1.0)

# Use this command after `win.set_timer_callback` to ban timer callback
# win.set_timer_callback(None)

win.show()
sys.exit(app.exec())

Metadata

Release files for py-qt-video-player 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-qt-video-player 0.1.2
File Size Uploaded
py_qt_video_player-0.1.2.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-qt-video-player 0.1.2
File Interpreter ABI Platform
py_qt_video_player-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / py_qt_video_player-0.1.2.tar.gz

Download URL py_qt_video_player-0.1.2.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
59e4d5a7a0b37f07fa16634abaf0028e7406a1441d8173a12737bed0f3da9be8
BLAKE2b-256 checksum
How to use checksums
fcc1b4b0b4e2e7563461b05c05a285b55199384c15740f369c91880f0e89e9cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.12 Windows/11

Release files / py_qt_video_player-0.1.2-py3-none-any.whl

Download URL py_qt_video_player-0.1.2-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfb85c6258c1eab18e9a30e2b69fc0cfe74e1f3b9f7f6832d2b5aa85b7aab001
BLAKE2b-256 checksum
How to use checksums
64adfc6ac60e68edfeb30fe7877aba2c1f512b887793f904209dc802921f8a81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.12 Windows/11

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page