We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code example:
import asyncio import qasync from PySide6 import QtWidgets, QtMultimedia, QtMultimediaWidgets app = QtWidgets.QApplication([]) loop = qasync.QEventLoop(app) asyncio.set_event_loop(loop) class VideoItemWidget(QtWidgets.QWidget): def __init__(self, parent=None): super().__init__(parent) self.setLayout(QtWidgets.QVBoxLayout()) asyncio.ensure_future(self.init()) async def init(self): self.player = QtMultimedia.QMediaPlayer() self.player.setLoops(QtMultimedia.QMediaPlayer.Loops.Infinite) self.player.setSource('XXX.mp4') self.preview_widget = QtMultimediaWidgets.QVideoWidget() self.preview_widget.setMinimumSize(800, 600) self.player.setVideoOutput(self.preview_widget) self.layout().addWidget(self.preview_widget) self.player.mediaStatusChanged.connect(self.play) def play(self): self.player.play() w = VideoItemWidget() w.show() loop.run_forever()
This code is work on native PySide6
from PySide6 import QtWidgets, QtMultimedia, QtMultimediaWidgets class VideoItemWidget(QtWidgets.QWidget): def __init__(self, parent=None): super().__init__(parent) self.player = QtMultimedia.QMediaPlayer() self.player.setLoops(QtMultimedia.QMediaPlayer.Loops.Infinite) self.player.setSource('XXX.mp4') self.preview_widget = QtMultimediaWidgets.QVideoWidget() self.preview_widget.setMinimumSize(800, 600) self.player.setVideoOutput(self.preview_widget) self.setLayout(QtWidgets.QVBoxLayout()) self.layout().addWidget(self.preview_widget) self.player.mediaStatusChanged.connect(self.play) def play(self): self.player.play() app = QtWidgets.QApplication([]) w = VideoItemWidget() w.show() app.exec()
I want to construct it in Coroutine because I have a lot of video to preview, so I want use async/await to optimize user experience
The text was updated successfully, but these errors were encountered:
Cannot reproduce, works ok using windows, python3.11 and pyside6.5.2. Can you be more specific about your environment and versions perhaps?
Sorry, something went wrong.
Sorry for reply late.
I'm using MacBook Pro (M1 32GB), macOS Ventura 13.5.2, PySide6.4.2, python 3.9.13.
And yes, when I find a Windows machine with PySdie6.4.2 & python 3.9.13, it works fine. So I guess this bug related to system platform.
hosaka
No branches or pull requests
code example:
This code is work on native PySide6
I want to construct it in Coroutine because I have a lot of video to preview, so I want use async/await to optimize user experience
The text was updated successfully, but these errors were encountered: