![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include "qwasmmediadevices_p.h"#include "private/qcameradevice_p.h"#include "private/qplatformmediaintegration_p.h"#include "qwasmwebaudiosource_p.h"#include "qwasmwebaudiosink_p.h"#include "qwasmaudiodevice_p.h"#include <QMap>#include <QDebug>#include <emscripten.h>Go to the source code of this file.
Functions | |
| QT_BEGIN_NAMESPACE | Q_GLOBAL_STATIC (QWasmMediaDevices, s_wasmMediaDevicesInstance) |
| bool | isFirefox () |
| EMSCRIPTEN_KEEPALIVE void | qtMediaDevicesOnAudioOutputSelected () |
| EM_JS (void, setupAudioOutputSelector,(), { const overlay=document.createElement('div');overlay.style.cssText='position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);z-index:9999;display:flex;align-items:center;justify-content:center;';const dialog=document.createElement('div');dialog.style.cssText='background:white;padding:24px;border-radius:8px;text-align:center;font-family:sans-serif;min-width:240px;';const message=document.createElement('p');message.textContent='Select an audio output device to continue.';message.style.cssText='margin:0 0 16px 0;font-size:14px;';const button=document.createElement('button');button.textContent='Select Audio Output';button.style.cssText='padding:8px 16px;font-size:14px;cursor:pointer;';button.addEventListener('click', async()=> { document.body.removeChild(overlay);try { const deviceInfo=await navigator.mediaDevices.selectAudioOutput();console.log("Selected device: ", deviceInfo.label);Module._qtMediaDevicesOnAudioOutputSelected();} catch(err) { console.error(err);} }, { once:true });dialog.appendChild(message);dialog.appendChild(button);overlay.appendChild(dialog);document.body.appendChild(overlay);}) | |
| EM_JS | ( | void | , |
| setupAudioOutputSelector | , | ||
| () | , | ||
| { const overlay=document.createElement('div');overlay.style.cssText='position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);z-index:9999;display:flex;align-items:center;justify-content:center;';const dialog=document.createElement('div');dialog.style.cssText='background:white;padding:24px;border-radius:8px;text-align:center;font-family:sans-serif;min-width:240px;';const message=document.createElement('p');message.textContent='Select an audio output device to continue.';message.style.cssText='margin:0 0 16px 0;font-size:14px;';const button=document.createElement('button');button.textContent='Select Audio Output';button.style.cssText='padding:8px 16px;font-size:14px;cursor:pointer;';button.addEventListener('click', async()=> { document.body.removeChild(overlay);try { const deviceInfo=await navigator.mediaDevices.selectAudioOutput();console.log("Selected device: ", deviceInfo.label);Module._qtMediaDevicesOnAudioOutputSelected();} catch(err) { console.error(err);} }, { once:true });dialog.appendChild(message);dialog.appendChild(button);overlay.appendChild(dialog);document.body.appendChild(overlay);} | ) |
| bool isFirefox | ( | ) |
Definition at line 22 of file qwasmmediadevices.cpp.
Referenced by QWasmMediaDevices::initDevices().
| QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC | ( | QWasmMediaDevices | , |
| s_wasmMediaDevicesInstance | ) |
| EMSCRIPTEN_KEEPALIVE void qtMediaDevicesOnAudioOutputSelected | ( | ) |
Definition at line 29 of file qwasmmediadevices.cpp.
References QWasmMediaDevices::getMediaDevices(), and QWasmMediaDevices::instance().