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- QWebEngineDesktopMediaRequestinstance as an argument.- If a web application requests access to the contents of a display, - desktopMediaRequestedwill be emitted with a- QWebEngineDesktopMediaRequestinstance 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 - 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 - Note - Properties can be used directly when - from __feature__ import true_propertyis 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 - indexto be captured.- See also - selectWindow(index)¶
- Parameters:
- index – - QModelIndex
 
 - Selects the window at the - indexto be captured.- See also - windowsModel()¶
- Return type:
 
 - Returns a QAbstractListModel for the available windows. - See also - Getter of property - windowsModelᅟ.