A request for populating a dialog with available sources for screen capturing. More...
| Header: | #include <QWebEngineDesktopMediaRequest> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore) |
| qmake: | QT += webenginecore |
| Since: | Qt 6.7 |
| In QML: | WebEngineDesktopMediaRequest |
| void | cancel() const |
| QAbstractListModel * | screensModel() const |
| void | selectScreen(const QModelIndex &index) const |
| void | selectWindow(const QModelIndex &index) const |
| QAbstractListModel * | windowsModel() const |
To allow web applications to capture contents of a display, applications must connect to QWebEnginePage::desktopMediaRequested, which takes a QWebEngineDesktopMediaRequest instance as an argument.
If a web application requests access to the contents of a display, QWebEnginePage::desktopMediaRequested will be emitted with a QWebEngineDesktopMediaRequest 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() or selectWindow() to accept the request and start screensharing.
See also QWebEnginePage::desktopMediaRequested().
[invokable] void QWebEngineDesktopMediaRequest::cancel() constRejects a request. Screen capturing will be aborted.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Returns a QAbstractListModel for the available screens.
Note: Getter function for property screensModel.
See also windowsModel().
[invokable] void QWebEngineDesktopMediaRequest::selectScreen(const
QModelIndex &index) constSelects the screen at the index to be captured.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also QWebEngineDesktopMediaRequest::selectWindow().
[invokable] void QWebEngineDesktopMediaRequest::selectWindow(const
QModelIndex &index) constSelects the window at the index to be captured.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also QWebEngineDesktopMediaRequest::selectScreen().
Returns a QAbstractListModel for the available windows.
Note: Getter function for property windowsModel.
See also screensModel().
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: