PySide6.QtMultimediaWidgets.QVideoWidget¶
- class QVideoWidget¶
QVideoWidget类提供了一个用于显示由媒体对象生成的视频的小部件。更多…概要¶
属性¶
aspectRatioModeᅟ- 视频如何根据其宽高比进行缩放fullScreenᅟ- 视频显示是否仅限于窗口或全屏
方法¶
def
__init__()def
videoSink()
插槽¶
def
setFullScreen()
信号¶
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
警告
本节包含从C++自动翻译到Python的代码片段,可能包含错误。
将
QVideoWidget附加到QMediaPlayer或QCamera上,可以显示该对象的视频或图像输出。player = QMediaPlayer() player.setSource(QUrl("http://example.com/myclip1.mp4")) videoWidget = QVideoWidget() player.setVideoOutput(videoWidget) videoWidget.show() player.play()
注意: 一次只能将一个显示输出附加到媒体对象上。
注意
当使用
from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。- property aspectRatioModeᅟ: Qt.AspectRatioMode¶
此属性决定了视频如何根据其宽高比进行缩放。
- Access functions:
- property fullScreenᅟ: bool¶
此属性决定视频显示是限制在窗口内还是全屏显示。
- Access functions:
构建一个新的视频小部件。
parent被传递给 QWidget。- aspectRatioMode()¶
- Return type:
另请参阅
属性
aspectRatioModeᅟ的获取器。- aspectRatioModeChanged(mode)¶
- Parameters:
模式 –
AspectRatioMode
属性
aspectRatioModeᅟ的通知信号。- fullScreenChanged(fullScreen)¶
- Parameters:
fullScreen – 布尔值
属性
fullScreenᅟ的通知信号。- setAspectRatioMode(mode)¶
- Parameters:
模式 –
AspectRatioMode
另请参阅
属性
aspectRatioModeᅟ的设置器。- setFullScreen(fullScreen)¶
- Parameters:
fullScreen – 布尔值
另请参阅
属性
fullScreenᅟ的设置器。- videoSink()¶
- Return type:
返回
QVideoSink实例。