PySide6.QtWebEngineCore.QWebEngineDesktopMediaRequest¶
- class QWebEngineDesktopMediaRequest¶
A request for populating a dialog with available sources for screen capturing. More…
Added in version 6.7.
Synopsis¶
Properties¶
Methods¶
def
__init__()
def
cancel()
def
screensModel()
def
selectScreen()
def
selectWindow()
def
windowsModel()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
To allow web applications to capture contents of a display, applications must connect to
desktopMediaRequested
, which takes aQWebEngineDesktopMediaRequest
instance as an argument.If a web application requests access to the contents of a display,
desktopMediaRequested
will be emitted with aQWebEngineDesktopMediaRequest
instance as an argument which holds references to QAbstractListModels for available windows and screens that can be captured.The data model’s Qt::DisplayRole specifies the name of the source which is the title of a window or the number of the display. The model is dynamically updated if the available list of sources has changed; e.g when a window is opened/closed.
The signal handler needs to then either call
selectScreen()
orselectWindow()
to accept the request and start screensharing.See also
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property screensModelᅟ: QAbstractListModel¶
- Access functions:
- property windowsModelᅟ: QAbstractListModel¶
- Access functions:
- __init__(other)¶
- Parameters:
other –
QWebEngineDesktopMediaRequest
- cancel()¶
Rejects a request. Screen capturing will be aborted.
- screensModel()¶
- Return type:
Returns a QAbstractListModel for the available screens.
See also
Getter of property
screensModelᅟ
.- selectScreen(index)¶
- Parameters:
index –
QModelIndex
Selects the screen at the
index
to be captured.See also
- selectWindow(index)¶
- Parameters:
index –
QModelIndex
Selects the window at the
index
to be captured.See also
- windowsModel()¶
- Return type:
Returns a QAbstractListModel for the available windows.
See also
Getter of property
windowsModelᅟ
.