summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2023-01-17 13:28:28 +1000
committerLorn Potter <lorn.potter@gmail.com>2023-01-29 18:11:19 +1000
commit111e3b8663b114a45baf750dcb8eb8fa674c964c (patch)
tree2171ddea2a0351a97094d4504b555584bc56d959
parente4dca02731408afe3fe4d537b75e8603aa0f5b10 (diff)
wasm: remove canvas size codeHEADdev
Removes redundant code that gets canvas size to update the video element and offscreencanvas. We now get this from the video itself. Pick-to: 6.5 Change-Id: I4063385316faad24aa0e5880d5e1c6abf94efabd Reviewed-by: MikoĊ‚aj Boc <Mikolaj.Boc@qt.io>
-rw-r--r--src/plugins/multimedia/wasm/common/qwasmvideooutput.cpp24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/plugins/multimedia/wasm/common/qwasmvideooutput.cpp b/src/plugins/multimedia/wasm/common/qwasmvideooutput.cpp
index 2c84824cc..041d10254 100644
--- a/src/plugins/multimedia/wasm/common/qwasmvideooutput.cpp
+++ b/src/plugins/multimedia/wasm/common/qwasmvideooutput.cpp
@@ -661,29 +661,7 @@ void QWasmVideoOutput::doElementCallbacks()
void QWasmVideoOutput::updateVideoElementGeometry(const QRect &windowGeometry)
{
- qCDebug(qWasmMediaVideoOutput) << Q_FUNC_INFO;
-
- // if (m_videoElementSource.isUndefined() || m_videoElementSource.isNull())
- // return;
- // Resolve the geometry against Qt canvas geometry, in case the canvas
- // is offset (not at (0,0)) relative to the body element. The id for the
- // canvas is set in the .html file, in this case "qtcanvas" when using the
- // default generated html.
-
- emscripten::val document = emscripten::val::global("document");
-
- emscripten::val canvas =
- document.call<emscripten::val>("getElementById", std::string("qtcanvas"));
-
- emscripten::val contextAttributes = emscripten::val::array();
- contextAttributes.set("preserveDrawingBuffer", true);
-
- if (canvas.isUndefined())
- qFatal("Could not find canvas element");
-
- emscripten::val rect = canvas.call<emscripten::val>("getBoundingClientRect");
- QPoint canvasPosition(rect["left"].as<int>(), rect["top"].as<int>());
- QRect m_videoElementSource(windowGeometry.topLeft() + canvasPosition, windowGeometry.size());
+ QRect m_videoElementSource(windowGeometry.topLeft(), windowGeometry.size());
emscripten::val style = m_video["style"];
style.set("left", QString("%1px").arg(m_videoElementSource.left()).toStdString());