PySide6.QtWebEngineCore.QWebEngineDesktopMediaRequest

class QWebEngineDesktopMediaRequest

A request for populating a dialog with available sources for screen capturing.

Details

To allow web applications to capture contents of a display, applications must connect to desktopMediaRequested , which takes a QWebEngineDesktopMediaRequest instance as an argument.

If a web application requests access to the contents of a display, 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.

Added in version 6.7.

Synopsis

Properties

Methods

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

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:

otherQWebEngineDesktopMediaRequest

cancel()

Rejects a request. Screen capturing will be aborted.

screensModel()
Return type:

QAbstractListModel

Returns a QAbstractListModel for the available screens.

See also

windowsModel()

Getter of property screensModelᅟ .

selectScreen(index)
Parameters:

indexQModelIndex

Selects the screen at the index to be captured.

See also

selectWindow()

selectWindow(index)
Parameters:

indexQModelIndex

Selects the window at the index to be captured.

See also

selectScreen()

windowsModel()
Return type:

QAbstractListModel

Returns a QAbstractListModel for the available windows.

See also

screensModel()

Getter of property windowsModelᅟ .